Hi everyone, I have a coin acceptor that gives out pulse. Coins used are P1, P5 and P10. When I drop P1 it gives 1 blink to my led status, P5 it gives 5 blinks and P10 gives 10 blinks. I want to display the corresponding blinks on the LCD. I tried the following code and connected the .
Code:
DEFINE LCD_DREG PORTBDEFINE LCD_DBIT 0
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 5
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 4
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50
Define OSC 20
ADCON1 = 7 'Need this to turn off ADC
TRISB = 000011 'Pins A are in input mode
PortB = 0
W1 var byte
Clear
pause 100
Lcdout $fe, 1 ' Clear screen
Lcdout "Blink Counter" ' Display "Test Counter"
Init:
COUNT PORTB.1, 60, W1
Lcdout $fe, 1 ' Clear screen
Lcdout "Digital Designs"
Lcdout $fe, $c0, "Read: " , #W1
pause 1000
GOTO Init 'Do it always
But it displays erratic values. Can anyone guide me on this?
Diagram

regards,
tacbanon
Bookmarks