The basics are this:
- pins 0 to 3 of a 14M chip are used to drive a CMOS 4511 BCD to 7 segment decoder
- pin 4 will pulse the CMOS 4017 counter
- the 4017 counter will switch the 7 segment catode via an ULN2003
The code is:
Notes:
- I've done it on breadboard as I needed quick a display away from computer and unfortunately I have no photos.
- It can be extended to 8 digits
- the code is not optimised at all.
- the schematics does _not_ show the current limiting resistors for 7 segment display
- pins 0 to 3 of a 14M chip are used to drive a CMOS 4511 BCD to 7 segment decoder
- pin 4 will pulse the CMOS 4017 counter
- the 4017 counter will switch the 7 segment catode via an ULN2003
The code is:
Code:
'Picaxe 14M
symbol no = b13 'this number will be displayed
symbol digit = b12
symbol countpin = 4
main:
no = 128
digit = no/100
on digit gosub no0, no1, no2, no3, no4, no5, no6, no7, no8, no9
gosub displayoff
digit = no // 100 / 10
on digit gosub no0, no1, no2, no3, no4, no5, no6, no7, no8, no9
gosub displayoff
digit= no // 100 // 10
on digit gosub no0, no1, no2, no3, no4, no5, no6, no7, no8, no9
gosub displayoff
pulsout countpin, 1
goto main
No0:
pins = %00000000
return
No1:
Pins = %00000001
return
No2:
pins = %00000010
return
No3:
Pins = %00000011
return
No4:
pins = %00000100
return
No5:
Pins = %00000101
return
No6:
Pins = %00000110
return
No7:
pins = %00000111
return
No8:
Pins = %00001000
return
No9:
pins = %00001001
return
DisplayOff:
pins = %00011111
return
Notes:
- I've done it on breadboard as I needed quick a display away from computer and unfortunately I have no photos.
- It can be extended to 8 digits
- the code is not optimised at all.
- the schematics does _not_ show the current limiting resistors for 7 segment display
Attachments
-
54.8 KB Views: 313
Last edited: