Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] Getting ERROR while trying PIC18F4550 USB library example.

Status
Not open for further replies.

chandresha1

Member level 2
Member level 2
Joined
Dec 4, 2010
Messages
43
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Location
Bremen, Germany
Visit site
Activity points
1,673
I want to make DAQ board using PIC18F4550 with USB communication. For beggining i am trying USB communication example given in MicroC library. I can built my program without any problem. But the moment i try to "start debugging" I got some application error.(Images attached) So Please someone try this code and tell me what is the exact problem.(Same code given in USB library).

Code:
unsigned char readbuff[64] absolute 0x500;   // Buffers should be in USB RAM, please consult datasheet
unsigned char writebuff[64] absolute 0x540;

char cnt;
char kk;

void interrupt(){
   USB_Interrupt_Proc();                   // USB servicing is done inside the interrupt
}

void main(void){
  ADCON1 |= 0x0F;                         // Configure all ports with analog function as digital
  CMCON  |= 7;                            // Disable comparators

  HID_Enable(&readbuff,&writebuff);       // Enable HID communication

  while(1){
    while(!HID_Read())
      ;

    for(cnt=0;cnt<64;cnt++)
      writebuff[cnt]=readbuff[cnt];

    while(!HID_Write(&writebuff,64))
      ;
  }
}
Bug_report.pngstart1.png
 

Reinstall Compiler and open properties of mikroC shortcut icon on desktop. Go to Compatibility tab and check "Run this program as an administrator" check box and OK button. Open mikroC using mikroC desktop icon.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top