Hey there!
I have been using a Raspberry Pi UART to communicate with a 9 bit serial protocol called multi drop bus (or MDB). This is used for vending machines and associated peripherals.
Using a Raspberry Pi Zero W running Raspberry Pi OS (Jessie), I have gotten it working pretty reliably. However, the exact same code running on the Pi Zero 2W doesn't work. The bytes with the 9th bit that should be marked as a parity error come through as normal bytes. Is there a difference in how Raspberry Pi OS Bookworm vs Jessie, or the Pi Zero W vs Pi Zero 2W handles parity checking/marking?
For example, on the Pi Zero W (working) bytes that fail the parity check are prepended with (0xFF 0x00), but I don't see this happening on the Pi Zero 2W. Using the same code, all the bytes come through to my Python program "unaltered".
Other context that may be useful:
To achieve 9 bit communication, I used the Python library termios to enable parity checking, ignore errors, and mark them. I then look for the bytes that mark a "failed" parity check (0xFF 0x00) to determine if the 9th bit was set. To control the 9th bit, I set/unset `termios.PARODD` in `cflag` for each byte. You can see the relevant code for this here: https://github.com/membermatters/pymult ... 60C1-L61C1
/boot/firmware/config.txt/boot/firmware/cmdline.txt
I have been using a Raspberry Pi UART to communicate with a 9 bit serial protocol called multi drop bus (or MDB). This is used for vending machines and associated peripherals.
Using a Raspberry Pi Zero W running Raspberry Pi OS (Jessie), I have gotten it working pretty reliably. However, the exact same code running on the Pi Zero 2W doesn't work. The bytes with the 9th bit that should be marked as a parity error come through as normal bytes. Is there a difference in how Raspberry Pi OS Bookworm vs Jessie, or the Pi Zero W vs Pi Zero 2W handles parity checking/marking?
For example, on the Pi Zero W (working) bytes that fail the parity check are prepended with (0xFF 0x00), but I don't see this happening on the Pi Zero 2W. Using the same code, all the bytes come through to my Python program "unaltered".
Other context that may be useful:
To achieve 9 bit communication, I used the Python library termios to enable parity checking, ignore errors, and mark them. I then look for the bytes that mark a "failed" parity check (0xFF 0x00) to determine if the 9th bit was set. To control the 9th bit, I set/unset `termios.PARODD` in `cflag` for each byte. You can see the relevant code for this here: https://github.com/membermatters/pymult ... 60C1-L61C1
/boot/firmware/config.txt
Code:
...[all]enable_uart=1dtoverlay=disable-bt
Code:
console=tty1 root=PARTUUID=f7a293e6-02 rootfstype=ext4 fsck.repair=yes rootwait cfg80211.ieee80211_regdom=AU isolcpus=3
Statistics: Posted by jabelone — Sun May 26, 2024 5:27 am — Replies 0 — Views 13