Search
Enter Keywords:
Thursday, 09 September 2010
Home arrow Projects arrow Microchip Pic and dsPIC Programming arrow One Wire 7-Segment driver
Newsflash

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 Print E-mail
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.

Image
You need to a flashplayer enabled browser to view this YouTube video

Image
Image
Image
Image

 

 

 

 

 

 

 

 

And here we have the code in MIKROBasic :

 

 

 

 

 

 

 
 
program serial7Segment
 
dim i,k as byte
dim segment as byte
 
sub procedure segment_out(dim seg as byte)
 
for i = 0 to 7
if seg.7 = 1  then
           PORTF.2 = 1
           delay_us(55)
           PORTF.2 = 0
           delay_us(4)
           PORTF.2 = 1
      else
          PORTF.2 = 1
          delay_us(55)
          PORTF.2 = 0
          delay_us(35)
          PORTF.2 = 1
end if
seg=seg << 1
next i
end sub
 
sub procedure segment_clr()
for i = 0 to 23
PORTF.2 = 1
delay_us(55)
PORTF.2 = 0
delay_us(4)
PORTF.2 = 1
next i
end sub
 
main:
 
PORTF=0           ' All PORTF cleared
TRISF=0           ' All PORTF set as OUTPUT
 
while true        ' the endless Loop
 
delay_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 Loop
 
end.
 
 
Last Updated ( Monday, 14 July 2008 )
 
< Prev   Next >

Main Menu
Home
Forum
Joomla! License
News
Blog
Links
Contact Us
Search
News Feeds
FAQs
Wrapper
Downloads
Shop
Projects
Games
OS Tips & Tricks
Sponsored Links
Joomla! Home
Joomla! Forums
OSM Home
Administrator
© 2010 The Csaba DIY and Electronic Site
Joomla! is Free Software released under the GNU/GPL License.