My version of the GPIB USB adapter, based entirely on the Xyphro project, has two LEDs (red and green) but remains fully compatible with Xyphro firmware. The firmware only lights up the RED led.
the Xyphro version 2 adapter now has two LEDs on the same pins as my design. In addition, Xyphro has grounded pin xx to allow software detection of whether the hardware is 1 or 2 LEDs.
I have chosen to use two separate LEDs for Red and Green because they are readily available and cheap. My PCB design includes a footprint for a surface mounted bi-colour LED. This gives the option of two styles of LED, but not both installed.
My plan is to modify the firmware to accommodate two LEDs, while maintaining backward compatibility with the one red LED versions.
I am a "C" programming virgin, but I have done something in C-like languages.
My plan is to incrementally develop the software.
- Include a compiler switch to select 1 or 2 LEDs mode at compile/build time.
- Use a bit of the eeprom to select 1/2 LEDs mode. This would allow a user to select 1/2 LEDs.
The compiler switch is the easier option and also has the advantage that I don't have to test the LED mode in run time, that would lead to delays.
I plan to maximise use of interrupts to switch the LEDs, but I will still need to do some bit bashing in run time.
My first problem has been to setup the development environment.
With some guidance from here and running Ubuntu:
https://community.platformio.org/t/can-i-create-a-platformio-avr-project-from-existing-code-including-the-lufa-library/42538/2Install GCC:
>sudo apt install gcc-avr avr-libc
Clone the LUFA repository into the git folder:
git clone https://github.com/abcminiuser/lufa
It should end up in the
/home/user/git/
folder. The repository will be called
LUFA
Clone the UsbGpib.,,,,,repository into the same git folder :
git clone https://github.com/xyphro/UsbGpib.git
. It should end up in the
/home/user/git/
folder. The repository will be called
UsbGpib
I then renamed the
LUFA
folder to
LUFA_repository
From the LUFA_repository folder, I moved the LUFA folder into the ~/git/UsbGpib/ folder.
From the
~/git/UsbGpib/SW/MassStorage
folder run
make
That will build the bootloader.
I am going to edit this post as I progress to building the app.