Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 26th May 2009, 11:29 AM   #1
Default Serial Data Out from 16f690 to 74HC164

Hiya,

Just a quicky,

Never done any 'serial work' before but I'm going to experiment with driving a 7 seg display via a 74HC164 serial to parallel (HC595 would be better but don't have any yet). Would it be best to use the 16f690s' SSP module (which looks quite complicated for a noob such as me) to send out the data or just use a regular output?



Thanks in advance for any help.
Angry Badger is offline  
Old 26th May 2009, 02:19 PM   #2
Default

The SSP module is really for the SPI and I2C forms of serial transmission.

Your really want to start with the Eusart module - while using a decoder chip to the seven segment is a good exercise , it would also be a good idea to do a tutorial like Nigels RS232 example, you just need a Max232 chip, 5 caps and a serial lead to you PC - you can then use Hyperterminal a see you data coming and going.

Be it SSP or Eusart that you use, the Datasheets info is terribly complex for anyone starting, so look around for simple good tutorials like Nigels - there are actually some good ones to be found on Microchips site - though as usual with them is a needle in a haystack job to find them.

eg http://ww1.microchip.com/downloads/en/devicedoc/spi.pdf
Wp100 is offline  
Old 26th May 2009, 02:31 PM   #3
Default

You could use the SSP module if you want to learn to use it at the same time, but if you've not done much coding before it's probably good practice to just bit bang the shift register using a couple of I/O lines and some code. It's not terribly difficult, just compare each bit of the byte you're sending in series set the data line and enable on the shift register on and strobe the clock pin. Just make sure you meet the timing requirements for the shift register.
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a
straight answer, har har."
Sceadwian is online now  
Old 26th May 2009, 02:51 PM   #4
Default

wow that bread board is over complex Why so many IC? Im sure you can do it all with 1 74HC164 and the Pic itself. Im sure with that kinda setup you can do 2 7 segs no problem.

Why use a decoder? You can do software decoding and then send it to the shift register. You can control the individual digits via transistors.

Ill make you a nice schematic so you can see how i would set it up.
AtomSoft is offline  
Old 26th May 2009, 02:59 PM   #5
Default

The 74HC164 is an 8bit shift register, two 7segments is 14 control lines if you're running them right off the shift register so you'd need 2, or you'd have to multiplex it. If the shift register isn't a latching register multiplexing the 7 segments with it is going to create lots of nasty flicker so much I don't think it'd be usable.
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a
straight answer, har har."

Last edited by Sceadwian; 26th May 2009 at 03:02 PM.
Sceadwian is online now  
Old 26th May 2009, 03:19 PM   #6
Default

ive never tried it but im sure a decent speed PIC and shift register wouldnt cause a bad flicker.
Attached Thumbnails
Serial Data Out from 16f690 to 74HC164-7seg.jpg  
AtomSoft is offline  
Old 26th May 2009, 03:22 PM   #7
Default

The 74HC164 can run at speed up to 175MHz so i doubt a flicker will occur. Thats way faster than a pic can set a pin anyway. You can write to it as fast as a pic can write.

I just noticed its not a latch type tho. But thats always something obtainable

The "74HC595" would do it for you.

Last edited by AtomSoft; 26th May 2009 at 03:27 PM.
AtomSoft is offline  
Old 26th May 2009, 03:38 PM   #8
Default

Hopefully Angry Badger followed all that =)
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a
straight answer, har har."
Sceadwian is online now  
Old 26th May 2009, 03:54 PM   #9
Default

Never noticed how cool the 74xx595 was. I might buy a few now
(xx = LS or HC etc...)
Here is a schematic using the 74xx595.

Warning i chose to pullup SCLR/SCL to save a data pin on pic. Doing this will not allow you to do a 1 time clear on the register. But you can still just shift in all 0's and do a software clear.

G is pulled down because all of the work you are doing will require it low anyway.

If you have Eagle i also included the schematic file so you can see it better.
Attached Thumbnails
Serial Data Out from 16f690 to 74HC164-5957seg.png  
Attached Files
File Type: zip 7seg.zip (15.4 KB, 28 views)

Last edited by AtomSoft; 26th May 2009 at 03:59 PM.
AtomSoft is offline  
Old 26th May 2009, 04:01 PM   #10
Default

I like the 7 segment led driver makes a good display and don't use a lot of pins.
be80be is offline  
Old 26th May 2009, 04:03 PM   #11
Default

Burt i love em too.

Since he is a beginner i feel like maybe he should do it in a way where he can get more experience and a better understanding of how micros work and coding.
AtomSoft is offline  
Old 26th May 2009, 04:39 PM   #12
Default

To drive two segments I'd waste lots of micro controller pins & do a standard multiplex routine & I'll leave SSP module to interface some other very useful device
__________________
Gayan

My Website
http://gsmicro.blogspot.com/

Last edited by Gayan Soyza; 26th May 2009 at 04:39 PM.
Gayan Soyza is offline  
Old 26th May 2009, 04:51 PM   #13
Default

Although learning to interface to the decoder is good coding practice as well, 6 of one half dozen of the other =) Either way it'll work. Since he's got the decoder setup arleady might as well use it.
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a
straight answer, har har."
Sceadwian is online now  
Old 26th May 2009, 08:12 PM   #14
Default

Hi

Thanks for your replies, much appreciated.

The 'board' isn't really that complicated - only three chips including the pic (one chip unused). The 164 doesn't have a latch facillity as you correctly noted so I'm using a 74HC373. I'm only driving one digit to start with to see how I get on. It's almost working - display changes every time I press the button but it's garbled, think I messed up the connections or something. NP.

On my previous two projects I've driven the displays with parallel data, ccts / pics attached.

Thanks.
Attached Thumbnails
Serial Data Out from 16f690 to 74HC164-finished-clock-026-r2.jpg   Serial Data Out from 16f690 to 74HC164-clock-schematic.jpg   Serial Data Out from 16f690 to 74HC164-keypad_finished-003r2.jpg   Serial Data Out from 16f690 to 74HC164-keypad-schematic.jpg  
Angry Badger is offline  
Old 26th May 2009, 08:25 PM   #15
Default

Nice looking stuff dude. You cant be that much of a noob to do that. Good job.

Can you post some code ? so we can help futher. Also a schematic of what you are on now.

nice use of a 74HC373.

Last edited by AtomSoft; 26th May 2009 at 08:32 PM.
AtomSoft is offline  
Reply

Tags
74hc164, data, serial

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
Sending serial data zenhuynh Electronic Projects Design/Ideas/Reviews 1 24th April 2009 02:38 PM
Difference b/n 74HC164 and 74HC4094? picstudent General Electronics Chat 4 25th February 2009 03:50 AM
74HC164 Shift Register Doubt Gayan Soyza Micro Controllers 15 18th February 2009 03:54 AM
help on serial data transmission srimannarayanakarthik Electronic Projects Design/Ideas/Reviews 3 3rd January 2007 03:01 PM
VB serial data Kane2oo2 Micro Controllers 8 10th November 2003 11:15 PM



All times are GMT. The time now is 06:07 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker