Hi everyone,
I've recently been working on porting the AR488 project on ESP32 (also made it work on stm32).
Doing so I've started a pretty massive refactoring of the code and started adding new features.
My version of the project is at
https://github.com/douardda/AR488/tree/esp32The things I've done so far:
Concerning the project source code:- started a major refactoring of the code (e.g. split the big AR488.ino source file in parts)
- make it compilable on ESP32 (tested with several esp32 and esp32s2 boards) and STM32 (tested with a Nucleo STM32F303)
- use platformio to compile the project
- port the documentation as a sphinx project
https://www.sphinx-doc.org/en/master/ (which results in something like
https://sdfa3.org/david/ar488/ )
- use github actions to automatically rebuild the documentation and compile a number of firmware on git push (eg.
https://github.com/douardda/AR488/actions/runs/1473093046)
Firmware features- rewrote the macro system to make macros editable (stored in EEPROM/NVS, so not much room on AVR but plenty on ESP32),
- on esp32: add support for BT-SPP (serial over Bluetooth) and wifi (no web app, just a raw TCP socket, credentials are set using a new '++wifi' commands and stored as config using the '++savecfg' command; the automatic connection to wifi on startup is a matter of adding the '++wifi connect' to the macro 0)
- automatically select the command stream from which there is activity, so you can have the main serial interface, the BT one and the TCP connection at the same time; when you type a command on one of the stream, the AR488 select this stream as main command I/O device)
- add support for the IEEE 488-1 'TCT' command (allow the controller in charge to transfer the control to a device, typically usefull for plottingm see
https://pouet.chapril.org/@douardda/107276364706227913 , I've been able to plot from my HP3562A using the HPGL python plotter emulator I wrote years ago having the AR488 in controller mode, but then when I hit the plot button or send the 'PLOT' GPIB command, the HP3562A ask the controller to take control, which the AR488 does using this new 'TCT' command and put itself in device mode listening on address 5, then take back control when the 3652A signal its job is done).
- add support for the IEEE 488-2 'FINDLSTN' common controller protocol (quick list listening devices on the bus, see
https://pouet.chapril.org/@douardda/107289038291757650)
The documentation still needs a lot of work to be adapted to all these changes, and all this is far from being done (I am still not satisfied with the code structure, especially the content of commands.cpp, and the responsibility of the 'GPIB' class vs the 'Controller' class; implement OTA on esp32, and many other new features ).
I've been discussing with @WaveyDipole about all this, and since he actually also have a bunch of refactoring on his plate, it's not clear yet if this work will be merged back to the main project at some point, or if it will remain as a friendly fork.
Anyway I've though this may interest some of you. TBH using "legacy" AVR arduino nowadays does not make a lot of sense when you can get an esp32 board for 5 bucks, so I've kept the code "compatible" with avr boards but I may not keep it that way in the future (my version of the fw already do not fit in the arduino micro anymore for example).
HW side, I've also made a small modular PCB (I am waiting for the delivery from jlcpcb). It's a 2 parts assembly: one with the Centronics socket and the driver ICs (SN7516x, should be compatible with both the SN75161 and SN74162), and a daughter board to adapt to the chosen MCU module (I have made one for the esp32-devkitc, one for the esp32-s2-saola, and one for the Arduino Nano for now):
Once validated, this very simple design will be published.
If any (or all) of this interest you, I'm open for discussions and contributions on github :-)
David