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

BASCOM-AVR Old versions : timer overflow and wait statement confuse me!? : REPLY

$
0
0
thanks a lot laborratte i understand it. now i change my code as below and it work nice. other question! what is happen when hardware stack become overflow? processing stopped or reset occur? [code:1:62feec78da] $regfile = "m16def.dat" $crystal = 7372800 $hwstack = 60 $swstack = 60 $framesize = 60 $baud = 115200 '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Configurations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Config Lcd = 20 * 4 Config Lcdpin = Pin , Db4 = Portb.4 , Db5 = Portb.5 , Db6 = Portb.6 , Db7 = Portb.7 , E = Porta.7 , Rs = Porta.6 Config Timer1 = Timer , Prescale = 1024 Stop Timer1 Enable Timer1 On Ovf1 1second Enable Interrupts '~~~~~~~~~~~ Variable Dim A As Word Dim B As Word Dim C As Bit Declare Sub Wait1() '~~~~~~~~~~~ Initialization Cls Cursor Off Waitms 500 Home Lcd "Ready for use...!" Timer1 = 58335 Start Timer1 '~~~~~~~~~~~ Main program Do If C = 1 Then C = 0 Wait1 End If Loop End '****************** 1second: Stop Timer1 Incr A Locate 2 , 1 Lcd A Timer1 = 58335 Start Timer1 If A > 5 Then C = 1 Return '******************** Sub Wait1() Incr B Locate 3 , 1 Lcd "Wait1 occur " ; B ; " times" Wait 3 End Sub [/code:1:62feec78da]

Viewing all articles
Browse latest Browse all 20562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>