PDA

View Full Version : Needing help with speeding up paralel port



Kristjan
- 7th November 2007, 12:31
Hi!

I'm using PIC16F88 eight digital outputs to drive DAC. Digital output change takes a lot of time as I have to change each of them. Is there any faster solution to change digital outputs in paralel?

Simplified code:

adval var byte 'input value
b0 var adval.0 'first bit of input value
b1 var adval.1 'second bit of input value
b2 var adval.2 'third bit of input value
b3 var adval.3 'etc.
b4 var adval.4
b5 var adval.5
b6 var adval.6
b7 var adval.7

.... ' adval gets its value in a loop sequence.

PORTB.1 = b0 ' PIC digital outputs gets its value
PORTB.6 = b1
PORTB.7 = b2
PORTA.2 = b3
PORTA.3 = b4
PORTA.4 = b5
PORTB.0 = b6
PORTB.3 = b7

With 4MHz oscillation the digital outputs set up time for 8 bits takes 32us.

Kristjan
- 7th November 2007, 12:35
It went now to wrong thread. :( I'm using PICBASIC PRO. Maybe it can be moved under other topic.

HenrikOlsson
- 7th November 2007, 13:47
You can "put" a whole byte on a port by doing:

PortB = ADVAL
So the only thing I can think of is to change your hardware so that it "lines up" bit for bit.

Or change your oscillator to 20Mhz.

/Henrik Olsson.