chandresha1
Member level 2
- Joined
- Dec 4, 2010
- Messages
- 43
- Helped
- 3
- Reputation
- 6
- Reaction score
- 3
- Trophy points
- 1,288
- Location
- Bremen, Germany
- 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))
;
}
}