Yesterday i loaded Hex file from mikroC PRO for PIC32 Examples Button example and it didn't worked. So today i decided see what is happening with a simple program.
This is the program:
Code: Select all
void main() {
TRISB = 0xFFFF; // Initialize PORTC as intput
TRISD = 0X0000; // Initialize PORTD as output
LATD= 0;
while(1)
{
LATB=0XFFFF;
if (PORTBbits.RB1==1)
{
LATB=0XFFFF;
Delay_ms(1000);
LATB=0;
Delay_ms(1000);
LATB=0XFFFF;
Delay_ms(1000);
LATB=0;
Delay_ms(1000);
}
}
}
PORTA : None
PORTB : RB1 , RB2
PORTC : RC12 , RC12 , RC14 , RC15 leds light but when i pressed the button they are not blinking.
PORTD : None
PORTE : None
PORTF : None (And the compiler don't let me PORTFbits.RF6 and PORTFbits.RF7 compile)
PORTG : None
When i tested ports with Logic Probe in MCU CARD pins it don't shows LO or HI but when i touch the port for example RB3 it works as it must it light and wait button press to blink.
Also i made all ports output and made all leds blinking and
RA0 always light lower than other
RA1,RA4,RA5 - RC12,13,14,15 - RF6,RF7 - RG2,RG3 didn't light. Leds are ok because with button light.
All jumbers are off and PORT leds jumbers only on. J15 is VCC,power supply usb. TFT and lcd examples are working.
I am using PIC32MX460F512L.
Best Regards
Kwnstantinos Papadopoulos