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

RTC-4543SA
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Ttelmah
Guest







PostPosted: Fri May 15, 2009 9:30 am     Reply with quote

37 decimal, becomes 0x37, when converted to BCD.
So, 0x25 -> 0x37.
Basically, the decimal 'tens', become the top nibble in the BCD number.
If you print a BCD number as Hex, you should see the original decimal number.
So, '16' in decimal, becomes 0x16. 22 in decimal.

Best Wishes
Tagge



Joined: 23 Aug 2005
Posts: 93

View user's profile Send private message Visit poster's website

PostPosted: Sat May 16, 2009 1:26 am     Reply with quote

Thanks Ttelmah, you are right.
One more question, in the CCS manual the function shift_right() is described as:
Function:
Shifts a bit into an array or structure. The address may be an array identifier or an address to a structure (such as &data). Bit 0 of the lowest byte in RAM is treated as the LSB.

It shouldn't mean that one can't shift bits into an single byte? It's no difference to a byte as a member in a struct?
For ex, data is only one byte. And there is no need for the data to be global?
shift_right(&data,1,input(RTC_IO));
It says: from PIN RTC_IO shift 1 bit to data.
By doing it 8 times, it's a whole byte.

Reason I'm asking is that I'm confused about the shifting in to the RTC, first byte of data is only 7-bits and a '0', second is 7-bits and a NC(No care), third 6-bits + 2 NC, fourth 3-bit + 1 NC(4-bits),, fifth 6-bits + 2 NC, sixth 5-bit + 2NC + a '0' as MSB, and the seventh is 8-bits of data.
I found out that the time as well isn't ok after all, after 59 min it can move over to 60, 61 and so on, same for the hours..
Only thing working is seconds...
Sorry to be a pain in the a.. about this..
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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