Hello everyone,
I’m facing quite a headache. As you can see in the schematic below, my design includes a PIC24FJ64GA104 controlling the input/output pins. Everything seemed fine until I discovered that there is no signal coming out from pins RA4, RB4, and RA3.
I have reviewed the configuration of these pins in detail, but no matter how I test the code, I still cannot activate them. I’m quite sure the issue is not from the hardware side, since other output pins are configured exactly the same way as RA4 and they work normally, generating output signals.
So I’d like to ask for help from the experts here — could you please give me some guidance?
Here's the code i used for testing:
I’m facing quite a headache. As you can see in the schematic below, my design includes a PIC24FJ64GA104 controlling the input/output pins. Everything seemed fine until I discovered that there is no signal coming out from pins RA4, RB4, and RA3.
I have reviewed the configuration of these pins in detail, but no matter how I test the code, I still cannot activate them. I’m quite sure the issue is not from the hardware side, since other output pins are configured exactly the same way as RA4 and they work normally, generating output signals.
So I’d like to ask for help from the experts here — could you please give me some guidance?
Here's the code i used for testing:
C-like:
void init_config(void) {
/* Disable Watchdog */
RCONbits.SWDTEN = 0;
/* Disable Secondary Oscillator RA3, RA4, RB4 */
OSCCONbits.SOSCEN = 0;
/* analog to digital */
AD1CON1bits.ADON = 0; // disable ADC
AD1PCFG = 0xFFFF; // ANx = digital
/* Config I/O */
_TRISA3 = 1; // RA3 = INPUT_4
_TRISA4 = 0; // RA4 = OUTPUT_13
_TRISB4 = 0; // RB4 = OUTPUT_1
/* Clear output*/
LATA = 0;
LATB = 0;
/* Open-drain off */
ODCA = 0;
ODCB = 0;
}
int main(void) {
init_config();
while(1) {
//DEFAULT OUTPUT
LATBbits.LATB4 = 1; //OUTPUT1 12V SUPLY FAN0 ON
LATAbits.LATA4 = 1; //OUTPUT13 12V SUPPLY SPLITTERS
wait_3s();
LATBbits.LATB4 = 0; //OUTPUT1 12V SUPLY FAN0 ON
LATAbits.LATA4 = 0; //OUTPUT13 12V SUPPLY SPLITTERS
wait_3s();
}
return 0;
}
Attachments
-
135.2 KB Views: 9
Last edited by a moderator:
