mabd
Joined: 17 Jan 2005 Posts: 8
|
dsPIC33F I/O pin (CCS bug?) |
Posted: Thu Oct 21, 2010 4:00 am |
|
|
Hello everybody,
I'm working with dsPIC33FJ256MC710, the "explorer16 development board" and CCS compiler v4.110. I have a problem with G8 pin. When I try to set this pin as an input and I put a voltage (3.3v), the pin remains to 0v. And when I configure it as an output to 3.3v, it remains to 0v too. I have no load on this pin. There is no way to put it in high state (3.3v).
Microchip support sent me a program (MPLAB) and it works ok, but this same code with CCS doesn't work.
I've tried using "output_high(PIN_G8);" and it doesn't work either.
My dsPIC works ok and the rest of port G pins too. It seems like CCS compiler had a bug related to this pin.
My code (CCS) to configure as an output to 3.3v is: (doesn´t work)
Code: |
bit_clear(*0x02E5,0); // write '0' in bit 8 of register TRISG
bit_set(*0x02E7,0); // write '1' in bit 8 of register PORTG
bit_set(*0x02E9,0); // write '1' in bit 8 of register LATG
|
Microchip support code (MPLAB) to configure as an output to 3.3v is: (work)
Code: |
TRISGbits.TRISG8 = 0; // as output
PORTGbits.RG8 = 1;
LATGbits.LATG8 = 1;
|
Could anyone help me? Why can it be happening?
Thanks |
|