• You can now help support WorldwideDX when you shop on Amazon at no additional cost to you! Simply follow this Shop on Amazon link first and a portion of any purchase is sent to WorldwideDX to help with site costs.
  • Click here to find out how to win free radios from Retevis!

CBduino Lite V1_0

Have you thought about OLED?

I have thought about them, but haven't done anything about it. Being naturally lazy I was hoping someone else would do it first and I could look over their shoulder and copy their paper.

One of the guys on the Yahoo group has found a .96 OLED, about $10 off fleaBay, fits nicely into a CB channel display window.

The library takes up about a third of the program space, but it could probably be streamlined and your sketch is small anyway, no need to leave program space empty when you could use it for a pretty display!

Most people appreciate a pretty face, think I'll head over to fleaBay and take a look.

Thanks for the tip.
 
I thought about one earlier, but it was for another project. I ordered one but when it got here from China it was DOA and not worth returning, so I used an lcd on the project and went on. The Yahoo Groups member has prompted me to get another coming though, I ordered from upgradeindustries as I've dealt with them before and they ship quickly, though China if you want to wait is cheaper. Pretty is nice!
 
Playing with interfacing to the channel selector. It seems the PLL in my radio is pulled high and then connected to ground by the channel selector to pull a line low. This is confirmed by the radio being at 27.445 if the PLL lines are unhooked, which does equate to all high in binary, and if I hook an ammeter up in series with one of the lines when it's pulled low it shows about .24 ma flowing from from the PLL to the channel selector. An ohm meter doesn't ohm anything to ground, but the schematic shows some diodes and transistors in the channel selector so that's probably why.

I'm using a 9555 I2C i/o expander. When configured as an input it has internal pull up resistors that pull the pins high. Since the channel selector is sinking power instead of supplying it, I can hook it up to the i/o expander directly and it reads the channel selector just fine. :cool:

It appears other radios do this the opposite though, the 959 for instance has pull down resistors on the main board, so it's channel selector must supply power to set the PLL? If so then a level shifter or voltage divider circuit would be needed to interface to the 5v i/o expander....how does your channel selector work? Does it supply or sink power?
 
This sketch reads the channel selector on my 979 through a 9555 i/o expander and outputs to the pll through a level shifter.

It starts at the lowest possible channel and works it way up 40 channels in sequential order with no skips or channel misalignments (26.815 to 27.205 on my radio).

That's all it does for now, I'll eventually have it set a band flag as you cross the 40/01 band border and then have it continue on up or down, so we should end up with continuous tuning and the channel it was on when powered down should persist when powered back up.

I used the same index to array method on this version. There is actually a 45 channel spread between CB channel 1 and 40 due to the 5 skipped channels in the lower 23, the channel selector can't ever select them but it screws the index up if you don't have the array size match the spread, so I put blank place holders in the extra channel slots.

// CBduino Lite V1_2
// 2/17/15
// Written on an Arduino Nano.
//
// Experimental, this sketch assumes a level shifter is hooked up and an I2C 9555 i/o port expander
// is hooked up. The port expander can interface directly to the channel selector on a Galaxy 979,
// it may not to other radios, if not using a 979 proceed with caution!
//
// Not overly commented, just playin' and thought others may want to too.

#include <Wire.h> // required library for i2c interface
#define PCA9555 0x20 // i2c address of board, run i2c scanner sketch to get the address
#define IN_P0 0x00 // Read Input port0
#define IN_P1 0x01 // Read Input port1
#define OUT_P0 0x02 // Write Output port0
#define OUT_P1 0x03 // Write Output port1
#define CONFIG_P0 0x06 // Configuration port0 configures the direction of the I/O pins 0 is output 1 is input
#define CONFIG_P1 0x07 // Configuration port1 configures the direction of the I/O pins 0 is output 1 is input
byte byte_read;
int channel; // holds PLL setting for the desired channel
int output_to_pll[7] = {8,7,6,5,4,3,2}; // Pins assigned as digital outputs to the level shifter.
// The array below holds the PLL settings that are sent to the PLL for a
// particular channel reodering the list will reorder how the radio tunes
byte CHNL[45] [7]= {
{1,0,0,0,0,0,0}, // 01 0
{1,0,0,0,0,0,1}, // 02 1
{1,0,0,0,0,1,0}, // 03 2
{0,0,0,0,0,0,0}, // -- 3
{1,0,0,0,0,1,1}, // 04 4
{1,0,0,0,1,0,0}, // 05 5
{1,0,0,0,1,0,1}, // 06 6
{1,0,0,0,1,1,0}, // 07 7
{0,0,0,0,0,0,0}, // -- 8
{1,0,0,0,1,1,1}, // 08 9
{1,0,0,1,0,0,0}, // 09 10
{1,0,0,1,0,0,1}, // 10 11
{1,0,0,1,0,1,0}, // 11 12
{0,0,0,0,0,0,0}, // -- 13
{1,0,0,1,0,1,1}, // 12 14
{1,0,0,1,1,0,0}, // 13 15
{1,0,0,1,1,0,1}, // 14 16
{1,0,0,1,1,1,0}, // 15 17
{0,0,0,0,0,0,0}, // -- 18
{1,0,0,1,1,1,1}, // 16 19
{1,0,1,0,0,0,0}, // 17 20
{1,0,1,0,0,0,1}, // 18 21
{1,0,1,0,0,1,0}, // 19 22
{0,0,0,0,0,0,0}, // -- 23
{1,0,1,0,0,1,1}, // 20 24
{1,0,1,0,1,0,0}, // 21 25
{1,0,1,0,1,0,1}, // 22 26
{1,0,1,0,1,1,1}, // 24 27
{1,0,1,1,0,0,0}, // 25 28
{1,0,1,0,1,1,0}, // 23 29
{1,0,1,1,0,0,1}, // 26 30
{1,0,1,1,0,1,0}, // 27 31
{1,0,1,1,0,1,1}, // 28 32
{1,0,1,1,1,0,0}, // 29 33
{1,0,1,1,1,0,1}, // 30 34
{1,0,1,1,1,1,0}, // 31 35
{1,0,1,1,1,1,1}, // 32 36
{1,1,0,0,0,0,0}, // 33 37
{1,1,0,0,0,0,1}, // 34 38
{1,1,0,0,0,1,0}, // 35 39
{1,1,0,0,0,1,1}, // 36 40
{1,1,0,0,1,0,0}, // 37 41
{1,1,0,0,1,0,1}, // 38 42
{1,1,0,0,1,1,0}, // 39 43
{1,1,0,0,1,1,1} // 40 44
};
//
void setup() {
for (int i=2; i <= 8; i++){
pinMode(i, OUTPUT); // sets pin ports 2 through 8 as an output
}
Wire.begin(PCA9555); // join expansion board to i2c buss
write_io (CONFIG_P0, B00000000); //defines all pins on Port0 are outputs
write_io (OUT_P0, B00000000); //sets all pins on Port0 to low
write_io (CONFIG_P1, B11111111); //defines all pins on Port1 are inputs
}
//
void loop() {
check_what_channel(IN_P1); // this function reads the channel selector and returns the channel array index
generate_pll_divisor(); // this function generates the pll divisor settings for the channel selected
}
//
//****Functions****//
//
void check_what_channel(int ReadPort) {
Wire.beginTransmission(PCA9555);
Wire.write(ReadPort);
Wire.endTransmission();
Wire.requestFrom(PCA9555,1);
byte_read = Wire.read();
byte_read = byte_read ^ B10000000;
channel = map(byte_read,79,123,0,44);
}
//
void generate_pll_divisor() {
for(int a=0; a < 7; a++){
digitalWrite(output_to_pll[a], CHNL[channel][a]);}
}
//
void write_io(int command, int value)
{
Wire.beginTransmission(PCA9555);
Wire.write(command),Wire.write(value);
Wire.endTransmission();
}
 
It appears other radios do this the opposite though, the 959 for instance has pull down resistors on the main board, so it's channel selector must supply power to set the PLL? If so then a level shifter or voltage divider circuit would be needed to interface to the 5v i/o expander....how does your channel selector work? Does it supply or sink power?

The MB8719 has internal 1K pull down resistors, so if anything you could call the channel selector a "source". I call it "breakable".

The programmable divider pins normally receive +8 V as a logic "1", but I think they'll read +5 V no problem, so driving them with an Arduino or a 9555 directly may be an option. Won't know until I try. Won't try until I get paid again.
 
My board has the RCI8719 and the Galaxy 959 schematic shows external 1k pull down resistors between the PLL lines and ground. On my board those resistors are unpopulated, though if you install them it indeed pulls the PLL lines low. If the pull downs are not installed on my board and nothing is hooked to the PLL lines, they all indeed have 8v on them, so it appears the RCI8719 does NOT have the internal pull downs and the 959 operates in pull down mode via external pull downs where my 979 operates in pull up mode which is why they didn't install the pull down resistors and the channel selector sinks current instead of sourcing it. If the RCI8719 will operate reliably with 5v input the move on my radio may be to install those pull down resistors and then interface the Arduino directly with no level shifter. I'll have to investigate a bit.

If the 959 channel selector is sourcing voltage instead of sinking it, then a level shifter could be used, or a voltage divider (a couple resistors or a pot set to drop the voltage down to 5 or a little less) could be used.

A poster on the Yahoo group claims if you put 4v to pin 10 you'll get 64 more channels. I dunno how that would work as pin 10 is just a divider setting input. I found another mod document for the Cobra 148 and it details a mod to enable 64 more channels, but it's diddling with pin 17 as well as 10. 17 is the freq input so it may be able to do something along these lines. It's also removing some resistors and diodes. I couldn't find matching circuitry in my radios schematic, and it says realignment of the receiver will probably need done afterwards, so I'm not too excited over it for now - I like plug and play.
 

dxChat
Help Users
  • No one is chatting at the moment.