PLease check out my DIY CNC mill & drill pictures and PROXXON MF-70 conversion on my music site. I will be transfering information very soon.
One Wire 7-Segment driver
Written by Administrator
Monday, 09 June 2008
Here is another cool project and MCU pin saver . The One Wire 7-Segment driver. It uses three shift registers to enter which pin of the 7-segments are supposed to be high or low. I have used three common anode 7-segment displays (standard) in this project with the three 74HC278 Octal D-Type flip flop with reset. But you are welcome to use similar logics.
Now the interesting part is with the 74HC14 Hex inverting Smitt trigger. The circuit works something like this :
If input on DSC is low another clock cycle has begun.
If the period on DSC is longer than 10uS actually minum of 30uS then the capacitor 1nF is fully charged and trigger the second Hex Inverter to signal a logic "0". But if it's shorter than 10uS this will never happen since it's in the loading capacitor process so therefore the logic stays high "1".
Timing is important in this schematic but programming is simple. Interrupts should be disabled during logic 1 to reach the 10uS. The original design come from here .
I have tried it on a dsPIC and it works great. I might do a 4 or even 6 digit diplay for a clock or something very soon.
program serial7Segment
dim i,k asbytedim segment asbytesub procedure segment_out(dim seg asbyte)for i = 0 to 7if seg.7 = 1then
PORTF.2 = 1delay_us(55)
PORTF.2 = 0delay_us(4)
PORTF.2 = 1else
PORTF.2 = 1delay_us(55)
PORTF.2 = 0delay_us(35)
PORTF.2 = 1endif
seg=seg << 1next i
end subsub procedure segment_clr()for i = 0 to 23
PORTF.2 = 1delay_us(55)
PORTF.2 = 0delay_us(4)
PORTF.2 = 1next i
end submain:PORTF=0' All PORTF clearedTRISF=0' All PORTF set as OUTPUTwhiletrue' the endless Loopdelay_ms(2000)'Wait two seconds
segment_clr()'Clear all 24 bits in the shift register
segment_out($C0)'Hand over the value $C0 for the digit "0"
segment_out($F9)'Hand over the value $F9 for the digit "1"
segment_out($B0)'Hand over the value $B0 for the digit "3"delay_ms(2000)'Wait two seconds
segment_clr()'Clear all 24 bits in the shift register
segment_out($F9)'Hand over the value $F9 for the digit "1"
segment_out($B0)'Hand over the value $B0 for the digit "3"
segment_out($C0)'Hand over the value $C0 for the digit "0"wend'Return to the enless Loopend.