A place to exchange information about parts and kits supplied by http://kitsandparts.com
You are not logged in.
I have nothing against DIZ's DDS kit, but since I started with the DDS60 I've been working on building a DDS VFO based on this unit. I also have a module based on the AD9951 DDS unit. I've been working on and off with the atmega16 processor and the avr-gcc C complier. I've programmed uc's in assembler before so I have nothing against assembler, but after working on several projects at work in C I'm familiar with the tools. The AVR-LIBC package has a huge wealth of support for the AVR family, and it seems a shame to re-invent the wheel by NOT using it. I will admit though that by writing the application in assembler you can probably fit the same functionality into a smaller (flash) sized version of the same processor.
So far I've written code to program the AD9851 to the desired frequency, written a driver for my rotary encoder, and have command input via the usart serial connection to my PC as a terminal. I've built an 8 digit LED display using the MAX7221 LED driver chip. This will be interfaced to the AVR's SPI interface, both the DDS and the LED driver will share the same SPI clock and data lines, but will have different data latch signals. I haven't yet wired the LED board to the micro or written the driver code, hopefully later this week. After that comes the keypad interface.
My rotary encoder was rated at 128 cycles per revolution, but due to the way I've interfaced it (BOTH phases generate interrupts on BOTH edges) I get 512 updates per knob rotation. This will be multiplied up as I don't need to tune to the nearest Hertz, increments of 10hz will give me 5khz per knob rotation which should be slow enough for easy tuning, but would still require 100 knob rotations to get from one end of the band to the other (on 80 meters anyway).
The project has been side tracked several times (I have too many projects going nowhere at the same time it seems... (:-) ).
I'll post a link to my C code if anybody is interested.....
PS:
DIZ, hope you had a nice vacation (and you weren't gone due to an emergency)
update:
Added an enhancement for a dual speed dial. Crank it slowly (so 5 cycles or less occur between main loop polls) and it updates at 10hz per click.
Crank it at warp speed (so that more than 5 cycles occur between main loop polls) and it updates at 100hz per click (the first 5 clicks are ignored).
This gives about 5khz or 50khz per dial turn.
Last edited by wa2mze (2011-02-05 13:17:48)
Offline
Update two:
I've added a 16x2 LCD display and a 16 key keypad. The keypad and LCD share 7 interface lines to the microprocessor. The 4 data bits to the LCD are bidirectional used to read or write to the LCD and to read the row return data from the keypad. The 3 control bits to the LCD are always in the write direction and are used for r/w, r/s, and e (clk). Two of these (the r/w and r/s) lines drive a 74LS139 2 to 4 line decoder to generate the column enable lines to the keypad. Since the 74LS139 is not open collector a 1N914 diode is in series with each output to the keypad columns to protect against shorts if two keys are pressed at the same time. A 560 ohm resistor is in each row return line from the keypad so that pressing a key will not short out the LCD, this allows writing to the LCD while a key is pressed. The keypad software uses a state machine and is driven by an interrupt from timer 1 of the atmega running at a 100hz rate. Different key values are generated for a single press, a press and hold (key down for 1sec), and 'chords' of two keys pressed in the same column. For a 16 key (4x4) keypad this gives 16 + 16 + (6 * 4) or 56 different combinations Next I need to decide how I will implement the operational commands from the keypad and how to handle the display.
Offline
I wouldn't mind seeing that link to your code. After many years as a hard-core assembly only programmer, I've decided to break down and have another shot at C. I've been fooling with a little gcc C for the Butterfly but it's time to branch out and do something from scratch.
73-
Nick, WA5BDU
Offline
I'll have to zip up the files and post it to my website and then put a link back here.
Currently it's set up as an Eclipse project, but would be easy to create a project under AVR studio as well.
I haven't added any code to handle the keypad input yet as the project has taken a left turn recently. I'm looking at the Picastar transceiver using the traxavr code to control the DDS.
Last edited by wa2mze (2011-07-11 07:55:36)
Offline
Sorry this one got discontinued, but it has led me down the same road as wa2mze.
One can get AD9850 dev boards and ATmega88 (or whatever) dev boards off eBay
real cheap. I basically reproduced the same functionality. Initially in ASM (the
interface to the AD9850 is different, my encoder did not behave the same).
Currently learning to do it all in c. Lots less pain. My guess is probably takes '
twice the memory?
The "programmers" can also be had for a few $'s same way.
Dan
Offline