PAK-VII code, confusing use
Archiver
Posts: 46,084
Hello,
I got a PAK-VII recently and have been playing with it for a while
but just can't get it to work. With how it is setup now, it just
rapidly flips between 240 and 255 on my lcd. I'm trying to make a mph
display for my bike and here is the code which I have been testing
the chip with. I touch +5 to the channel 0 pin quickly to simulate
the hall effect as the wheel goes around. What's wrong?
'{$STAMP BS2p}
Baud CON 16624 '9600 Baud, 8-bit, no-parity, inverted
Clrlcd CON 12 'Clear LCD
Pocurs CON 16 'Position cursor
Esc CON 27 'Escape code
MPH VAR Word
PAUSE 1000
SHIFTOUT 3,2,1,[noparse][[/noparse]%11111111] 'Reset pak-vii
SEROUT 0,Baud,[noparse][[/noparse]Clrlcd,14]
Start:
SEROUT 0,Baud,[noparse][[/noparse]Esc,"F",67,Pocurs,66,32,32,32,32,32]
SEROUT 0,Baud,[noparse][[/noparse]Esc,"F",64,Pocurs,84,"RPM",Esc,"F",67,Pocurs,66,DEC
RPM]
SHIFTOUT 3,2,1,[noparse][[/noparse]%01100000] 'Breakdown.. 01=clear this register after
reading it. 100=No. of rising edges detected. 000=channel 0
SHIFTIN 3,2,0,[noparse][[/noparse]MPH] 'Put that data in MPH
GOTO Start
Thank you,
John
I got a PAK-VII recently and have been playing with it for a while
but just can't get it to work. With how it is setup now, it just
rapidly flips between 240 and 255 on my lcd. I'm trying to make a mph
display for my bike and here is the code which I have been testing
the chip with. I touch +5 to the channel 0 pin quickly to simulate
the hall effect as the wheel goes around. What's wrong?
'{$STAMP BS2p}
Baud CON 16624 '9600 Baud, 8-bit, no-parity, inverted
Clrlcd CON 12 'Clear LCD
Pocurs CON 16 'Position cursor
Esc CON 27 'Escape code
MPH VAR Word
PAUSE 1000
SHIFTOUT 3,2,1,[noparse][[/noparse]%11111111] 'Reset pak-vii
SEROUT 0,Baud,[noparse][[/noparse]Clrlcd,14]
Start:
SEROUT 0,Baud,[noparse][[/noparse]Esc,"F",67,Pocurs,66,32,32,32,32,32]
SEROUT 0,Baud,[noparse][[/noparse]Esc,"F",64,Pocurs,84,"RPM",Esc,"F",67,Pocurs,66,DEC
RPM]
SHIFTOUT 3,2,1,[noparse][[/noparse]%01100000] 'Breakdown.. 01=clear this register after
reading it. 100=No. of rising edges detected. 000=channel 0
SHIFTIN 3,2,0,[noparse][[/noparse]MPH] 'Put that data in MPH
GOTO Start
Thank you,
John
Comments
Do you mind contacting me off list and I will help you resolve any issues
you might be having.
Al Williams
AWC
>
Original Message
> From: cn00728 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=lrBQdatwmYyx3QFaOtpBaDh2F-uUPMLAOO-tIPKnC8XiKFNMrEmL4LU5Cu29_QxAHijh9P7RVo7i72cH]cn00728@y...[/url
> Sent: Wednesday, October 15, 2003 11:52 PM
> To: basicstamps@yahoogroups.com
> Subject: [noparse][[/noparse]basicstamps] PAK-VII code, confusing use
>
>
> Hello,
>
> I got a PAK-VII recently and have been playing with it for a while
> but just can't get it to work. With how it is setup now, it just
> rapidly flips between 240 and 255 on my lcd. I'm trying to make a mph
> display for my bike and here is the code which I have been testing
> the chip with. I touch +5 to the channel 0 pin quickly to simulate
> the hall effect as the wheel goes around. What's wrong?
>
> '{$STAMP BS2p}
> Baud CON 16624 '9600 Baud, 8-bit, no-parity, inverted
> Clrlcd CON 12 'Clear LCD
> Pocurs CON 16 'Position cursor
> Esc CON 27 'Escape code
>
> MPH VAR Word
>
> PAUSE 1000
> SHIFTOUT 3,2,1,[noparse][[/noparse]%11111111] 'Reset pak-vii
> SEROUT 0,Baud,[noparse][[/noparse]Clrlcd,14]
>
> Start:
> SEROUT 0,Baud,[noparse][[/noparse]Esc,"F",67,Pocurs,66,32,32,32,32,32]
> SEROUT 0,Baud,[noparse][[/noparse]Esc,"F",64,Pocurs,84,"RPM",Esc,"F",67,Pocurs,66,DEC
> RPM]
>
> SHIFTOUT 3,2,1,[noparse][[/noparse]%01100000] 'Breakdown.. 01=clear this register after
> reading it. 100=No. of rising edges detected. 000=channel 0
> SHIFTIN 3,2,0,[noparse][[/noparse]MPH] 'Put that data in MPH
>
> GOTO Start
>
> Thank you,
> John
>
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
> Subject and Body of the message will be ignored.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
>
> but just can't get it to work. With how it is setup now, it just
> rapidly flips between 240 and 255 on my lcd. I'm trying to make a mph
> display for my bike and here is the code which I have been testing
> the chip with. I touch +5 to the channel 0 pin quickly to simulate
> the hall effect as the wheel goes around. What's wrong?
<snip>
Even touching a wire to a pin will give you some amount of switch bounce...
Kev/.