PDA

View Full Version : Data Out From External Clock



Quin
- 24th October 2008, 19:19
To save me from re-inventing the wheel....

I need to clock out 17 bits (two words + one bit) serially on the falling edge of an external clock signal. The clock signal comes as bursts of seventeen pulses approx 10uS width every 5 mS or so. In between the clock line is high.

This means it's got to be pretty fast.

I intend to use Darrel Taylor's (excellent) interrupt routine to get to the handling routine but need something that's quick and lean to get the data out at that speed.

Project will probably use an 18F 40 pin PIC so 40MHz is available.

Any ideas ?

skimask
- 24th October 2008, 19:30
To save me from re-inventing the wheel....
I would think it can be done using a PIC and some crafty interrupts. 10us is enough for about 100 instruction cycles on a PIC18 running at 40Mhz.
I would think it would be done a easier using 3 8-bit PISO (parallel in, serial out) shift registers (2 using all 8 bits, the 3rd using only one bit). Load them up one at a time using PortD (or whatever) and let the hardware handle all of the clocking, but keep track of the idle time so you know when you can reload them.

Quin
- 25th October 2008, 09:11
Thanks for that.

External shift reisters is the way that mk1 is done. It's OK but I'm trying to get the chip count down to just the PIC if I can.