gr1ph0n
- 13th March 2011, 16:05
Hello!
I'm trying to make a VFD work with a pic12f629. VFD is taken from a car radio and it's driven by HT16511 from Holtek. I've made the program but before programming the pic, please can someone tell me if it's okay or not?
@ __config _XT_OSC & _WDT_OFF & _MCLRE_OFF & _CP_OFF & _PWRTE_OFF
DEFINE OSC 4
CMCON =7 ' Disable analog comparator
TRISIO =%00000000
GPIO=0
DEFINE SHIFT_PAUSEUS 100
DPIN VAR GPIO.0
CPIN var GPIO.1
STB VAR GPIO.2
command2 var byte : command2=%01000100
command3 var byte : command3 = %11000000
command1 var byte : command1 =%00001101
command4 var byte : command4 =%10001111 'display on, pulse width 14/16
segment var byte : segment=%11111111
main:
gosub led_display
goto main
Led_display:
low stb
shiftout dpin, cpin,4,[command1] ' set display mode
high stb
low stb
shiftout dpin, cpin,4,[command2] 'Data setting commands
high stb
low stb
shiftout dpin, cpin,4,[command3,segment] 'Address setting commands (segment should light up 8 segments)
high stb
low stb
shiftout dpin, cpin,4,[command4] 'Display control commands
high stb
pause 200
return
end
I have attached HT16511's datasheet. Thank you
I'm trying to make a VFD work with a pic12f629. VFD is taken from a car radio and it's driven by HT16511 from Holtek. I've made the program but before programming the pic, please can someone tell me if it's okay or not?
@ __config _XT_OSC & _WDT_OFF & _MCLRE_OFF & _CP_OFF & _PWRTE_OFF
DEFINE OSC 4
CMCON =7 ' Disable analog comparator
TRISIO =%00000000
GPIO=0
DEFINE SHIFT_PAUSEUS 100
DPIN VAR GPIO.0
CPIN var GPIO.1
STB VAR GPIO.2
command2 var byte : command2=%01000100
command3 var byte : command3 = %11000000
command1 var byte : command1 =%00001101
command4 var byte : command4 =%10001111 'display on, pulse width 14/16
segment var byte : segment=%11111111
main:
gosub led_display
goto main
Led_display:
low stb
shiftout dpin, cpin,4,[command1] ' set display mode
high stb
low stb
shiftout dpin, cpin,4,[command2] 'Data setting commands
high stb
low stb
shiftout dpin, cpin,4,[command3,segment] 'Address setting commands (segment should light up 8 segments)
high stb
low stb
shiftout dpin, cpin,4,[command4] 'Display control commands
high stb
pause 200
return
end
I have attached HT16511's datasheet. Thank you