0
\$\begingroup\$

I am building a circuit in Proteus 7 Professional using an ATmega16 and 16x2 LCD display. I have code for the display. The code compiles with no error in the Arduino IDE, however in Proteus simulation the display not working. It gives me the following error messages:

PC=0x0106[AVR MEMORY]Writing to memory location 0x08FE outside memory size 0x0460 PC=0x0000[AVR CPU]RET address = 0x0000 which repeats itself in SIMULATION LOG

What is the problem?

\$\endgroup\$
1
  • \$\begingroup\$ please give me a tip on the part involving configuring the right device during compile and during simulation? \$\endgroup\$ Commented Mar 24, 2013 at 10:38

1 Answer 1

1
\$\begingroup\$

Apparently your program tries to write to SRAM in a location that the simulation is convinced that no RAM exists. Are you sure you have configured the right device during compile and during simulation? An ATmega16 has 1kB of RAM and 1kB equals 0x400 so writing to 0x08FE is well beyond its bounds.

If you check the datasheet at page 331 "Register Summary", you'll see registers defined up to 0x5F, which would explain the 0x60 offset in your error message memory size 0x0460.

Check the correct target device in the Arduino IDE (Tools →Board)?

\$\endgroup\$
5
  • \$\begingroup\$ unfortunately when I go to Arduino IDE (Tools →Board),I don't find one written Arduino Mega/Nano w/ ATmega 16.What should I do/which board should be my choice?thanks! \$\endgroup\$ Commented Mar 24, 2013 at 11:05
  • \$\begingroup\$ Are you sure you don't have a ATmega168? Those are more common on Arduino than ATmega16. \$\endgroup\$ Commented Mar 24, 2013 at 11:23
  • \$\begingroup\$ ATmega 168 is available let me try it out, because i thought it has to be specifically ATmega16 \$\endgroup\$ Commented Mar 24, 2013 at 11:59
  • \$\begingroup\$ Hi,I have used Atmega 168 and the earlier mentioned error has disappeared but I am not seeing any text being displayed on LM016L 16*2 LCD.It shows that it is powered -with green back light- on Proteus but these connected lines(RS,RW,D4,D5,D6,D7) show no activity.Only E is active.Why am I no receiving data on LCD ? \$\endgroup\$ Commented Mar 24, 2013 at 15:31
  • \$\begingroup\$ Sorry, can't help you there. I am unfamiliar with Proteus. This probably qualifies for a question on its own, just make sure to include the circuit diagram you built and the code. \$\endgroup\$ Commented Mar 24, 2013 at 15:57

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.