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 support@ccsinfo.com

USB errors

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



Joined: 25 Mar 2020
Posts: 1
Location: Banned - spammer

View user's profile Send private message

USB errors
PostPosted: Wed Mar 25, 2020 3:16 am     Reply with quote

Hello !

I try to use the USB with a dsPIC33EP256MU806 uC. I would like to use CDC communication, with the own library of CCS. I need to send 8192 bytes via USB to a PC where a script receives the bytes and checks them.
The sent example pattern is: 0x11000000..0x110007ff.
I checked the line with scope and I realized that some double words in the message are different than those I wanted to send, so they automatically change right at sending.
Eg.: The previous double word is: 0x11000304 so I expect that the next is: 0x11000305 but it is 0x11000300.
OR
The previous double word is: 0x110003CF so I expect that the next is: 0x110003D0 but it is 0x1100C1D0.

I tried the same code on a PIC18F2550 and the result was wonderful: there were no errors.

Do you have any idea what I should try? Could you help me?
Ttelmah



Joined: 11 Mar 2010
Posts: 15749

View user's profile Send private message

PostPosted: Wed Mar 25, 2020 4:20 am     Reply with quote

First thing. Post your clock settings. What crystal are you using?.
My settings for USB are:
Code:

#bit U1OTGSTAT_SESVD=getenv("BIT:SESVD")
#define USB_CABLE_IS_ATTACHED() (U1OTGSTAT_SESVD) //cable attached for DsPIC
#include <usb_cdc.h> //Usb


Your chip must have a crystal for USB operation.
So something like:

#USE DELAY(INTERNAL=120M, AUX: CRYSTAL=8M, CLOCK=48M)

To use a secondary crystal, with primary clock from the internal RC.
(using SOSC).
or.

#USE DELAY(CRYSTAL=8M, CLOCK=120M, AUX:CLOCK=48M)

To use a primary 8MHz crystal. In both cases assuming 120M operation.

Then how is your Vusb generated/connected?.
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