CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

USB CDC with PROTEUS and PIC18F4550 problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
opvini



Joined: 27 Apr 2012
Posts: 50
Location: Brazil

View user's profile Send private message

USB CDC with PROTEUS and PIC18F4550 problem
PostPosted: Tue Feb 26, 2013 7:01 am     Reply with quote

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



Joined: 01 Jul 2010
Posts: 9225
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Feb 26, 2013 7:19 am     Reply with quote

this is too easy....

Since your program works fine in a real PIC then the problem you have is with PROTEUS.

You'll have to go to a 'PROTEUS' forum and ask them how to fix PROTEUS as you've proven it is NOT your program or CCS Compiler.

hth
jay
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group