Hi All
Moving on from Arduino to Teensy 3.1 and Teensyduino.
I need to talk to a serial device (slot machine) that uses a rather strange serial packet structure. It needs 9 bits where the 9th bit acts as a wake up bit to tell the device that it is being addressed.
On Arduino I used the code suggested by Nick Gammon in this post - http://forum.arduino.cc/index.php?topic=54120
How do I go about achieving the same functionality by directly manipulating the serial control register for Teensy 3.1
(It looks like I need to enable 9 bit at bit 4 of UART C1 register and then change it to 1 or 0 by writing to bit 7 of the UART C3 register)
I have seen this post in the forum - http://forum.pjrc.com/threads/23873-serial-9-bit-on-the-t3?highlight=parity but still not to clear how I can achieve above.
TIA
Ian
Moving on from Arduino to Teensy 3.1 and Teensyduino.
I need to talk to a serial device (slot machine) that uses a rather strange serial packet structure. It needs 9 bits where the 9th bit acts as a wake up bit to tell the device that it is being addressed.
On Arduino I used the code suggested by Nick Gammon in this post - http://forum.arduino.cc/index.php?topic=54120
Code:
void SASPoll()
{
UCSR0B = 0b10011101; // turn 9th bit on
Serial.write(SASAdr);
UCSR0B = 0b10011100; // turn 9th bit off
}
How do I go about achieving the same functionality by directly manipulating the serial control register for Teensy 3.1
(It looks like I need to enable 9 bit at bit 4 of UART C1 register and then change it to 1 or 0 by writing to bit 7 of the UART C3 register)
I have seen this post in the forum - http://forum.pjrc.com/threads/23873-serial-9-bit-on-the-t3?highlight=parity but still not to clear how I can achieve above.
TIA
Ian
Last edited: