Witam.
Proszę Was o sprawdzenie poniższego kodu:
Problem polega na tym że na LCD pokazuje się error=3 , a w symulacji error=0.
Dalsze zwiększanie ramki to jakaś paranoja. Wyłuskałem ten kod z programu który ma kilkaset linii . Tam mam dopiero skutki przepełnienia stosu
.
Dodano po 10 [minuty]:
Dodam,że po podłączeniu do komputera po rs232 też pokazuje error=3
Dodano po 1 [godziny] 31 [minuty]:
Następny przykład po podłączeniu do PCta.
Wpisywałem różne wartości do hw,sw,fr. Podam Wam jakie wyniki dostałem w zmiennej error:
hw,sw,fr,-----error nr:
100,20,20----1 lub 3???--> różnie-zależy czy kompilator miał focha czy nie.
300,20,20----0 --> wydaje się logiczne gdy wcześniej miałem 1
99,20,20-----3 --> dla mnie dziwne
100,20,20----3
100,20,30----3
100,20,100---3
100,100,100--0
300,300,300--3 ---------> WTF??!!
Wg czego ustawiać te parametry??
Nie muszę dodawać że stack analyzer pokazuje bezsensowne propozycje?
Proszę Was o sprawdzenie poniższego kodu:
Problem polega na tym że na LCD pokazuje się error=3 , a w symulacji error=0.
Dalsze zwiększanie ramki to jakaś paranoja. Wyłuskałem ten kod z programu który ma kilkaset linii . Tam mam dopiero skutki przepełnienia stosu
$regfile = "m32def.dat" ' specify the used micro
$crystal = 8000000 ' used crystal frequency
$baud = 9600 ' use baud rate
$hwstack = 100 ' default use 32 for the hardware stack
$swstack = 500 ' default use 10 for the SW stack
$framesize = 1000 ' default use 40 for the frame space
$lib "glcdKS108.lib"
Config Graphlcd = 128 * 64sed , Dataport = Portc , Controlport = Porta , Ce = 2 , Ce2 = 3 , Cd = 4 , Rd = 5 , Reset = 1 , Enable = 6
Dim Licznik_przerwan As Byte
Dim Error As Byte
Config Timer2 = Timer , Prescale = 1024 ';every 0,128ms timer will increment 1 (till 255)
On Timer2 Odmierz_czas
Enable Interrupts
Enable Timer2
Cls
Setfont Font6x8
Do
Waitms 100
Lcdat 6 , 65 , "error: " ; Error
Print "error: " ; Error
Loop
End 'end program
'*************************************************************
$include "font6x8.font"
'*************************************************************
Odmierz_czas:
Stcheck
Load Timer2 , 124 ' after 125 increments of timer2( 16ms) interrupt will occur
Incr Licznik_przerwan
If Licznik_przerwan > 62 Then 'after 62*~16ms=1s "licznik_przerwan" will be reset
Licznik_przerwan = 0
End If
Return
Dodano po 10 [minuty]:
Dodam,że po podłączeniu do komputera po rs232 też pokazuje error=3
Dodano po 1 [godziny] 31 [minuty]:
Następny przykład po podłączeniu do PCta.
$regfile = "m32def.dat" ' specify the used micro
$crystal = 8000000 ' used crystal frequency
$baud = 9600 ' use baud rate
$hwstack = 100 ' default use 32 for the hardware stack
$swstack = 100 ' default use 10 for the SW stack
$framesize = 100 ' default use 40 for the frame space
Dim Error As Byte
Error = 0
Config Timer0 = Timer , Prescale = 1024 ';every 0,128ms timer will increment 1 (till 255)
On Timer0 Odmierz_czas
Enable Interrupts
Enable Timer0
Do
Wait 1
Print Error
Loop 'end program
Odmierz_czas:
Stcheck
Load Timer0 , 124 ' after 125 increments of timer2( 16ms) interrupt will occur
Return
Wpisywałem różne wartości do hw,sw,fr. Podam Wam jakie wyniki dostałem w zmiennej error:
hw,sw,fr,-----error nr:
100,20,20----1 lub 3???--> różnie-zależy czy kompilator miał focha czy nie.
300,20,20----0 --> wydaje się logiczne gdy wcześniej miałem 1
99,20,20-----3 --> dla mnie dziwne
100,20,20----3
100,20,30----3
100,20,100---3
100,100,100--0
300,300,300--3 ---------> WTF??!!
Wg czego ustawiać te parametry??
Nie muszę dodawać że stack analyzer pokazuje bezsensowne propozycje?
