¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Software Upgrades


Arv Evans
 

¿ªÔÆÌåÓý

Jim, and others...

I'll start this to answer your question and maybe others can build on top of it to make an ARDUINO AND AVR ROGRAMMING FOR? HAM RADIO DUMMIES document.??

1)? A raw Atmel AVR Microcontroller is programmed using a .hex file (actually binary code stored as hexadecimal words).? This code is entered to the AVR using 4 pins:

RST=Reset pin, but held low in? programming mode to allow data writing to internal memory.

CLK=clock pin to move individual bits into internal memory.? Each clock cycle moves one data bit into the AVR.

MISO=data bits to be written into the AVR memory.

MOSI=data bits being read out of the AVR internal memory.? This is used to verify data that has been written into the AVR.

There are a several different programming dongles available from various vendors that are used to interface the 4 programming pins on an AVR Microcontroller chip.??

When writing code to an AVR there are "FUSE Bits" that control whether others can or cannot read-out the stored code.? In the devices by QRPLabs these bits are set to protect the code and thus prevent others from stealing the code and duplicating the systems by writing Hans' proprietary code to virgin AVR chips.

============

Code for an AVR can be written in Assembler, or any of several compiler languages.? C++ is a popular language for programming AVR chips.? If using a compiler you need to store the .hex output from a compile.? This is what you will write to your AVR memory.

A relatively common program called "AVRDude" is popular for writing .hex data into an AVR memory.

========

In an ARDUINO module the process outlined above has already been used to write something called a "BOOTLOADER" into protected memory on the AVR (or other) processor chip.? Purpose of the boot loader is to simplify the procedure used to install programs into your ARDUINO module.??

The boot loader senses when the RST lead is held low to indicate programming data entry is imminent.? At that time the boot loader reads program data (.hex format) input via the built-in serial port connection.? Program verification can be accomplished by reading data out of the processor memory via the same serial port.

It is possible to use a level-converter (5V ttl-to-RS232 voltages) and send code to/from an ARDUINO serial port using the serial port on your computer, but in today's world not all computors have serial ports.? For this reason it has become common to use a USB-to-Serial dongle to install programs into your ARDUINO.

The popular AVRDude program can be configured to write your new programs to the serial port.? This code is stored as hexadecimal files containing the binary representation of your program.??

=========

You can use assembler language, or a compiled language to write code for your ARDUINO.? Most beginners start with the "ARDUINO IDE" as their first entry into ARDUINO programming.? This system uses C++ language and compiles to the .hex format needed to program your ADUINO.


=============
When you operate the Reset pin on an AVR or ARDUINO the processor starts executing code at address zero.? Astute readers may have already realized that program entry by both RST-SCK-MISO-MOSI or via a Boot loader both install .hex file data in the same place in memory.? This makes it possible to use the C++ compiler IDE to make .hex files that can be installed into a bare AVR processor as well as into an ARDUINO module.??

OKAY..this has been a long edit using my cell phone's tiny keyboard.? There may be typos, errors, etc. that will need correction.? But this a start.....please feel free to add to this DUMMIES INTRODUCTION TO AVR AND ARDUINO PROGRAMMING for QRPLabs and BITX systems.

Arv? K7HKL
_-_




Sent from my Verizon, Samsung Galaxy smartphone

-------- Original message --------
From: Jim Sr Sturges <jwsturges@...>
Date: 10/23/17 1:32 PM (GMT-07:00)
Subject: Re: [QRPLabs] Software Upgrades

Hans, would you pls provide a link to the guide you mentioned for using Arduino to program?

Cheers es 73,

Jim N3SZ

On Mon, Oct 23, 2017 at 3:21 PM Hans Summers <hans.summers@...> wrote:
Hi Lee

It is nothing like the BITX20. With the BITX20 you have to install the Arduino environment. The project is open source and there are tons of different versions of it, so you have to figure out which version you want to install. And which hardware changes you need to make to the BITX40, to be able to run it with that firmware version. Then you have to deal with the fact that it needs some libraries too. And the libraries may not be versions which work with the version of the Arduino sketch, that you want to use... or that don't work with that version of Arduino, that you installed... the Arduino upload will compile the files and maybe you have to fix errors... etc etc. There are many opportunities for headaches, if you are newcomer to all that stuff.?

The QCX has just a single compiled .hex file. It's much more simple.?

I hope someone will write the step by step guide. Include a definition of what item to buy off eBay etc. That would be useful. We already have a guide to using the Arduino as the programmer, which is very nice. But it would be nice to have one too, for one of the $3 AVR programmers from eBay.?

73 Hans G0UPL

On Mon, Oct 23, 2017 at 9:36 PM, Leland L. Bahr <l@...> wrote:

I've been trying to read all this software upgrade stuff on the BITX20 reflector from members there, and I must tell you, trying to understand what they are saying is a nightmare for me.? All I see there is members having grief and interface problems trying to upgrade software.? Seems like almost everyone there has a different set of problems.? Some are hardware issues with the particular programmers being used.? Then I saw something on Hans web site about pin converters.? Going from more pins to less pins using an adapter.? After a few minutes of trying to understand what is going on gets me to want to go to my local pub!
Lee, w0vt





--
Jim Sturges, N3SZ
Amateur Radio operators do it with frequency.

Join [email protected] to automatically receive all group messages.