How to get emonGLCD programmed?

Hi folks.

I have an emonTX and a emonTH running in the house connecting to the emonBase board on my RPi2.  That's all working great.

I also bought an emonGLCD at the same time as all the other bits, but only just got around to building the GLCD last week.  I have it all built, but when I got to the last part, I'm stuck.  "Program using arduino" is basically the last instruction.

No. Chuffing. Idea. :(


So, I have the Arduino IDE running on my Win10 PC, and I have the SolarPV sketch imported and compiling.  I have no idea, at all, how to get that flashed to the Atmel chip.

I have an AVR Dragon programmer which works (I've flashed bitcoin miners with it in the past), but again, no idea how to use it to flash the program.


So, could someone point me in the direction of detailed instructions on how to get this gadget working?  I am a total novice with these things, I can build electronics, but programming little chips has me stumped.


Robert Wall's picture

Re: How to get emonGLCD programmed?

I can only tell you about the "shop" programmer, and the instructions for that are in "Setting up th Arduino IDE":, and that takes the USB drivers and output and converts the FTDI interface on the GLCD board.

Are there no instructions included with your programmer on using it with the ATmel 328P? My guess is you need to program the 328P in your programmer (taking care not to overwrite the bootloader).

Unless somebody like dBC can help, I think the safe answer will be to get a programmer from the shop.

Bill Thomson's picture

Re: How to get emonGLCD programmed?

I have this programmer (although I didn't buy it from Amazon) and it works without any problems. It was a drop-in replacement for the programmer I purchased from the Shop. i.e. it worked "straight-out-of-the-box."

According to what I've read, (Arduino forum) almost any generic CP2102 serial to USB programmer will work.

dBC's picture

Re: How to get emonGLCD programmed?

I've not used a Dragon, but I suspect it's possible if you're really keen and don't mind a lot of fiddling. avrdude knows how to work with a Dragon which is the main requirement, but  I don't think you'll be able to do it from the Arduino IDE (hence the fiddliness). You'll need to find the .hex file that the IDE outputs.  On Linux this ends up in /tmp/buildxxxxx.tmp/sketchname.cpp.hex but I don't know where the Windows Arduino IDE puts it.

Then you'll need to connect the 6-pin ICSP header on your Dragon to the 6-pin ICSP header on your target.   According to the GLCD has an 8-pin header.  I'm not sure why those extra two IO pins are run to it, but the top 6 pins are compatible with a standard ICSP header.

Finally, you'll need to fire up avrdude, tell it you're using a dragon_isp programmer, tell it the partnumber of your AVR, point it at the hex file you found above, and tell it to write it to flash.   I've not used avrdude on Windows, but I think it's pretty much the same on all platforms.  There's a  tutorial on how to run avrdude on WIndows here:

Bill Thomson's picture

Re: How to get emonGLCD programmed?

hence the fiddliness

You weren't kiddin' there!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.