Libstock
It is currently 23 Jul 2014 07:11

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 26 Jan 2012 17:03 
Offline

Joined: 11 Jun 2007 19:13
Posts: 30
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:

//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.

_________________
Best regards,
_____________
Dalibor Suhanji
SUHANjIElektro.net Site Founder & Administrator, R&D Specialist
Bachelor for Electronics and Telecommunication

http://www.suhanjielektro.net


Top
 Profile  
 
PostPosted: 27 Jan 2012 15:23 
Offline
User avatar

Joined: 16 Jun 2011 13:48
Posts: 3565
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:
SW            R2, 0x6060(R16)

Address of LATB is 0xBF886060.

Best regards.


Top
 Profile  
 
PostPosted: 27 Jan 2012 19:04 
Offline

Joined: 11 Jun 2007 19:13
Posts: 30
Hello,

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


Dalibor,

_________________
Best regards,
_____________
Dalibor Suhanji
SUHANjIElektro.net Site Founder & Administrator, R&D Specialist
Bachelor for Electronics and Telecommunication

http://www.suhanjielektro.net


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group