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

Using USB of PIC18F2550

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
[email protected]



Joined: 20 Oct 2010
Posts: 1

View user's profile Send private message

Using USB of PIC18F2550
PostPosted: Wed Oct 20, 2010 1:46 am     Reply with quote

Hi all,

I have a problem on writing a code to send the data through USB to my computer. I plan to send 4 bits at one time. Do I need to convert the data?
Can I know the form of data to transmit through USB? Is string or integer or in character?
I am using C language in CCS software and PIC18F2550.
Anyone have the code or relevant info? Can send to me. Thanks.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Oct 20, 2010 1:31 pm     Reply with quote

The smallest unit is a byte. So, just put your 4 bits into the lower 4 bits
of a byte. Make the upper 4 bits be 0. Then send the byte.
Example:
0000xxxx

Your data is in the lower 4 bits of a byte , shown as "xxxx" above.
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