Search This Blog

Radio Guy Tees

Radio Guy Tees
Radio Guy T-Shirts
Showing posts with label HD44780. Show all posts
Showing posts with label HD44780. Show all posts

Friday, 21 December 2012

DDSing once more

Well,

I've been out of the country for a while; been working in the US of A. Great place, visited Chicago, Pittsburgh and Houston this trip - got myself some great boots!

Today I have broken up for Christmas and am looking forward to some good time at home with family, friends and, of course, my hobbies!

I've been fiddling today with the DDS signal generator I made here:

http://g0mgx.blogspot.co.uk/2012/02/dds-running-well.html

And would like to improve the design a little. It would be good to follow the DDS with a broadband RF amplifier, perhaps the one I used here would be a good starting point:

http://g0mgx.blogspot.co.uk/2012/06/its-been-ages.html

Who knows? I would also like to add a stepped output attenuator that's controlled by software and also feedback the RF output to one of the Analogue inputs of the Arduino so I can have a dbM display on the LCD, much like the separate meter I made recently:

http://g0mgx.blogspot.co.uk/2012/11/calibration-complete.html

So, my starting point was to replicate the existing project and then add the AD8307 logarithmic amplifier circuitry:


So here we are again, another project is born.

I'll keep you posted, fun though, egh?

Wednesday, 31 October 2012

Feel the Power!

Well,

Since the progress I discussed last time:

http://g0mgx.blogspot.co.uk/2012/10/its-becoming-real-power-struggle.html

with this power meter project; I've had (yet another) build of the directional coupler:


This time its been constructed from double sided PCB material and uses FT-82-67 toriods.

Connecting the forward and reflected ports to my 'scope (terminated with 50R) with a RF generator (this one is made my Kenwood) connected to the transmitter port and a dummy load connected to the antenna port, here's what I found on the 'scope (I've got the setup wrong and the blue reflected port reading on the 'scope needs to be divided by 10):



I then connected the coupler to the ports on the power meter and also included a 30dB attenuator. The attenuator was constructed using this site here as a Pi attenuator:

http://www.microwaves101.com/encyclopedia/calcattenuator.cfm

The setup for the next phase looks very much like this:

 
So, once this was put together, I then constructed an excel table with frequency across the top and the AtoD down the side, this table looks like this for the forward port of the coupler:


So, once I had these values I can the look into the equation that will take me from the A-to-D reading back to power - this is basically what the power meter needs to do - here's the equation:


So solving this equation as a pair of simultaneous equations - in fact a pair or more of simultaneous equations - I see this:

and this:


so basically I get different constants depending on what lines of the table I use as the input to my simultaneous equations.

However, despite the different constants, if I then use the equation and the constants to re-generate my powers from the ADC values the curve seems to be a very good fit. Here is the original readings plus the two equation outputs plotted:


So, all in all, I'm rather confused about the whole thing! But whatever the confusion, the device certainly seems to be very frequency stable i.e. very little variation in AtoD values as frequency increases. It's all good.

The software I have for this meter contains a huge set of lookup tables for the AtoD reading to power conversion; clearly these all need to change!

Cat's not helped much:



 All good though egh? I'd love to know what you think.

Sunday, 28 October 2012

It's Becoming a Real Power Struggle

Well, blimey!

How hard can it be to get a piece of PIC assembler software to display some characters on an LCD display? The answer seems to be very.

I've started putting my power meter together, it's the one I started here:

http://g0mgx.blogspot.co.uk/2012/10/a-bit-of-power-struggle.html

Well, eventually I managed to assemble all the parts and put the boards into an enclosure I have here:


I've actually made quite a good job of the metalwork so far, I've intentionally not cut the hole for the display as I don't yet know which one of the many I have here I would end up using. Here's the view of the front panel as-is now, the meter looks OK but isn't the large meter I found, as that's just too big for the case!


So, PIC programmed, LCD display wired in, power on - nothing. Just some very faint black squares on the display that I can make more evident or go away using the on-board contrast control.

So, still not knowing if the software is intended to interface to an HD4470 compatible or not, the question was what to try next?

I ended up cutting the software back to just the display routines and simply programming the PIC with the code to display just a few characters on the LCD. Result - nothing.

So, next I added a simple loop at the end of the LCD routine calls to turn on and off one of the digital output ports every second. I attached a suitable LED to the port and tried again - as expected the LED started to flash. This told me a few things:

  • My PIC programming was working and my software was making it into the chip;
  • The software was reaching my loop for LED flashing so it wasn't getting stuck anywhere;
  • The routines for the LCD weren't working.
Now, you may (or may not) recall I did quite a bit of fiddling with LCD displays and Pinguino and more recently Arduino back here:

http://g0mgx.blogspot.co.uk/2012/02/four-isnt-quite-same-as-2.html

So from that messing about I had a reasonably good idea how the initialisation of these LCDs should look, and the code I was staring at didn't quite look the same. So I changed the sequence of numbers sent to the LCD to initialise it, re-programmed the PIC and tried again. Nothing.

Hmm, next I looked at the delays in the software between writing the Enable line on the LCD high and then low again - you kind of have to do an "open sesame" on the LCD every time you send it either data or a command and the delays in the assembly software I was looking at used the processor "nop" instruction. This is really a null operand and hence takes one (I think) clock tick to execute. I changed this to be a 1ms delay and.... Bingo! We have characters on the display:


So, my next puzzle was the fact that I could display the characters 0-9 OK, but any attempt at alpha characters resulted in, what looked very much like, Japanese characters appearing on the display. After much cursing, general muttering and many re-programming of the PIC to try different things, I found a short between two of the address lines on the board. Doh! It took me over 6 hours to find that as I was only looking in software....

So it does seem that I am moving in the correct direction. I have also found that the Assembly code I downloaded from the QST in-depth website for this project, doesn't assemble on my version of MPLAB. I've had to change a few things:

  • declared names are clearly case sensitive in my assembler and not used in that way in the code - many capitalisation changed;
  • literal values used with the "loadw" command - the decimal declarations used generated value too big warnings, all I have done is declare the values as the hex equivalent and prefixed with "0x" - I don't understand why this is different, but it assembles;
  • The declared names in the .inc file for the processor are also case sensitive so again, a number of changes needed there.
I then incorporated my changes to the display routines into the downloaded software and now I am seeing what I expected to see on the display.....

It's time to test the unit, I'll let you know how I get on. I suspect I need to re-make the directional coupler (again) as I posted a photo on the eHam.net homebrew forum and asked for some advice, here's a very polite post telling me what a pile of junk I have made:

eHam comments

Hard work, frustrating but all good though, egh?

 

Monday, 27 February 2012

It's Even in a Box Now!

Following on from my previous post; I've been busy boxing my DDS.


I bought a case from my local Maplin, it's the same case as my digital modes interface is boxed in from here:

http://g0mgx.blogspot.com/2011/10/how-come-its-siuch-damn-mess-again.html

I'm totally useless at cutting metal, so a plastic enclosure is the only real option if I want to do this myself, here is the front panel (with the display upside down) taking shape:


And placed into the outer frame:


Some clothes pegs hold it all together whilst the glue sets:



And here it is, finished:



Not bad, egh?

Sunday, 26 February 2012

DDS Running Well

Following on from my previous post I've been playing with the software for the DDS experiments I've been doing. The software is written in C and compiled in the Pinguino IDE and runs on the 4550 Pinguino board I made previously:

http://g0mgx.blogspot.com/2012/01/penguin-you-mean-penguino.html

Ed, EI9GQ, has been inspirational with this and other experiments of mine; his DDS VFO information can be found here:

http://homepage.eircom.net/~ei9gq/dds.html

I've posted a video on You Tube of the results of this recent experimentation here:


If anyone is interested, the source code for this DDS is here:

UPDATE 16/6/2012: I've re-written the code in Arduino (http://g0mgx.blogspot.co.uk/2012/06/its-been-ages.html):

http://www.qsl.net/g0mgx/files/G0MGX_DDS.ino

Fun, egh?

Saturday, 11 February 2012

Four isn't quite the same as Two!

Firstly I have to report that my work is once again getting very badly in the way of my play time; there's not so much I can do about that if I want to continue to get paid. Therefore I shrug my solders and simply get on with it. Looks like I'm off to Abu Dhabi next weekend with my employer - I tend to travel a lot, but the United Arab Emirates for one day of work, even to me seems rather nuts.

So, in my last post I said that I wanted to use a 4-character display module for my latest DDS experiments; well this has kept me foxed for some time. It got so bad that I actually had to download the manufacturers data sheet and read it! Now that really is desperate!

I've got the display working now, it looks rather nice, but as usual is close to impossible to photograph:

But as you can see; I have successfully written to all four lines of the display. As it transpires this LCD module requires exactly the same initialisation as a 2 line module; the trick is in finding the address of the start of each line. They actually wrap so that line 1 feeds onto line 3 and line 2 and 4 proved just impossible to find!

I ended up with commands in hex of 80, C0, 94 and D4 for the start of lines 1, 2, 3 and 4 respectively. All of the code I'm developing to talk to this display is still using the Pinguino board and IDE I made back here:

http://g0mgx.blogspot.com/2012/01/penguin-you-mean-penguino.html

I'm still waiting for my Hong-Kong sourced AD8951 DDS chip, so the actual DDS experiments themselves will have to wait. At least I have some confidence that I can write to my display module of choice!

Cat's not been helping much as usual:





Good though, egh?

Sunday, 15 January 2012

So, how's the penguin?

I've been fiddling with my Pinguino board a little after the build I reported last time. I have, in fact, created a second board - this one will end up as my first Pinguino project. I would like to make a DDS signal generator, but this one needs to include a sweep function so I can more accurately measure crystal filters.

Here's the new board, you'll see that I have interfaced an LCD display, a keypad and if you look carefully you will see there is a rotary encoder there also:

The display has a really neat blue backlight, but is almost impossible to photograph:
I actually want to use a four line LCD display that I have here, I think the software needed to drive the four line display will be the same, I just wanted to start with something I am more familiar with. I am a great believer in build a bit - test a bit.

The keypad will be used for frequency entry, and I have that working OK - I wrote a test program to simply display the keypad entry on the LCD and that's working fine. The shaft encoder will be used to change the frequency steps by utilising the push click switch that's built into it and the rotary part will be tuning when in signal generation mode.

So far so good, but the DDS module I have here I used before:

http://g0mgx.blogspot.com/2011/08/dds-this-and-dds-that.html


This uses a AD9850 DDS chip, and at the time I was interested in the later AD9851 DDS but I couldn't find a way to buy the chip in anything other than the basic SMT package itself. A quick look on eBay suggests that you can now get development boards quite cheaply for this IC now so I have ordered one. It includes 6x clock multiplier on board so it should be easier to get extreme accuracy without spending a fortune on an accurate high stability high frequency clock module.

So, now I wait for a parcel from Hong Kong - why there aren't any in the UK I have no idea.

Time will tell, fun though, egh?