I'm playing with assembly using the ATMega328 controller in the PDIP package.
The project board is the Arduino Duemilanove running at 18.432 MHz. I changed the crystal from 16.000 MHz to obtain the "Magic " frequencies for good USART operation.
Serial communications is via FTDI USB connection
AVR Studio 4.18.700 GUI Version 4, 18, 0, 685 Build 2600 Service Pack 3 Plugins: AvrPluginAvrAsmObject 1, 0, 0, 48 AvrPluginavrgccplugin 1, 0, 0, 11 Stk500Dll 1, 0, 1, 15
I'm also using an ATAVRISP MKII USB ISP programmer connected to a standard on-board ISP headder.
In addition, I'm using HyperTerminal as a used display for observation of experiments. The Communications speed is 115.2K BAUD.
Basically, I'm putting text
The issue is this...
When I assemble, the results are error free. When I download the code runs just fine.
Now the problem is that, as long as I don't remove power, the code runs as expected. But if I power down the project board, some aspects of the code won't run correctly.
Another issue that I have observed is that when I start HyperTerminal, it sends some character to the project board. When the project board receives the character (more like packet, I guess) the project board goes into RESET and from then on, data is trashed. The USART code DOES NOT use any interrupts so I can't get a grasp of why the controller is entering reset.
The fact that the controllers is resetting has been proven by two methods.
The first indication that the controller is being RESET is that when I close out a HyperTerminal session and then restart another session (without leaving HyperTerminal) the terminal screen clears and the text gets reinitialized.
The indication is that I've put the status of the MCUSR register in the terminal screen and every time I reinitialize a communications session, the MCUSR comes up with 0x02, which is the external RESET flag.
So the issues are:
RESET caused by reception of spurious USART character.
Code characteristics change after repowering the controller.
It seems to me that I have heard about a scenario like this several years ago, but a forum search doesn't seem to reveal anything with symptoms like this.
Does anyone have any clues or, has anyone heard of such a thing?