Repository navigation
Port expanders as serial bus peers #348
falkoschindler
started this conversation in
Ideas
Replies: 1 comment
P0 ran as a serial bus peer on F30: its share of the main loop dropped from 14–17 ms to under 0.1 ms, and the loop holds its 10 msOn F30 we replaced the port expander P0 with a serial bus peer on the same wires (a prototype on top of #365), together with telemetry frames for the core line and the plexus. With RoSys running, the main loop averaged 10.0 ms over about 2.5 hours, with every cycle within 20 ms; in production, with all values as text, it averages 36 ms and no cycle stays within 20 ms. With frames everywhere except P0, which was still an expander, the loop stayed at 18.4 ms, so the expander was the last big part. Next step: a PR for the bus side (a bus on the peer's console UART and flashing a peer through boot and enable pins) once #365 is merged. Loop times on F30Loop period with RoSys running:
Work per loop by part, from a diagnostic build, RoSys stopped:
Answers to the open questions from F30
Found on the way and still open
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Lizard has two ways to use a second microcontroller: the
ExpanderwithProxymodules, and aSerialBuswith peers. With telemetry frames (#340) the serial bus gets a fast, binary way to bring values to the coordinator. The question is whether an expander could become a serial bus peer with one partner, so Lizard only has one concept to maintain.How the two differ today
led = expander.Output(15)creates the remote module and a proxybus.sendstrings orconfigure.py --serial-busbus.send(id, "…")Ready., layouts and values recoverexpander.flash()copies the core's own image via boot and enable pinsWhat would get better
!!lines cost about 40 ms per step (Jens). Frames avoid the parser.What would get worse or needs a solution
bus.sendstrings is unpleasant. Options: a host tool that writes one script per microcontroller (see A Python package for talking to Lizard #346), or a Lizard construct that sends a block of code to a peer.SerialBuswith UART, two queues and a task stack cost about 34 KB in Jens' breakdown, an expander about 13 KB. A one-peer bus might need smaller queues.Expanderand proxies. The expander would have to stay for a long time, maybe deprecated, maybe rebuilt on top of the bus.Open questions
Expanderas a thin layer over a one-peer bus, so existing scripts keep working? ※All reactions