Topics

Smart Analog/Digital I/O Expansion and LCD Display for the uBITX. #ubitx #nano #radiuno #firmware

Tom, wb6b
 

Hi,

I want to expand the amount of digital and analog I/O pins available to add enhancements to my uBITX.

To do that I created a Smart LCD Backpack to replace the commonly found ones on the inexpensive 2x16 and 4x20 I2C displays found on eBay and Amazon.

I uploaded a library to GitHub that allows you to program a Arduino Nano to emulate the common I2C to parallel backpack used on the I2C displays. The Smart I2C Backpack, additionally, allows you to read and write the analog and digital pins on the Smart I2C Display Backpack.

The package includes a interface library that you include in your code to interface with the Extended I/O functionally. Also included are two example Sketches. One is the code you program into the Smart Backpack. The other is a demo/test program you program into another Arduino and connected via the I2C buss to the Smart Backpack Display.

The Smart Display Backpack should work with firmware using standard I2C LiquidCrystal drivers such as the KD8CEC firmware.

The code uses the following libraries:
The are all installable from the Arduino library manager, the GitHub URLs are just for reference.
SoftTimer.h  //https://github.com/prampec/arduino-softtimer
LiquidCrystal_PCF8574.h

I believe these are part of the base Arduino software install.
Wire 
LiquidCrystal

Hope others enjoy this new display and I/O expander. 

Here is the link to the code.
https://github.com/mountaintom/SmartLCDandIOexpander_I2C







Mike Woods
 

This is ingenious.  With the low price of arduino clones, this makes a lot of sense.

Mike ZL1AXG

On 4/07/18 12:50 AM, Tom, wb6b wrote:
Hi,

I want to expand the amount of digital and analog I/O pins available to add enhancements to my uBITX.

To do that I created a Smart LCD Backpack to replace the commonly found ones on the inexpensive 2x16 and 4x20 I2C displays found on eBay and Amazon.

I uploaded a library to GitHub that allows you to program a Arduino Nano to emulate the common I2C to parallel backpack used on the I2C displays. The Smart I2C Backpack, additionally, allows you to read and write the analog and digital pins on the Smart I2C Display Backpack.

The package includes a interface library that you include in your code to interface with the Extended I/O functionally. Also included are two example Sketches. One is the code you program into the Smart Backpack. The other is a demo/test program you program into another Arduino and connected via the I2C buss to the Smart Backpack Display.

The Smart Display Backpack should work with firmware using standard I2C LiquidCrystal drivers such as the KD8CEC firmware.

The code uses the following libraries:
The are all installable from the Arduino library manager, the GitHub URLs are just for reference.
LiquidCrystal_PCF8574.h

I believe these are part of the base Arduino software install.
Wire 
LiquidCrystal

Hope others enjoy this new display and I/O expander. 

Here is the link to the code.
https://github.com/mountaintom/SmartLCDandIOexpander_I2C








--
Mike Woods
mhwoods@...

John (vk2eta)
 

Great idea Tom, as this frees up IO pins on the main Nano for more controls.

I also used a 2nd Arduino as I2C slave for other purposes (SWR and supply voltage measures) but didn't think of connecting the 2nd unit as a display back-pack.

Excellent and very cost effective.

73, John (VK2ETA)

Tom, wb6b
 

Thanks very much for the kind compliments. I hope this project turns out to useful to others on this forum. 

I tried to make it relatively easy to use, and easy for the user to add custom functionally that can offload some work from the uBITX to the backpack.

As this is the first release, I hope there are only very minimal hiccups in the code.

Tom, wb6b

Dexter N Muir
 

Yippee! More I/O! Now I might be able to actually use the encoder for my '40! (Anyone done so already?)
VY 73!
Dex, ZL2DEX

Arv Evans
 

Dex  ZL2DEX

I think that several are already using the Raduino, or an alternative Raduino from other
persons.  Since your BITX40 is simpler than a uBITX you should already have enough
spare pins to use a rotary encoder (it only takes 2 digital inputs for the encoder and one
more for the push-switch).  Are you writing your own Raduino code or planning on using
software from someone else? 

Arv  K7HKL
_._


On Thu, Jul 5, 2018 at 1:55 PM Dexter N Muir <dexy@...> wrote:
Yippee! More I/O! Now I might be able to actually use the encoder for my '40! (Anyone done so already?)
VY 73!
Dex, ZL2DEX

Dexter N Muir
 

From elsewhere, please, if someone can point me in the right direction. BASIC in various dialects is pretty much my coding limit. I can possibly recognize blocks and their purpose, and where I could reassign pins, but that's about it. I'd like to incorporate uBitX's  code, perhaps menu structure? At present stonewalled at original firmware and a few mods. I tried an anti-clack and had part of DL4QA's circuit figured, but hadn't though of and didn't have to hand a FET ... and a QRM hurdle. Don't need multi-band (of course!) or paddle, but would enjoy straight-key CW.
73
Dex, ZL2DEX

Arv Evans
 

Dexter  ZL2DEX

You have several options available for upgrading your BITX40 to your own custom
Raduino:
  1. Obtain an original uBITX Raduino from Farhan and modify it for the BITX40.

  2. Obtain one of the alternative Raduino designs and modify that for the BITX40.

  3. Use an Si5351a board from QRP-Labs and an Arduino NANO and build your
    own Raduino version on a prototype board. 
All the options would probably involve some custom code specifically for the BITX40
and for the specific functions you want.  Coding for the Arduino is not much different from
the BASIC that you used years ago.  You can even turn on line numbers in the Arduino IDE
so that it looks a lot like BASIC, but you don't have "Go-To" statements.  In C-language we
call this "function calls". 

An Arduino Nano pinout is shown here:
http://lab.dejaworks.com/arduino-nano-pinouts/
At first glance this looks complex, but what is shown is the multiple functions that are
available on each pin of a NANO board. 
This URL shows how to get started with using the Arduino IDE:
https://www.arduino.cc/en/Guide/ArduinoNano
Information on commands for coding the NANO is shown here:
https://www.arduino.cc/reference/en/
And, source code for using a Raduino on your BITX40 is located here:
https://github.com/afarhan/bitx40
and
There is much more information available with a Google search for BITX40, uBITX,
and Raduino.  Of course the group here is usually more than ready to answer any
real questions, but they will probably not do your work for you. 

My suggestion would be that you purchase an Arduino NANO from one of the many
vendors, install the Arduino IDE on your PC, and start playing with just the simpler
examples code in the IDE.  This will help you build experience and confidence with
this platform, and will get you ready to tackle modifying one of the Raduino software
packages so it will do specifically what you want. 

This Arduino/Raduino stuff is not rocket science.  Learning the terminology is the
biggest hurdle.  Once you understand what is being described it becomes easier
than BASIC.  C-language code is maybe a bit more structured than BASIC, but that
just makes it easier to write code for.  In C variables have to be pre-defined as to what
they contain (integer, character, string, etc.) and just like BASIC, compound statements
are executed from the inner-most part to outer-most. 

When you run into problems or questions...just ask here on the discussion group.

Arv  K7HKL
_._





On Thu, Jul 5, 2018 at 6:55 PM Dexter N Muir <dexy@...> wrote:
From elsewhere, please, if someone can point me in the right direction. BASIC in various dialects is pretty much my coding limit. I can possibly recognize blocks and their purpose, and where I could reassign pins, but that's about it. I'd like to incorporate uBitX's  code, perhaps menu structure? At present stonewalled at original firmware and a few mods. I tried an anti-clack and had part of DL4QA's circuit figured, but hadn't though of and didn't have to hand a FET ... and a QRM hurdle. Don't need multi-band (of course!) or paddle, but would enjoy straight-key CW.
73
Dex, ZL2DEX

Dexter N Muir
 

Thanks, Arv (and All!). Now to research where in ZL (preferably local - find me on APRS.fi) and cost ... My present raduino is my second - I blew the first with stray wiring :(
There used to be a Dick Smith outlet here, but that's long gone - and far from the 'builder' outlet it was. I think there's a Jaycar 10 miles away, but I'm not mobile. Head down, tail up, here goes ...
73
Dex, ZL2DEX