Ben_Dinsdale
Joined: 05 Dec 2011 Posts: 1 Location: East Yorkshire, UK
|
dsPIC30F some outputs not switching |
Posted: Mon Dec 05, 2011 9:59 am |
|
|
Hello,
I'm currently debugging a prototype siren based around the dsPIC30F5011. I'm using CCS C v4.057, MPLAB v8.63, and ICD3 as the debugger.
I'm having trouble getting RD2 and RD3 to switch on.
These pins can also be compare pins which I have turned off.
Code: |
SETUP_COMPARE(3, COMPARE_OFF);
SETUP_COMPARE(4, COMPARE_OFF);
|
and configured as outputs
Code: |
SET_TRIS_D(0b0000011100100001);
|
I'm currently at the very simple do the inputs and outputs work stage.
Code: |
while(TRUE) // never ending loop
{ // start of never ending while loop
delay_ms(20);
get_inputs(); // read in positive and negative inputs
if (input1)output_high(PIN_D3);
else output_low(PIN_D3);
}
|
This is code is working on pins D1, D4-D8, but not on D2 and D3 as I can see PORTD and LATD being switched in the watch window.
However in the case of D2 and D3 I only see LATD being switched whilst PORTD remains 0.
Any help or suggestions would be greatly appreciated.
Thanks
Ben |
|