Posted on May 21, 2014 at 08:42The original post was too long to process during our migration. Please click on the attachment to read the original post.
A lot to wade through there, would be a bit more efficient with a switch/case for the decode. Even an if/then/else construct.
The problem, I suspect, is that you are sending ASCII characters, '0' to '9' and expecting them to be decimal numbers 0 - 9, but are instead 0x30 .. 0x39. You need to translate them, either manually or with atoi(), and you perhaps want your 7-Segment decoder to have a default for characters it doesn't recognize, like '-'
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
This user trying to make UART data to 4 digit display.In case of SPI data, if uint8_t pDataRx[4] is turned to BCD and fed them in 74HC4511 decoder-driver to 4 digit display. It will work? Further translation is needed or not?
This user trying to make UART data to 4 digit display. In case of SPI data, if uint8_t pDataRx[4] is turned to BCD and fed them in 74HC4511 decoder-driver to 4 digit display. It will work? Further translation is needed or not?
Let's keep this in [DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/converting%20BCD&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx¤tviews=101]one thread please.Present the data you are receiving, and what you want/expect to be displayed, provide multiple examples.