PDA

View Full Version : PortD mistery



vizualizer
- 29th March 2009, 22:13
Hi, I'm just going mad. Wish somebody could help.
I'm making a tracked rover using a PIC16F877/20 and the classical SN754410.
I've got the H-Bridge connected to portd 0-6, separate 12 volts power for the motors, capacitors and so on.
I double checked everything about 30 times but only one of the two motors runs in both directions, (pin 2-3), the one connected to pin 0-1 only goes one way.
After all day measuring, checking, using multimeter etc, I just moved the control on portc and everything works smoothly.
I can't really understand why.
By the way, I tried with another SN754410 (just in case...), another 877 (just in case), I swapped motors.
I mean, everything was OK.
Any idea of where is my mistake? (I'd like to sleep tonight)
Tx.

Darrel Taylor
- 30th March 2009, 00:57
About the only thing that can interfere with PORTD on an 877, is the Parallel Slave Port (PSP).

Occasionaly people will set TRISE = %11111111 thinking it sets PORTE to all INPUT. But it actually turns on PSP mode on PORTD, because Microchip used the extra bits in TRISE for something other than TRIS.
<br>

vizualizer
- 30th March 2009, 10:07
I actually set TRISE=00000000
It shouldn't be that.
Any other idea?

aratti
- 30th March 2009, 13:40
I actually set TRISE=00000000

Surely you meant TRISE=%00000000

Al.