iqbalhabibie
Junior Member level 2
Hi, I'm newbie and just bought Microchip MMB for PIC32MX7 and using MPLAB Real Ice downloader and MPLAB C32 for compiler and IDE program micro C to get hex file to compile to MPLAB downloader. I was wondering how to initialize the port and the pins. Can you help me? and where could i find this tutorial and easy example for Microchip PIC32MX7. I have tried to compare from example micro C and make myself it doesn't work.
Example micro C for led blinking:
My program:
Is there some kind different configuration?, i have my program but it doesn't blink my LED and also the Led don't turn ON also turn OFF.
Example micro C for led blinking:
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 void main() { AD1PCFG = 0xFFFF; TRISB = 0; // Initialize PORTB as output TRISC = 0; // Initialize PORTC as output TRISD = 0; // Initialize PORTD as output TRISE = 0; // Initialize PORTE as output LATB = 0; // Set PORTB to zero LATC = 0; // Set PORTC to zero LATD = 0; // Set PORTD to zero LATE = 0; // Set PORTE to zero while(1) { LATB = ~LATB; // Invert PORTB value LATC = ~LATC; // Invert PORTC value LATD = ~LATD; // Invert PORTD value LATE = ~LATE; // Invert PORTE value Delay_ms(1000); } }
My program:
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 void main() { TRISB = 0 ; // set PORTB as OUTPUT for(;;) // forever { PORTB = 0xff ; // turn all LEDs ON Delay_ms(500) ; // wait 500 ms PORTB = 0 ; // turn all LEDs OFF Delay_ms(500) ; // wait 500 ms } }
Is there some kind different configuration?, i have my program but it doesn't blink my LED and also the Led don't turn ON also turn OFF.
Last edited by a moderator: