Embedded Systems Programming Course

So a week or so ago i was talking with a friend of mine, Simon about how he was wanting to get into embedded programming and what that would entail. He had come across a series of youtube videos that take the unenlightened of us and walk us through many examples of becoming proficient with toolchains that allow for programming ARM micro controllers.

Now, I can do quite a bit of superficial programming in C using the arduino, but it does hold your hand quite a lot and its great for simple things, but if you want to do anything serious you really have to man up and learn how to use IAR Workbench or some GNU C toolchain along with all the associated hassles that come with that.

For sometime I have been using STM32 and ESP8266 micros but wimping out and using arduino for programming those chips, but after seeing this course on how to do ARM programming using the right tools, I have decided that its time to give it a go and see if I can get my head around the whole idea. So i ordered the TI development board from Element 14 and it arrived today so now there are no excuses. Time to start learning ARM programming and perhaps soon i might be able to turn those new found skills into a DSP IF board for homebrewers. No promises, failure is always an option 🙂

And here is the link to the course ware for those who might be interested in all this as well and want to give it a crack. http://www.state-machine.com/quickstart/


TDA2822 Audio Amp

So I have had this pile of Ebay sitting on my desk for sometime and today I have gotten excited enough to actually start taking a look at it all and seeing how it works. I got these frequency generator chips for like a buck and after setting them up with the test circuit, i could not get them to work, it happens, now and again you get Ebay’d in the butt.

So I figured next i should test out the TDA2822 audio amps. I for 50 for 2 bucks which is a lifetimes supply. Do they work, well, yes they do and here are the results.

Here is the test circuit straight out of the PDF. As you can see parts count is low. So I put the IC on the breadboard and used just 1 1/2 for a mono amp. I also used just 2 caps, pin8 to ground, 470uf as it was already on the breadboard and the input cap on pin 1. Powered with 8v as its a handy voltage i have on my breadboard. 12v would probably be a better option to allow for a larger voltage swing.

As you can see, nothing fancy here, just the IC and 2 caps and my signal gen and oscilloscope probes doing there thing allowing the pixies to in and out and display them in the screen.

So we stick in 0.1v 600hz sinewave and see what happens.

Well, we actually hit the voltage rails and clip somewhat. 0.1v in almost 8v out, that is the voltage gain there. And when i do some da finger poken, the IC itself is cool to the touch, not warm, not hot, but about the same as ambient temperature of the room. So i am thinking Bye Bye LM386, and hello life time supply of TDA2822. And being a stereo IC, I can also bridge the left and right for even greater output. Not that I think i would need it.


8Mhz Signal From Arduino

So you might be thinking, Bullshit, you cannot get an 8mhz pwm signal out of an arduino. But you can. Ignoring the sine like shape of the waveform below for a minute, that is the actual PWM output from an arduino uno I was using to do this. So, why is it so.

Well, all you have to do is use some code wizardry using interrupts, timers and registers in such a way that the maximum pwm frequency you can get from most microcontrollers is 50% of the clock speed. Given that the arduino usually has a clock speed of 16mhz, this gives an actual maximum pwm out of 8mhz. And while this is nice, in practice it is not all that useful as the discrete numbers of frequencies that can be derived this way is not all that useful.

The code is below, I did not write this code and sorry to whomever did, I do not have a link back to it and your name was not included in the snippet, so i cannot credit you. Enjoy.





When The Image Matters

Sometimes you find out what you thought to knew about a subject is just utterly wrong. When it comes to image frequency for a long time I have believed that the Image_F = Desired_F + or – 2 * LO_F. Which is essentially true, the image can be plus or minus but I was ignoring one critical piece of information and that is the position of the Local Oscillator in respect to the desired frequency.

So there is only 1 image frequency, not 2, if the LO is below the Desired frequency then the image frequency is Image_F = Desired_F – 2 * LO_F and if the LO is above the Desired frequency then Image_F = Desired_F + 2 * LO_F. Which now means that using a 455Khz IF for AM Broadcast Receiver actually makes sense if using a high side LO to do the mixing in a superhet design.


2016 CQWW

Now only if i paid attention to my logging, I would have been number 1 in OC. I lost so many points by typos. Multipliers for Russia and Westurn Australia as an example were lost because my logging program put the contacts in the wrong zone. Oh well, i only do this for a bit of fun and not seriously. It was heaps of fun though doing this contest QRP.


Arduino Memory Keyer

Ok, so it looks like a mess on the breadboard, and you would be right, its a bloody mess and there is so much other left over other projects that it is almost impossible to tell where the crap ends and the keyer begins, but i can assure you, its there and it works. I used the morse library written by Erik Linder SM0RVV and Mark VandeWettering K6HX and fixed by Glen Popiel which can be gotten from his website here: With a minor change to the header file in the library to make 2 private methods public, we are now able to individually key dits and dahs at the correct speed without delay overheads.

Connecting the key to the arduino is as simple as using 2 10K resistors in series to 5v to pull things high. And when you key a dit or dah things get pulled low, we read that change on pins 10 and 11 and send the dit and dah accordingly. Very much how PA3CHM did it here: in his simple keyer.

And because the morse library takes care of timing and can send strings of morse characters, it was a rather prospect to add in a 4 button keypad, fiddle with the example code in arduino and get some memory functions happening. So i have 2 hard coded memory calls, which call cq for me. This could be expanded with a larger keypad but suits my needs. The other 2 buttons are used to set the cw keyer speed, incrementing or decrementing the speed 1 wpm at a time.

Now obviously there are some rather full blown arduino keyers out there that have all the bells and whistles you can imagine, and yes i could have used the code by K3NG here: but i chose to roll my own specifically to my own needs and ultimately this will embedded in the 3 band cw rig i have been working on for sometime. The good thing is I have this part working, its timing is fine and now I can move onto the transmitter part of the project.

The code is published below, I hope others find it useful, take it, modify, expand and customise to your own needs. Enjoy.