24 October 2008

FT817 keypad - circuit diagram

Now that the keypad firmware has reached a usable state, here is the schematic diagram I am about to implement.



The development version ran on the internal clock set at 1 MHz, but it was inaccurate enough that serial communication was not possible at 9600 bps. Since reproducibility of this project is a must, I prefer to distribute a code that relies on an external, more accurate, clock source.

Keypad lines are labeled according to the top-most or left-most key of the column/row. You will need to check the pin layout of your keypad in a datasheet or with an ohmmeter (pressing keys until you map the 8 pins). On mine were exactly in the required order C1 to R* from left to right (looking at the keypad as if you were using it).

LED current flows into the chip, and don't forget to connect the resistor to the +5V line.

Pins on the ACC socket (MiniDIN 8 pins) are labeled as shown on the FT-817 manual.

That's all. If you are equipped to program an ATtiny2313 and need the firmware, just drop me a line. If you want a programmed and tested controller chip, do not hesitate to contact me either! mycall at yahoo.com ("mycall" is the first part of this blog URL, also written on the blog name...). If you need a customized keypad firmware with different key mappings or presets, I'm here to help.


17 October 2008

FT817 keypad for serious QRP /P contesting

In August 2008, after a productive VHF contest outside at 2700 masl (8800 feet asl), I felt the need to add an external keypad to my FT817 so that some controls would be readily accessible.

After a few months of software and hardware development I am announcing an alpha version of my keypad!

It is based on Atmel's ATtiny2313 microcontroller, uses very few components and does almost everything I wanted it to. Functions have been tailored to what I needed most last August, and the current release does the following:
  • direct frequency dial
  • mode change
  • VFO toggle
To be tested (tonight):
  • Presets QSYs to QRP frequencies (16 of them)
Still being studied:
  • Output power control
  • VOX on/off control
  • Meter mode control
but I am afraid these last will not fit into the 2313 program memory. So a modular approach might be suggested: functions are loaded as needed by the operator depending on the activity type (contesting, SOTA, ragchewing, ...).

Given the 4x4 keypad layout of the top table (see below), key functions are depicted below per each function.

Frequencies are entered with leading zero-padding to 100's of MHz: 007030 for 7030 kHz, 014060 for 14060 kHz, 0035C for 3500 kHz, 028# for 28 MHz, etc etc.
Mode switching is a star "*" followed by another key (see the Modes mapping).
Frequency presets are accessed with pound sign "#" followed by another key (see the Presets mapping).
VFO toggle is a single key press, as well as should be other functions under development (power, vox and meter).


Keypad Layout
1 2 3 A
4 5 6 B
7 8 9 C
* 0 # D




Main Menu
1 2 3 VFO Toggle
4 5 6 PWR cycle
7 8 9 VOX toggle
to Mode 0 to Presets Meter mode




Frequency dial
1 2 3 end
4 5 6 end
7 8 9 end
end 0 end end
Usage:
014060 = 14060 kHz 144305 = 144305 kHz
014# = 14000 kHz 007C = 7000 kHz




Modes
CW CW CW CW
AM FM CWR CW
USB LSB CW CW
CW CW CW CW




Presets
1843 CW 3560 CW 7030 CW 10116 CW
14060 CW 18096 CW 21060 CW 28060 CW
14285 USB 50090 CW 21285 USB 28500 USB
144300 USB 50150 USB 432200 USB 29500 FM


A LED blinks at each keypress. The current consumption is about 10mA and the device can be powered directly from the ACC socket (where the commands are sent).

This keypad is not meant for a home-based station, where some excellent computer programs can do this and a lot more. It is an operator's aid when having fun on the field.

The same code might work with other Yaesu transceivers, like the FT857.

Interested?

14 October 2008

The LED, as seen from 250m

I left the LED TX at my parent's, waited for the night to come, then asked them to fire it up and beam it towards me. Currently the TX draws 36mA. This is the view from the farthest window:

And zooming in... the LED signal is there:

The picture was taken with a 2MP cameraphone without any optical zoom. At the naked eye (not fully adjusted to darkness) the beam was a bright red spot. With a tripod it could be possible to keep the maximum intensity in the right direction. Distance: approx 250 metres.

I couldn't try a reception test because the RX circuit is being boxed and adapted for a telescope mount. Fortunately I've met an enthusiastic amateur astronomer that now wants to become famous by breaking the world optical record. Simone might even learn morse code :-)

Meanwhile I'm slowly building a second TX-RX pair, with the TX capable of sending FSK for an RTTY test.

07 October 2008

Attiny2313: listen and repeat

It took about two hours, three evenings and twenty re-programmings to get it working. Though, it probably worked even the first time, since the problem was not in the code.

Once I had verified the 4x4 keypad was read correctly and mapped the Getkbd codes, my target was to send the FT817 a "VFO Toggle" command.

With one Printbin combination I could only get the radio to tune 10'101,01 kHz, while it was supposed to change VFO.

As a last resort I reduced the communication speed from 9600 to 4800 baud (on both the chip and the radio!) and it magically started working. I could also program a static VFO retune command. Cool.

Since the code was not changed I can only assume the internal clock is either not suitable for (fast) serial communications or it is way off the declared/programmed value.

02 October 2008

My ATtiny2313 said "Hello World" !

Yes! Yes! Yes! What was I doing wrong?

I could initially program a HEX file into the chip, but that code was downloaded from Internet and probably meant for the older AT90S2313. I had rewritten and recompiled the same code with BASCOM-AVR for the ATtiny2313 but somehow I couldn't get the program into the chip: everything completed correctly, I could change fuse settings, but the CODE memory wasn't updated.

So I tried a -e (erase chip) round with avreal32. Reading the uC content resulted in a lot of F's: the chip was blank.

Then I wrote the code back and ... magic! The LED flashed. Remember: the ATtiny2313 (probably) comes pre-programmed to use the internal 8 MHz clock divided down by 8 to 1 MHz, so you don't need any external component.

This is the BASCOM-AVR code. Don't forget to play with GUI settings to set the proper chip.


Config Portb = Output 'set port B as output

Do ' eternal loop
Portb.0 = 1 ' make portB.0 high
Waitms 500 ' wait 500ms
Portb.0 = 0 ' make Portb.0 Low
Waitms 500 'wait 500ms
Loop


Press F7 to compile. Take the .hex file and feed it to avreal32 (see previous post for the command line string).

The circuit? PortB.0 is pin 12 on ATtiny2313. Wire as follows:
  • pin 20 to +5V
  • pin 10 to ground
  • pin 12 to a LED cathode
  • LED anode to 270 ohm resistor (or 220, or 330 or 100+100+100 ohm, you got the pointt)
  • the other resistor terminal to +5V
Ready for the smoke test? :-)