Showing posts with label Shield. Show all posts
Showing posts with label Shield. Show all posts

Thursday, November 6, 2014

New Minima-like build

My good friend Wayne NB6M has kindly loaned me his Minima-like build using my controller shield for the Arduino.  His front panel is very similar to his original Minima build, but is now sporting a 20x4 display.  He has removed the reset button from the front panel and added input for paddles in anticipation of me actually finishing the integration of my keyer code to the Minima code base.



Looking at the back of the panel, we can see the Arduino Uno and my controller shield mounted on the back of the display board.  Wayne has used #12 bare copper wire soldered to the front panel to provide attach points for the Uno and shield.  My shield will be modified to provide through-hole plating and solder pads so that it can be soldered in place.

The display board has been converted to i2c with a backpack board and the rotary encoder uses pins freed up by display being converted to i2c.  The current shield design does not incorporate the proposed pins for the encoder from the discussion list, but will be modified in the final run to be compliant.


Wayne is using a pretty conventional IF strip from the Minima, but has chosen to replace the KISS mixer and BFO mixer with ADE-1 devices.  His audio section is from a pre-existing project re-purposed for this project.  The two SMA connectors connect to the VFO and BFO Si570 outputs from my controller shield.  No low pass filter sections yet.  The current configuration makes a pretty nice general coverage receiver.


I have handed off Wayne's other Minima build to Eldon so he will have a working radio to test with during his software development efforts.

Thursday, October 23, 2014

Minima controller shield - Using second Si570 as BFO.


I have implemented changes to the Minima controller code developed by Eldon Brown (WA0UWH) and others to use the second Si570 on my controller shield as the BFO oscillator.  This change allows easy setting of your Minima BFO oscillator frequency to the desired point on your crystal filter passband curve, be that at the -3 dB point or further down the skirt.




The IF edit mode of the controller firmware will allow the adjustment of the BFO frequency.  Separate frequencies are maintained for USB and LSB.

A separate issue is regarding the calibration of both of the Si570 devices on the shield against some frequency standard.  For most folks that have a crystal oscillator for the BFO, the IF edit mode has probably been used to calibrate the dial to some frequency standard and this is fine.  However adjusting the IF frequency offset from the displayed frequency only allows you to match the value that the controller uses to whatever frequency your crystal oscillator BFO is tuned to whereas with the second Si570, you can actually move the BFO frequency in software which is not the same thing as calibrating the dial.




The calibration of the Si570 devices as I see it is a separate matter from setting the desired BFO frequency as you certainly don't want to change where the BFO frequency sits on the IF passband just to calibrate the dial.  So, I anticipate providing a different mechanism that will allow moving the VFO frequency (and BFO frequency for those using a second Si570 as the BFO oscillator) without changing the displayed frequency in order to determine the error offset for each Si570.  This error offset can then be stored in eePROM and applied automatically from that point forward to the appropriate Si570.

More to come on this topic...

Saturday, September 20, 2014

Minima Controller Shield - mounting options

Well, I am not certain yet how I am going to mount things in the long run, but for now I have stacked the display, Uno and Shield on the back of the panel.  My wires are deliberately long until I make a final decision, but for now I have just coiled them up.



I will most likely fashion another panel a little bit larger that will have room for more buttons as well as the rotary encoder at which time the current tuning pot will become the speed control for a keyer.  I have located some scrap aluminum, so I think it is the next best step.

Friday, September 19, 2014

Minima working with new shield

This evening, I hacked poor Wayne, NB6M's Minima to accept VFO energy from my Minima Controller shield.  As a first hack, it worked fine and I was able to test drive the receiver from my controller.



I disconnected Wayne's Si570 output and brought the coax out to an SMA connector that I hooked up with a short SMA jumper cable to my VFO output.  Other than being out of calibration, it seems to work fine.



So far so good...  I want to try using the second Si570 as the BFO, but more surgery is necessary in order to replace the BFO oscillator.  I think I will wait until I am more awake...

Tuesday, September 9, 2014

Minima Controller - 5V i2c LCD support

I have tested my Minima controller successfully for support of 16x2 or 20x4 LCD displays using a 5V i2c backpack.  Here is a 20x4 display running my changes to WA0UWH's latest firmware for Minima.



Only two wires plus power and ground required to support these displays.  The code is conditionally compiled with or without i2c display support as desired with the default to continue to support 6 wire displays.  Converting to an i2c display will be required in order to free up I/O pins to support such things as rotary controllers, keyer paddles, etc.  This change however will continue to work by default with the original Minima hardware configuration for the LCD display.  In order to enable the functionality, please uncomment the following line near the top of the file "radiono.ino".

    #define USE_I2C_LCD 1

  You will also need to obtain the i2c library LiquidTWI and install in your Arduino environment in order to build with this support.

It should be noted that my Minima Controller shield is not required to support i2c displays.

Please contact me directly by email at ko7m at arrl.net or by commenting on this post if you have any problems and I will do my best to assist.

Monday, September 8, 2014

Minima Controller Shield - Some measurements

Last evening I placed my second Si570 on my Minima Controller shield and am pleased to see it is functional as well.

The datasheet for the Si570 CMOS version says that supply current draw should typically be 90 mA with a maximum of 98 mA.  With both devices powered up, I am seeing a current draw on the 3V3 rail of 140 mA.

The Arduino UNO R3 board uses a TI LP2985-33DBVR regulator which according to its datasheet is rated for 150 mA.  There is nothing on the Arduino board that uses 3V3, but given the maximum current draw of two Si570 devices at 196 mA drove the decision to install a separate 3V3 800 mA regulator on the board.  At my current draw, I might be able to get away with using the Arduino 3V3 rail, but it is pushing things.  Another option might be to replace the regulator but again, I didn't want to modify the Arduino board.

Interestingly, the Arduino documentation says not to draw more than 50 mA from the 3V3 rail which makes me suspect that they may have trimmed the heat sink tab on the part.

I am seeing 13.5 dBm with no attenuation out of the Si570 devices so there is plenty of drive available to allow experimentation with different mixers.  The PI pad resistors can be populated to set any level desired.



I have Wayne, NB6M's Minima build at my disposal for a few weeks to be able to try out the new shield for both VFO and BFO signal sources and am looking forward to seeing how this works out in a practical sense.



Sunday, September 7, 2014

Minima Controller Shield programming

UPDATED:

As was intended, programming of the controller shield is trivial.  A single additional class was required and no changes to other code or libraries was necessary.  With the Si570 devices behind a multiplexer, the only change necessary to the main Minima sketch is to select the multiplexer channel containing the Si570 you wish to talk to.  For a controller with a single Si570, selecting that channel needs only happen at startup and existing code continues to work unchanged.

I created a driver class for the PCA9546 as follows:

File: PCA9546.h

#ifndef PCA9546_H
#define PCA9546_h

#ifndef P
#define PBUFSIZE (66)
extern char buf[PBUFSIZE];

#define  P(x) strcpy_P(buf, PSTR(x))
#endif

typedef enum 
{
  PCA9546_ERROR = 0,
  PCA9546_SUCCESS
} PCA9546_Status;

#define PCA9546_CHANNEL_1 (1) // Bit 1
#define PCA9546_CHANNEL_2 (2) // Bit 2
#define PCA9546_CHANNEL_3 (4) // Bit 3
#define PCA9546_CHANNEL_4 (8) // Bit 4

class PCA9546
{
public:
  PCA9546(uint8_t i2c_address, uint8_t channel);

  PCA9546_Status status;
  uint8_t channel;

private:
  uint8_t i2c_address;
  bool selectChannel(uint8_t channel);
  uint8_t i2c_read();
  void i2c_write(uint8_t data);
};

#endif

File: PCA9546.cpp

/*
 * PCA9546 Library for Arduino
 *
 * MIT License
 *
 * Copyright Jeff Whitlatch - ko7m - 2014
 */

#include <Arduino.h>
#include <Wire.h>
#include "PCA9546.h"
#include "debug.h"


#define DEBUG(x ...)  // Default to NO debug    
//#define DEBUG(x ...) debugUnique(x)    // UnComment for Debug

// Initialize the PCA9546 and enable the channel(s) indicated
PCA9546::PCA9546(uint8_t PCA9546_address, uint8_t channel)

  i2c_address = PCA9546_address;

  Wire.begin();
  selectChannel(channel);
}

// Send a channel selection word to the PCA9546
bool PCA9546::selectChannel(uint8_t channel)
{
  // Sanity check value passed.  Only least significant 4 bits valid
  if (channel <= 0xf)
  {
    i2c_write(channel);
    debug(P("Successfully selected PCA9546 channel"));
    status = PCA9546_SUCCESS;
  }
  else
  {
    debug(P("PCA9546 channel selection failed"));
    status = PCA9546_ERROR;
  }
  return (PCA9546_SUCCESS == status);
}

// Write a byte to I2C device.  There is only a single register.  If multiple bytes written, last one wins.
void PCA9546::i2c_write(uint8_t data)
{
  Wire.beginTransmission(i2c_address);
  Wire.write(data);
  Wire.endTransmission();
}

// Read the one byte register from the I2C device
uint8_t PCA9546::i2c_read()
{
  uint8_t rdata = 0xFF;
  Wire.beginTransmission(i2c_address);
  Wire.requestFrom(i2c_address, (uint8_t)1);
  if (Wire.available()) rdata = Wire.read();
  return rdata;
}

So, this new class has been added to the Minima source files.  In the Minima main sketch, I add the following code right before including "Si570.h":

#include "PCA9546.h"

I then add the definition of the PCA9546 I2C address right before the one for the Si570:

#define PCA9546_I2C_ADDRESS 0x70

I then create a global variable to hold the PCA9546 object right before the one defined to hold the Si570 object:

PCA9546 *mux;

Ok, so the only thing required now is to initialize the multiplexer and select channel 1.  The rest of the Minima sketch can run without change.  I put the following code right before the initialization of the Si570:

  // Initialize the PCA9546 multiplexer and select channel 1
  mux = new PCA9546(PCA9546_I2C_ADDRESS, PCA9546_CHANNEL_1);
  if (mux->status == PCA9546_ERROR)
  {
    printLine2CEL(P("PCA9546 init error"));
    delay(3000);

  }

I have posted the PCA9546 driver source and integration with Eldon Brown's (WA0UWH) latest Minima sketch on my public branch of my Minima repository on Github.  Please check it out at https://github.com/ko7m/radiono_ko7m.

If integration of the files above provides any grief for anyone cloning my shield, please contact me for assistance and I will be happy to help.  Direct email is ko7m at arrl.net.

Minima Controller Shield checkout

UPDATED:

My Minima controller Arduino shield checks out as functional.  With two Si570 devices on the board, powering them from the Arduino regulator is pushing things, so I have isolated the 3V3 rail from the Arduino and provided my own regulator.  However, with only a single Si570 on the board, I am within limits on the Arduino regulator.  Therefore, I jumpered the power input pin back to the Vin pin on the Arduino to supply power to the shield.  This is the brown jumper wire seen below.  The yellow wire is the ground to my scope probe.



Measuring the voltage off the regulator and the Si570 look good.  Probing the output of the Si570 as seen above, we have the following default frequency of 56.32 MHz output seen below.



For those following along, the schematic of the shield looks like this.  There really isn't anything to it.  Just a multiplexer in front of two Si570's, voltage regulation and breaking out some of the I/O pins to separate cable connections for the Minima.




Now to go figure out how to talk to the multiplexer and the Si570.

I removed the shield from the Arduino Uno and connected up a bus pirate to see if I can talk to the PCA9546.  When searching the I2C address space for devices, initially I got a "response" from all possible addresses.  Clearly this is wrong...

Probing the PCA9546 I found that the voltages were correct, but that the reset pin was held low.  As seen from the schematic above, this is connected to the reset button and the ICSP reset pin.  However, this pin on the shield is not pulled up to any voltage rail and currently relies on the connected UNO to supply this voltage.  So, rather than power the shield from the bus pirate, I plugged it back into the UNO and reinstalled my brown power jumper and just monitored SCL and SDA pins with the bus pirate.



Now interrogating the bus yielded the following results:

Bus Pirate v3
Firmware v4.2 Bootloader v4.2
DEVID:0x0447 REVID:0x3043 (B5)
http://dangerousprototypes.com


I2C>(1)
Searching 7bit I2C address space.
   Found devices at:
0xE0(0x70 W) 0xE1(0x70 R) 0xFE(0x7F W) 0xFF(0x7F R)

Checking the PCA9546 datasheet, we see the following:


If you look at the schematic above, you will notice that I connect A0-A2 to ground, so the device address should be 0x70 (this value is the 0xE0 shifted right one bit to remove the read/write bit) and the read/write addresses should be 0xE0 for write and 0xE1 for read.

So, it looks like the PCA9546 can be seen on the bus and so now it might be time to write some actual code.

Saturday, September 6, 2014

Minima Controller Shield Build

I have completed (as far as I went) the build of my Minima Controller Shield, but have yet to complete testing of the board.  I populated only a single Si570, the edge and ICSP stackable headers and the header for my OLED display.



The prototype board needs a little work.  I need to move the VFO SMA edge connector away from the USB connector.  This will work for a prototype, but needs to move in the final version for sure.



The OLED display is a 3V3 device and I have it sharing the same I2C bus as the first Si570 for the VFO.  There is also a 5V set of connections for an LCD display with an I2C backpack for example.  This shares the same I2C bus as the PCA9546 multiplexer input, so it should allow 5V displays to work without driver modifications.   I will need to customize the 3V3 OLED driver to take into account that it is connected to the PCA9546 multiplexer.  I used this device because it allows voltage level conversion with a 5V input side and four 1.8 - 5V or more output side I2C buses.  It also allows me to address multiple devices that do not allow you to change their I2C address such as the Si570.  Without it, one would be limited to a single Si570 on a bus.



Ok, off to do some voltage testing and then to see if I can address the PCA9546.  If so, I will get busy on my display driver changes and testing the Si570.  I plan to roll my changes back into my Si570 driver to allow multiple instances behind a multiplexer as a compile time option.

Monday, August 11, 2014

Si570 Arduino Shield PCB is off to be manufactured

I finished up the Si570 shield for the Arduino today and sent the gerber files off the the fab house today.  They will be on the panel to be produced on 13 Aug, so hopefully I will have some prototype PCBs back soon.



Update: My prototype boards shipped yesterday (Friday) so hopefully they will be in hand by Monday.

Sunday, July 27, 2014

Minima breadboard of Controller

I have integrated my keyer code that was originally developed for the Propeller hardware and ported to the Arduino with the Minima firmware.  My Si570 driver enabling 1 Hz tuning, AdaFruit's encoder driver and my latest OLED display have all been integrated with the Minima firmware.

The lash-up I have for tested can be seen below.  This implements a working Minima controller with rotary encoder tuning and an OLED display.  The keyer paddles and sidetone speaker are enabled by the freeing up of LCD display pins by converting the display to I2C.



Rather than build a controller board, I am laying out an Arduino shield board that will contain the Minima's Si570 and connectors for all the other components such as the encoder, display, CW speed control, paddles, PTT and a  myriad of buttons.  I have adopted the button logic pioneered by Eldon, WA0UWH.  The shield will contain solder pads for an optional second Si570 that could be used for a BFO signal, easily set to be optimum for USB, LSB or CW.  Both Si570 devices will have solder pads for a resistive pad to allow easy setting of output level down from the 13 dbm of the Si570.  This would allow experimenting with different mixers for example.  If no attenuation is desired, a 0 ohm resistor or solder jumper may be installed instead.  This also allows for a load resistor to be installed if desired.  Here is a quick screenshot of my current (incomplete) state of things:




I am also laying out a PCB for the Minima transceiver module.  I have gone back and forth on making it SMT or thru-hole and have decided to use SMT as much as possible.  Some of the components will need be thru-hole, but to the degree possible, I will use SMT components.  My build will be pretty generic, though I am contemplating using a different crystal filter as I have a module that has been rattling around in my junque box for a number of years that might be fun to use rather than the discrete crystal filter of the Minima.  If I do use the filter module, I will attempt to lay it out such that it could be built either way.

Meanwhile, I am collecting parts for the build.  



Saturday, April 2, 2011

New RTC and data logging shield for beacon project

I have built one of the fine data logging shields for Arduino from the fine folks at Adafruit to further clean up my beacon project rats nest.  The new setup looks like this attached to my Arduino Uno.
I need to add a socket for the DDS-60 and a couple headers to bring data GPIO lines out.  The real-time clock has been tested and is functional.  This should be my final setup until a PCB is created for this project.