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

how to get 0-360 degree binary information from pc

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



Joined: 09 Sep 2005
Posts: 36

View user's profile Send private message

how to get 0-360 degree binary information from pc
PostPosted: Sat Jan 21, 2006 3:37 am     Reply with quote

i want to get 0-360 degree information from pc via serial port. but i dont know how to get the bytes into pic. this will not be an interrupt but polling. should i send ascii for example 268 degree as ascii2,ascii6,ascii8? or a different way (ie.using 9bits maybe) . using software control how is this accomplished? this will control a dc geared motor with encoder..
and the visual basic program?? how can i write it?


* datasheet tells built in usart can buffer up to 3 bytes..(16f877)
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

Re: how to get 0-360 degree binary information from pc
PostPosted: Sat Jan 21, 2006 3:44 pm     Reply with quote

asunca wrote:
this will not be an interrupt...


Why not? Smile
asunca



Joined: 09 Sep 2005
Posts: 36

View user's profile Send private message

PostPosted: Sun Jan 22, 2006 3:41 am     Reply with quote

i dont think interrupt is necessary. i have a 8channel servo controller downloaded from web. i would like to benefit from it in my project because i dont know visual basic. i know how it works (one byte command, one byte data). i need the second byte only. but it is one byte and 0-255 degree can be represented. i want 0-360 and i dont know to get the byte using getc().
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Sun Jan 22, 2006 4:15 pm     Reply with quote

asunca wrote:
i would like to benefit from it in my project because i dont know visual basic.
i want 0-360 and i dont know to get the byte using getc().


Sounds like there are three separate problems. Unfortunately, I don't know what software are you planning to use; if you post a link, I'll take a look at it. But your software might be sending you 0-360deg as one byte. That way 1 deg corresponds to 0.7083 in the data byte.
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