rctime problems
FrankA_645
Posts: 7
Hello,
Im currently going through the whats a microcontroller book, and Im having some problems with the DialDisplay program in chapter 6. After setting the circuit just like the picture, and copying the code, the 7 segment display would not change as I turned the pot (all 5 segments stayed lit). I added a debug command after the rctime (debug ? time , crsrup) and I am getting totally random values usually around 10-14, but sometimes up to 60. These values change when i spin the pot, but in no particular order.
The strange part is when it says 60 it will still not turn off a segment (the first value in the lookdown table is 40). hrmm. any ideas?
thanks -Frank
Im currently going through the whats a microcontroller book, and Im having some problems with the DialDisplay program in chapter 6. After setting the circuit just like the picture, and copying the code, the 7 segment display would not change as I turned the pot (all 5 segments stayed lit). I added a debug command after the rctime (debug ? time , crsrup) and I am getting totally random values usually around 10-14, but sometimes up to 60. These values change when i spin the pot, but in no particular order.
The strange part is when it says 60 it will still not turn off a segment (the first value in the lookdown table is 40). hrmm. any ideas?
thanks -Frank
Comments
1) Go through what you've wired up and make absolutely sure that what you've wired is the same as in the book
2) Go through the program and make absolutely sure that it's exactly the same as what's in the book.
3) Post a picture of what you've got (physically) and post a copy of your program (as attachments to a reply).
4) Check the various connections. Sometimes a wire isn't connected properly.
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "lere we go; pot & lcd"·· , CR
time VAR Nib
index VAR Word
OUTH = %00000000
DIRH = %11111111
DO
· HIGH 5
· PAUSE 100
· RCTIME 5, 1, time
· DEBUG ? time , CRSRUP
· LOOKDOWN time, <= [noparse][[/noparse]40, 150, 275, 400, 550, 800], index
· LOOKUP index, [noparse][[/noparse] %11100101, %11100001, %01100001,
· %00100001, %00000001, %00000000 ], OUTH
LOOP
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen