Hello,
How can I set the 9th bit when sending data with a LPC1518,?
On the LPC1830 I have used the sticky parity for this but I can't find this for the LPC 1518.
BR,
Jeroen
You need to write it as a word and not as a byte. I.e. any value over 255 will have the ninth bit set.
I can't remember if the current CMSIS code treats it as a word or if I wrote my own function in there to allow it. Some of the code cast the value as a uint8_t which chops off that ninth bit.
Hi Jeroen Bussink,
If you want to set the 9 bit mode, you can select the DATAEN as 0x02, just like the user manual:
Wish it helps you!
If you still have question, please let me know!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Kerry,
Thanks for you answer, the things you point out I already set.
But my question is how do I set the 9th bit to 1 so the LPC1518 will send data with the 9th bit set to 1.
In our protocol we send out the first byte (address) with the 9th bit set to 1 and the rest of the bytes with the 9th bit 0, so the slave device knows when a address byte is received.
On the LPC1830 I set the sticky parity to 1 or 0.
BR,
Jeroen
Hi Jeroen Bussink,
I think maybe you misunderstanding the 9bit function in the LPC15xx.
Multiprocessor/multidrop (9-bit) mode with software address compare.
From the user manual, this 9bit is just used for the address compare, you can consider the MSB=1 when set the 9bit mode, it normally used for the address compare, the data sending may don't have the 9 bit function.
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------