Jump to content
biza

MSP432 RTC User adjust

Recommended Posts

can anyone some help me? 
I have some problems with user rtc configuration in msp432 I made  a firmware where the user choose by hardware configuration adjust date and time (alarm clock). The problem is ... after the user adjust date and time I would like use the rtc to control the watch and show the current date and time in a lcd. The problem is ... after the user adjust date and time I would like use the rtc to control the watch and show the current date and time in a lcd. Soo i need some help in two things pass the user value (decimal) to hexadecimal or BCD and the inverse get the hexadecimal or BCD value to decimal to show in LCD . I'am using CCS, in CMSIS on attach i leave the code I have made to test it!

test.zip

Share this post


Link to post
Share on other sites

Hi @biza

This two conversions are quite simple to do.

Decimal to BCD (considering a number between 0 and 99)
- Divide the number by 10
- take te result and shift left 4 places
- take the modulo of division (%) by 10
- add the reminder to the left shifted value

BCD to Decimal (considering a number between 0 and 99)
- Shift right 4 places and multiply by 10
- apply a "AND" opperation between the number and "0xF" to isolate the lowest nible, then, add to last number

This video show this:
https://www.youtube.com/watch?v=nieuAryQ2SI

Share this post


Link to post
Share on other sites

now I have done some alterations on my file clock.c, and i see in the register's the clock working, so how can I get each parameter (Year, Month, Day, Hour, Minute)

Screen Shot 2018-01-15 at 15.09.14.png

Screen Shot 2018-01-15 at 15.14.17.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×