possible to use BIN2BCD and BCD2BIN without use RTC? on MSP430FR5959IDAR for example.
in debug all RTC register view as 0x3FFF;
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
possible to use BIN2BCD and BCD2BIN without use RTC? on MSP430FR5959IDAR for example.
in debug all RTC register view as 0x3FFF;
ADC not have this registers.
I planing use this register for fast convert integer to string and string to integer, whithout many divide by 10
For example. have integer 4321 and need send as string "4321" (standart LCD for example)
put 4321 to BIN2BCD and read form BIN2BCD BCD code
save this code to string unsigned char str[4]
str[3]=(unsigned char)(BIN2BCD & 0x000F) & 0x30;
str[2]=(unsigned char)(BIN2BCD & 0x00F0 >> 4) & 0x30;
str[1]=((unsigned char)(BIN2BCD >> 8) & 0x0F) & 0x30;
str[0]=((unsigned char)((BIN2BCD >> 8) & 0xF0) >> 4) & 0x30;
and have in str = "0x34,0x33,0,x32,0x31"
code in teory, not checked (but need optimization)
Also use for quick divide by 10, 100, 1000
put BIN2BCD, read BIN2BCD, shift 4,8,12 bit, put to BCD2BIN, read div int - bingo :)
PS - pardon, your ansver not resolved my issue, accidentally pressed this button
**Attention** This is a public forum