[SOLVED] PIC32MX220F032B led blink problem - oscillator configuration?

Status
Not open for further replies.

K33rg4t3

Full Member level 3
Joined
Aug 2, 2015
Messages
165
Helped
7
Reputation
14
Reaction score
7
Trophy points
1,298
Activity points
2,607
Hey, I am trying to blink LED with PIC32MX220F032B.
Led is connected with resistor to pin RB5.
I am using microC pro for PIC32 IDE/compiler.
I am programming it with ICSP and the hex is written correctly.
This is my code:
Code:
#include <stdio.h>
#include <stdlib.h>

void main() {

 TRISB = 0;        // Set PORTB as output
 LATB = 0;

 while(1)
 {
       Delay_ms(1000);
       LATB = ~LATB;
 }
}
I have tried various config bits configurations, I have tried connecting oscillator (12MHz or so) but the LED is always on no matter what I do.
The PIC is not in reset state because I've added the 10k resistor to MCLR as always.
Can anyone help me? Any suggestions are welcome.
 
Last edited:

Do you know that PIC32 works from 3.3V and not 5V ? MCLR pulled to 3.3V using a 10k resistor ? Zip and post the complete mikroC PRO PIC32 project files. I will check if the project settings are right. What frequency crystal are you using ?

Try the attached project with a 12 MHz crystal. I have not used PLL. I think the problem was with JTAGEN_bit.
 

Attachments

  • LED Blinking.rar
    78 KB · Views: 54
Last edited:
Exacly, it is working now.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…