Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

is this uC 8-bit?

Status
Not open for further replies.
"8051 microcontroller core"

that is 8-bit microcontroller.
 
I'm trying to remember of all the things i dealt with when I was an embedded programmer few years ago,
Because I think that would be the main subject in the interviews, as now I'm QA engineer.

I got just a few days to remember everything.
 
T, regarding 8-bit.

8-bit CPU means that the address bus is composed of 8 wires.

However, it is not that there are only 2^8 = 256 memory addresses, each of size 8-bit, right?

So how come 8-bit CPU has over 256bytes of memory?

the 8-bit CPU actually uses the bus several times for every memory address?
 
T, regarding 8-bit.

8-bit CPU means that the address bus is composed of 8 wires.

However, it is not that there are only 2^8 = 256 memory addresses, each of size 8-bit, right?

So how come 8-bit CPU has over 256bytes of memory?

the 8-bit CPU actually uses the bus several times for every memory address?

And you hope to pass a job interview? :eek:

The DATA bus is 8 bits, the ADDRESS bus is usually 16 bit (so 64K memory - in theory) - this is absolutely basic simple information (similar to knowing what a steering wheel is if you were applying for a driving job).
 
Hi Nigel, thank you very much.

The data bus being 8 bit - does it mean that every time you approach a memoty address, you can write/read to/from it only 8 bits in each write/read operation?

i.e. to write 16-bit data into memory, you'd need 2 write operations?

My misunderstanding came from the following quote from Wiki:
In computer architecture, 8-bit integers, memory addresses, or other data units are those that are at most 8 bits (1 octet) wide. Also, 8-bit CPU and ALUarchitectures are those that are based on registers, address buses, or data buses of that size. 8-bit is also a term given to a generation of microcomputers in which 8-bit microprocessors were the norm.

it says here that address buses are 8-bit.
 
Hi Nigel, thank you very much.

The data bus being 8 bit - does it mean that every time you approach a memoty address, you can write/read to/from it only 8 bits in each write/read operation?

i.e. to write 16-bit data into memory, you'd need 2 write operations?

Yes, and likewise four writes to write 32 bits.

My misunderstanding came from the following quote from Wiki:


it says here that address buses are 8-bit.

Wiki isn't always right - and very often isn't.

There have been various schemes and devices over the years, but the number of bits refers to the main data operations inside the chip.

For example the 68000 series was a 32 bit processor, but externally had varying degrees of data and address pins depending on the specific model - with the data and address buses multiplexed onto fewer pins.
 
  • Like
Reactions: 3v0
Nigel, thank u very much again. :)

it also means thatnall the registers are 8-bit?as the sfrs, and general purpose registers?

however, it does mean that int would be 4-bytes, right?
so writing to int would cost four write cycles
 
however, it does mean that int would be 4-bytes, right?

Misconception..... An int means an integer!! a whole number..

byte = 8 bits
Word = 16 bits
DWord = 32 bits

All of the above are Int's
Most C compilers now give some type def's Short Long etc..
 
In general computers have physical memory. Each has a native word size which is how we determine how many bits it is. But past that, what memory is, or means is up to the software. Without the context of the program, memory is just a collection of bits/bytes without meaning.
 
Thank you very much!

I see that every uC has both Flash memory, which I assume it for Code Program (right?)

and RAM Memory which is for memory which the program consumes while it's running, right?

The CC2430 can have up to 128KB of Flash Memory - it doesn't mean that this model of CC2430 has 17-bit address bus so what does it mean if so?
 
Thank you very much!

I see that every uC has both Flash memory, which I assume it for Code Program (right?)
and RAM Memory which is for memory which the program consumes while it's running, right?

The CC2430 can have up to 128KB of Flash Memory - it doesn't mean that this model of CC2430 has 17-bit address bus so what does it mean if so?
Every micro controller needs some place to store the program. These days we are using flash memory to do so. We used to use EEPROM and before that EPROM etc. Technology keeps changing.

When flash was a new technology it had a limited number of write cycles. To store data that survived the loss of power they included EEPROM. Modern flash has an increased number of write cycles so they are starting to eliminate the EEPROM and use some of the flash memory in its place.

RAM memory is most often used for short term variable storage.

One common way to address large memory is bank switching. Start by looking where the author talks about bank switching on the CC2430.

I think you are asking the wrong questions. Rather I would have you do some reading to better understand the various memory types and methods of addressing it.
 
Hi 3V,
Thank you so much.

I understand what you said,
Flash / EEPROM are non-volatile memories, therefore they are used for storing the Code Program.
while RAM is volatile memory and it is used to store the data memory.

My quesiton is, for a CC2430 that has 128KB Flash memory, does it require 17-bit address but for approaching the flash's memory addresses?
 
CC2430 that has 128KB Flash memory, does it require 17-bit address but for approaching the flash's memory addresses?
Yes 17 bit but the CPU can only address 16 bits.
1) This is not how the 2430 works but may help explain.
My first desk top computer, a Z80, could only address 64k of memory. When I upgraded to a multitasking, I needed more memory. I had memory 64k on a board. I got 4 memory boards. 256k of memory. The CUP had to be tricked into using 4x more memory than it was designed for. One of the I/O ports went to address which memory card was to be used. By theory 256 x 64k. Each program, in the multitasking environment, had to fit into one 64k block. When it was tome to switch form one memory bank to another you needed to go to a certain location in memory, say 10 and then execute a I/O command that switched out memory bank 0 and switched in bank 1. This took you from bank 0 address 10 to bank 1 address 11. (any number from 0 to 255) This worked well. Each program got 64k. No choice. If the program was big, good. If the program was small it got 64k.
2)Next computer was a z180 that had a memory controller much like what you are looking at. The CPU can only think about 64k at a time. Programs are limited to 64K and data is limited to 64K.; But.....The CUP is thinking 0 through ffffh like normal. The I/O location where the bank address is stored is now slightly different. (there are many different kinds of memory management so I will describe one. ) Bank address is now "offset address" and is 24 bit. With in the 24 bits, the top 8 bits are the same as bank switching like before. So you can switch in 256 banks of memory. BUT the lower 16 bits are added to the address the CPU thinks it is using.

CPU address (16 bits) + (Offset address)=Real memory address.
If the offset memory is set to 0. (default) Then the CPU will have its address reflected into memory at:
0000,0000h to 0000,ffffh
If the offset memory is set to 0004,0000,0000h the cpu will work in the range of:
0004,0000 to 0004,ffffh
To solve the problem of having each bank=64k......
If the offset is 0000,0001,0000.
The CPU uses the real memory address 0000,00010000 to 0001,0000ffff.
This allows the CPU to use 64k starting at any location.
The first program could use memory 0 through ffff and the second program could use 1,000 through 1,0000,ffff.

This works well for data. If I am working on video and each picture takes up 30k of memory.
Picture 0 starts at memory 0
Picture 1 is at memory 0 plus (offset =30k)
Picture 2 is at memory 0 plus (offset = 60k)
Picture 3 is at memory 0 plus (offset = 90k) etc.

Note: program and data is limited to 64k chunks. A chunk can be any size less than 64k. Can be located anywhere in real memory.

There are some other ways of dealing with memory but.....hope this helps.
 
wow thank you very much Ron!

What do you mean by CUP?


I'm intensively reading about the memory spaces of the 8051.

I'm wondering, as C prorgammer, do you have the ability to know whether your declared variables / structures (i.e. data) will be stored in the fast-accessed memory or slow-accessed memory?

And whether storing a value into a data variable will be indirect / direct?
 
I'm wondering, as C prorgammer, do you have the ability to know whether your declared variables / structures (i.e. data) will be stored in the fast-accessed memory or slow-accessed memory?

And whether storing a value into a data variable will be indirect / direct?

C compiler can store variables anywhere it chooses to. You need to read the documentation of your C compiler to find out how it handles things. Here is documentation of avr-gcc compiler and how it uses memory. Most compilers are similar.
https://www.nongnu.org/avr-libc/user-manual/malloc.html

You can declare variable as a register variable.. but it is still up to the compiler to decide if it keeps the variable in a register or RAM or some other place. If you really want to know what is happening, then you need to code asm or read the asm code that your C compiler produces.
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top