You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using micropython to develop code to drive lin bus master/server, however I've decided to port this over to tinygo.
Communication is via a UART interface, something which is very well known and when I started the port I had imagined it would be an afternoon of work. However there is one feature of the micropython UART api which I've not been able to replicate. That is the sending of a 'break'.
This link provides a very useful intro into the bus Lin bus basics
But for those who aren't interested in reading the link, LIN bus is a one wire system used to drive things link car windows, indicators etc.
It's a master slave system, where the master can send to target devices, or request information from a device which then responds onto the bus.
Here's a snipped of the code use to send a packet onto the bus:
`
Nothing ground breaking here .. we calculate a CRC for the target and construct a packet to send.
To get the devices in sync we issue a break, then send 0x55 which allows all the devices to get the timing correct to decode the message.
So, as of right now I've not managed to find a way in the tinygo uart library which has the same functionality as the sendbreak() defined on the micropython uart.
For reference I'm using the LIN interface board from skpang.com.
Thanks in advance, and if more information is required please don't hesitate to ask.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi All,
I've been using micropython to develop code to drive lin bus master/server, however I've decided to port this over to tinygo.
Communication is via a UART interface, something which is very well known and when I started the port I had imagined it would be an afternoon of work. However there is one feature of the micropython UART api which I've not been able to replicate. That is the sending of a 'break'.
This link provides a very useful intro into the bus Lin bus basics
But for those who aren't interested in reading the link, LIN bus is a one wire system used to drive things link car windows, indicators etc.
It's a master slave system, where the master can send to target devices, or request information from a device which then responds onto the bus.
Here's a snipped of the code use to send a packet onto the bus:
`
crc = calculate_crc(lin_id,data,len,enhanced_crc)
lin_id = lin_id | lin_parity(lin_id)
`
Nothing ground breaking here .. we calculate a CRC for the target and construct a packet to send.
To get the devices in sync we issue a break, then send 0x55 which allows all the devices to get the timing correct to decode the message.
So, as of right now I've not managed to find a way in the tinygo uart library which has the same functionality as the sendbreak() defined on the micropython uart.
For reference I'm using the LIN interface board from skpang.com.
Thanks in advance, and if more information is required please don't hesitate to ask.
Beta Was this translation helpful? Give feedback.
All reactions