Hi,
I am sure someone will point out that the answer to my question is buried in the specs, but I've spent a considerable time reading them and still can't see the answer, so here goes...
I am controlling a stepper motor via pins RB0 thru RB3 (and a darlington array). All works just fine.
Now I want to incorporate a command interface using USART, so I can no longer use RB1 and RB2, hence I need to assign other pins to controlling the stepper. BTW, I also have RB4 thru RB6 assigned as inputs from various microswitches, so they're already in use.
So, I'm trying to use PORTA pins for controlling the stepper.
First I did a simple substitution, RA0 for RB0, RA1 for RB1 etc. This resulted in the motor stalling, or to be more precise, it just moved slightly one way, then back again. Changing (extending) the time between pulses didn't help the problem.
I then tried RA4 thru RA7 (again simple substitution for the RBx pins) and again this failed.
I realise PORTA pins have multiple functions, but I have set comparators off, and have not knowingly enabled any other PORTA function.
I've been hacking around at this for a couple of days now, and feel sure I must be missing something basic regarding how to use PORTA as digital output.
Any thoughts, suggestions, or better still answers most appreciated
I am sure someone will point out that the answer to my question is buried in the specs, but I've spent a considerable time reading them and still can't see the answer, so here goes...
I am controlling a stepper motor via pins RB0 thru RB3 (and a darlington array). All works just fine.
Now I want to incorporate a command interface using USART, so I can no longer use RB1 and RB2, hence I need to assign other pins to controlling the stepper. BTW, I also have RB4 thru RB6 assigned as inputs from various microswitches, so they're already in use.
So, I'm trying to use PORTA pins for controlling the stepper.
First I did a simple substitution, RA0 for RB0, RA1 for RB1 etc. This resulted in the motor stalling, or to be more precise, it just moved slightly one way, then back again. Changing (extending) the time between pulses didn't help the problem.
I then tried RA4 thru RA7 (again simple substitution for the RBx pins) and again this failed.
I realise PORTA pins have multiple functions, but I have set comparators off, and have not knowingly enabled any other PORTA function.
I've been hacking around at this for a couple of days now, and feel sure I must be missing something basic regarding how to use PORTA as digital output.
Any thoughts, suggestions, or better still answers most appreciated