Arduino platforms (week 2/3) Flashcards
ATMega controllers-What is their memory organisations?
AVR architecture has two main memories:
CODE AND DATA MEMORY (HARVARD ARCHITECTURE)
ATMega controllers-What is the CODE memory?
The code memory (Flash memory) structure: 256k byte of memory. 128k locations. 16-bit stored in each location.
ATMega controllers-What is the DATA memory?
Data memory (RAM memory) has a structure with:
- 32 locations to store register file
-64 locations for standard I/O memory
-416 locations for extended I/O memory
-8192 locations for internal RAM
Memory organisation in ATMega controllers. How the code is executed?
We set the right bits in the right registers
What would look like a user Arduino code at low level ? what are the PIN REGISTERS ?
DDRx -> set corresponding pin, input=0, output=1
PORTx -> read/write value of the voltage on corresponding pin. (low /high)
PINx -> holds current state of input pin.Get current logical level
Why is there no need in reading an input pin?
Because it is directly copied in corresponding PORTx register.
How to write a digital output with registers ?
Set/clear the corresponding bit in the PORTx register.
State of corresponding physical pin will change accordingly.
What is the timing of a program?
The AVR CPU is driven by CPU clock, generated from selected clock for the chip.
What is the difference between coding in low-level and high-level languages?
In high-level code, it is hard to predict running time.
In low-level, every line corresponds to one instruction, highly accurate control of time.