Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20562

BASCOM-AVR : Brownout reset : REPLY

$
0
0
More Results: All boards now have a schottky diode from +5 regulator terminal directly to the Vcc and AVcc pins, with a 100uf and a 0.1 at the processor end. The 0v pin on the processor is connected to the center leg of the regulator with a 15mm length of wire. Nothing else is connected to the processor ground. Other grounds go separately back to the regulator ( which incidently has 4700uF to ground). The regulator runs cold. I'll see if I can download a circuit in a few minutes. 3 boards have run for 36 hrs without reseting. Board 4 has reset 3 times ( see below). MCUSR = 2 is a result of the download 7227 seconds previously ; MCUSR = 4 suggests there was a brownout, but I am puzzled by the doubleup on "there has been a restart" message. That would suggest that there were 2 brownouts in quick succession? Here is a sample of the hyperterminal at the relevant spot: [quote:7f3e57fb47] reset count=1 Previous MCUSR=2 Cycle: 7220 reset count=1 Previous MCUSR=2 Cycle: 7221 reset count=1 Previous MCUSR=2 Cycle: 7222 reset count=1 Previous MCUSR=2 Cycle: 7223 reset count=1 Previous MCUSR=2 Cycle: 7224 reset count=1 Previous MCUSR=2 Cycle: 7225 reset count=1 Previous MCUSR=2 Cycle: 7226 reset count=1 Previous MCUSR=2 Cycle: 7227 There has been a restart There has been a restart reset count=3 Previous MCUSR=4 Cycle: 1 reset count=3 Previous MCUSR=4 Cycle: 2 reset count=3 Previous MCUSR=4 Cycle: 3 reset count=3 Previous MCUSR=4 Cycle: 4 reset count=3 Previous MCUSR=4 Cycle: 5 reset count=3 Previous MCUSR=4 Cycle: 6 reset count=3 Previous MCUSR=4 Cycle: 7 reset count=3 Previous MCUSR=4 Cycle: 8 reset count=3 Previous MCUSR=4 Cycle: 9 reset count=3 Previous MCUSR=4 Cycle: 10 reset count=3 Previous MCUSR=4 Cycle: 11 reset count=3 Previous MCUSR=4 Cycle: 12 reset count=3 Previous MCUSR=4 Cycle: 13 reset count=3 Previous MCUSR=4 Cycle: 14[/quote:7f3e57fb47] Incidently = some hours ago I added a few lines to my test program to count the number of iterations of the do loop as follows: [code:1:7f3e57fb47] -- '******************************************************************************* $regfile = "m1284pdef.dat" $crystal = 9830400 $framesize = 100 $hwstack = 100 $swstack = 100 Disable Jtag ' '------------------------------------------------------------------------------- 'Open a software UART channel for debug dB9 Open "comc.3:9600,8,n,1" For Output As #1 '******************************************************************************* config PORTa.3 = output 'led config watchdog = 8192 start watchdog dim resetcount as eram byte dim tempb as byte dim rbyte as byte dim cycle as integer cycle = 0 rbyte = peek(0) '------------------------------------------------- 'incr reset count every time processor reboots print #1 , "There has been a restart" tempb = resetcount 'read from eeprom incr tempb resetcount = tempb 'save to eeprom wait 5 'protect eeprom '------------------------------------------------ do incr cycle tempb = resetcount 'read from eeprom print #1 , "reset count=" ; tempb ; print #1 , "Previous MCUSR=" ; rbyte ; print #1, "cycle:"; cycle mcusr = 0 toggle portA.3 reset watchdog wait 1 loop [/code:1:7f3e57fb47]

Viewing all articles
Browse latest Browse all 20562

Trending Articles