from PIC18f4550 to serial in parallel out latch

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
nanawhite107
Posts: 1
Joined: Fri Jun 30, 2017 9:39 am
Contact:

from PIC18f4550 to serial in parallel out latch

Post by nanawhite107 »

I searched alot about how to send data from PIC18f4550 to 8-bit serial-in, serial or parallel 74HC595 latch.

Here is the datesheet of 74hc595


I need a code example to understand how the operation can be performed.

Any help is appreciated.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: from PIC18f4550 to serial in parallel out latch

Post by Benj »

Hello and welcome to the forums,
I need a code example to understand how the operation can be performed.
You need a code example but in which language?

Docara
Posts: 315
Joined: Sun Jun 23, 2013 1:29 pm
Has thanked: 28 times
Been thanked: 61 times
Contact:

Re: from PIC18f4550 to serial in parallel out latch

Post by Docara »

Hi,

You have 2 parallel ports available - why can't you use one of them to output directly?

Instead of asking for code why don't you consider the steps involved and try yourself - is this a homework question?

Anyway-

Your problem is going to be of timings. The PIC will be able to spit out data at whatever 'baud' rate you want. You then have to set up accurate pulses based on the baud rate to clock in the data in the correct place in the 595. Then you must consider what to do about controlling the PIC and 595 . Looking at the data sheet it says data is clocked in on a positive going edge so you have to have to have a pinon the PIC available which goes high when you output the data, then you have a latch control pin which needs to be controlled and the a chip enable. That's why I said use parallel directly.

So inside FC other than using SPI or the UART. You need to set up a loop which cycles through you data with an enclosed shift and output. The output would also send the 595 timing pulses to clock the data in to it. Before the loop cycles back you need to output a zero to the pin you are using to control the clock input on the 595.

Lastly, I would set the PIC output timing speed tyi be about a second so you can test your code with an LED say on the various pins before you connect up the 595

Read the data sheet of the 595 very carefully it will tell you what you need to produce on the pic to get the thing working

Matt

Post Reply