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

doubt about output_B

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



Joined: 07 Jan 2006
Posts: 64
Location: Braga

View user's profile Send private message Send e-mail MSN Messenger

doubt about output_B
PostPosted: Mon Dec 03, 2007 6:28 am     Reply with quote

I'm trying to output a decimal value on port B with this seconds counter

output_b(sec);

but it output a hexadecimal value , ex:

after x09 then comes x10, then x11, then x12 that represents an A,B,C etc.
after a x09 i would need a x16, i think to result on a number 10 (decimal)
I need a decimal value on each group of 4 bits (RB0,B1,B2,B3) Units and more 4 bits (RB4,B5,B6,B7) 10tns.

Any help please, thank you all
crystal_lattice



Joined: 13 Jun 2006
Posts: 164

View user's profile Send private message

output nibble
PostPosted: Mon Dec 03, 2007 6:46 am     Reply with quote

Search forum for a BCD2BIN and BIN2BCD function. Pass the variable that you want to output to port b through it eg. port_b(bin2bcd(x)). That should work!
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