PIC32 PORT Question

General discussion on mikroC PRO for PIC32.
Post Reply
Author
Message
KwnstantinosPap
Posts: 5
Joined: 12 Mar 2011 17:58

PIC32 PORT Question

#1 Post by KwnstantinosPap » 13 Mar 2011 12:37

Hi. I don't know if my question about the problem i have concerns compiler or board so i decided to make me topic in this section.

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);
               }
   
          }
}
This actually work,PORTD leds light and when i press RB1 button leds blinking, but for PORTBbits.RB0 leds are blinking all the time.I made this for all ports and here is which pins from which ports are working as input

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

User avatar
tihomir.losic
mikroElektronika team
Posts: 2138
Joined: 02 Dec 2009 14:16
Location: Serbia
Contact:

Re: PIC32 PORT Question

#2 Post by tihomir.losic » 14 Mar 2011 16:39

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.
Hello,

I didn't reproduce your issue, and example for Button is ok.
In attachment is .hex file which I loaded.
Did you pull-up PORTD (SW6 up, and J6 on lower position) when you ran our example?

Best regards,

Losic Tihomir
Attachments
Button.rar
(836 Bytes) Downloaded 190 times
mikroElektronika [Support team]

KwnstantinosPap
Posts: 5
Joined: 12 Mar 2011 17:58

Re: PIC32 PORT Question

#3 Post by KwnstantinosPap » 14 Mar 2011 22:00

Thank you. My fault was the sw6 not j6. I didn't realize than for input sw6 must be up. Thank again for you time !

Post Reply

Return to “mikroC PRO for PIC32 General”