opvini
Joined: 27 Apr 2012 Posts: 50 Location: Brazil
|
USB CDC with PROTEUS and PIC18F4550 problem |
Posted: Tue Feb 26, 2013 7:01 am |
|
|
Hi everyone.
I need to comunicate my PIC with my PC using USB CDC. My program works fine in real world, but I really need to simulate it on PROTEUS, but it doesnt work in simulation. All the samples of proteus works fine, but I think they were written with C18. I install the Virtual USB before the test, but the computer doesnt recognize the "SERIAL DEMO" hardware, and just "UNDEFINED DEVICE", and doesnt install the driver "%CCS%/Drivers".
My code is:
Code: |
#include <18F4550.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6,rcv=PIN_C7, ERRORS)
#include <usb_cdc.h>
void main(){
char c;
//usb_cdc_init();
//usb_init_cs();
printf("iniciou");
while(1){
usb_task(); // Testa comunicaƧao usb
if ( usb_attached() && usb_enumerated() && usb_cdc_connected())
{
c = usb_cdc_getc();
printf("%c",c);
}
}
}
|
Is the PROTEUS suports the USB SIMULATION with CCS compiler?
Thanks a lot. |
|