Page 1 of 1

PIC32MX795F512L Bootloader Problem

Posted: 26 Jan 2012 17:03
by DaliborSuhanji
Hello,

i have some code that worked very well for me, but when i upload this code with ME HID Bootloader i get an issue with PORTB.RB5 pin, which is always off. I even tried to turn on all 16 ports, and they all are working when the HEX is loaded without Bootloader. When MCU is programmed using Bootloader again RB5 is not working.

The code that worked for me is:

Code: Select all

//Ekvivalentna C sintaksa
/*
while(1==1)
{
   phaseAcumulator+=increment;
   PORTB=*(addressLT+(phaseAcumulator>>17));
   }

} */

    asm{
        LUI           R15,0xBF88
        LUI           R15, 0xA000

        LW            R19,0xC8(R15)    
        LW            R18,0x10(R15)    
        LUI           R16, 0xBF88


        //WDT SETUP
        LUI	R30, 49024
        LBU	R14, 0(R30)
        ORI	R14, R14, 1
        LUI	R30, 49024
     }
loop1:
      //     WDTCONbits.WDTCLR=1;

      asm{

        SB	      R14, 0(R30)      //WDTCLR
        LW            R20,0xC4(R15)    

        SRL           R3, R19, 17           
        SLL           R3,R3,1                
        ADDU          R2, R18, R3          
        LHU           R2, 0(R2)              
        SW            R2, 0x6050(R16)        
        ADDU          R19,R20,R19


    }
   goto loop1;
  }
Are there some limitations regarding to some IO pins, because i have initialized all TRISs to outputs and Analog pins as digital

Regards,
Dalibor



_______________________

:oops: :? :shock:
I have just figered out that i missed forum. This post should be in Mikroc for PIC32 General forum. I hope that moderators will move this topic to that forum.

Re: PIC32MX795F512L Bootloader Problem

Posted: 27 Jan 2012 15:23
by janko.kaljevic
Hello,

Please confirm to me which controller are you using.

For example PIC32MX460 has Vbuson on this pin and it is used by USB library. And PIC32MX360 does not have this function on RB5.

As soon as you enable USB HID this pin will be controlled by USB library.

Also I believe that you should use LAT registers for output:

Code: Select all

SW            R2, 0x6060(R16)
Address of LATB is 0xBF886060.

Best regards.

Re: PIC32MX795F512L Bootloader Problem

Posted: 27 Jan 2012 19:04
by DaliborSuhanji
Hello,

thank for your assistance.
I disabled Vbuson pin on RB5 in bootloader project and now everything is OK.
My device is PIC32MX795F512L


Dalibor,