Q & AVR MCU Series

problems arising in the course should first try to remove source code stored in a folder called avd file protection exhibition
Q: If AT90S2313 AVR microcontroller series, all less than 256 bytes of data memory and it can not access the external memory can ignore the XY and Z pointer high byte and only use the pointer to access the low byte of memory can be used?
A data memory registers in all I / O registers and SRAM less than 256 bytes when using the AVR microcontroller
LD / ST instruction when the CPU to access data memory pointer high byte will be ignored this time to allow the high byte of each pointer (R27, R29 and R31) for general purpose storage and pre-cut instructions from the increase (such as LD-Z Rd) does not affect the high byte of attention when using the Z pointer to access FLASH program memory and use ADIW / SBIW instruction will affect the use of the Z pointer high byte
Asked the IAR C compiler how to access the AVR internal EEPROM data memory
A is the AVR AVR internal EEPROM microcontroller I / O memory part of the I / O interface, the form of access can not be accessed using ordinary variables in the standard library routines IAR “ina90.h” macro defined in a special read Write EEPROM
EEPROM read and write the macro has the following prototype
_EEGET (VAR ADR) / * read from EERPOM address ADR values * /
_EEPUT (ADR VAL) / * write the address of VAL to EERPOM ADR *
IAR C compiler does not support the definition of the constants can not be generated in the EEPROM to the EEPROM data file initialization
Assembler with the AVR to do this is very easy to write the first definition of the constants in the code EEPROM
. ESEG
. Org 0x50
datatable:. db $ 01, $ 02, $ 03, $ 04, $ 05
dtableend:. db $ 00
When this code is compiled it produces a. EEP file This file can be downloaded to the microcontroller or MCU in the emulator. Org statement gives the address of the data Interpretation of this variable in the C series devices can be used _EEGET () and _EEPUT () to access
Q: I can not make MCU in power-down mode current consumption drops to the value of the data book how should I do?
A power-down mode is entered when the AVR I / O pins of the state should not change if you have some pins not connected to a three-state input and does not pull the level of these pins are floating and it may cause oscillation resulting in additional current consumption to address this issue should activate all unconnected input pin pull-up resistor that makes these pins have a clear logic level on the pin oscillation problem arising in the case of Open non-activity patterns of hibernation on unused pins is a good way to pull
Second, you then look at the wiring connected to the output pin load on any output pin will be extra consumption in power-down mode current
Q: I observed that my existing microcontrollers during power I / O port is active in my application there is a problem in the system once set I / O pin in the MCU can be a high Turn off the power and that the use of a resistor to the pin during power down in it sometimes still occurs when the power is turned on so high the system immediately shut down the system user appears to not work I guess if I replace the AVR there will be some of the same problem?
A synchronous reset most microcontrollers such as RESET is not yet fully complete MCU requires a certain number of valid clock during power up when the VCC to the start before the crystal oscillator power-on reset value is valid but does not affect I / O pin number and I / O pin is in a random state of AVR’s I / O port with reset is asynchronous and ensure that the power is in the process of AVR microcontroller into three states will be able to solve your problem
Q: how to deal with NC-pin AVR microcontroller empty pin?
Do not answer any circuit connected to the NC pin is NC pin reserved for future required
Q: AVR assembler how to define string constants in the
A string can be defined as constants in the FLASH memory or EEPROM data memory
For example, in a string constant defined in FLASH
. CSEG
fstring. db “This is a string in flash” 0x00
Specified in the EEPROM string constants:
. ESEG
eestring. db “This is a string in EEPROM” 0x00
Q: I am writing a large assembler program when I go to add a new line of characters in the file seems to disappear at the end how can I prevent this?
A: The assembler editor has 30K bytes of the file size limit if you want to overcome this limitation must be divided into several modules file and use “. Include” link there is a way to use other editors such as NotePad UltraEdit procedures, and command line mode work assembler (DOS version)
Q: AT90S8515 has 8KB of program memory as RJMP and RCALL instruction only in the context of 2K relative jump instruction set and this part of the JMP


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top