Xtal frequency for standalone programmer board question

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This kit from Ebay just landed. It includes a 16MHz Xtal, but the Atmega328 chips I want to programme are to go in a device (QRP Labs U3S transmitter) that uses a 20MHz xtal. Does it matter if the off board programmer I have uses a 16MHz one? Thanks.

 

https://www.ebay.co.uk/itm/ATMeg...

 

The device the processor is to go in is here:

 

https://www.qrp-labs.com/ultimat...

Best regards, Chris Wilson

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have U3S QRSS xmitter operation on 10m as we speak.  The programmer you have should work fine, but requires you to remove the M328 to do the programming and replacing.

Requiring a disassembly of the unit from the case and removal of the display board to access the M328. 

The U3S has isp programming holes so it can be programmed while in the board using a more common USBASP programmer, and no disassemble johnny 5!

 

Jim

 

 

edit: just noticed that is an adapter for a programmer, not a programmer itself!

 

Last Edited: Mon. Jan 15, 2018 - 04:37 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Jim. I normally programme my own from the serial port socket on the back, but I have had a few requests to do chips from blanks for people, and I didn't want to be disassembling my U3S to do them, so I bought the socket board thingamajig. Many thanks for the info, I'll just use the supplied 16MHz crystal then, cheers. Chris Wilson 2E0ILY usually to be found on LF 136 KHz :) I like 10 meters, when it's open!

Best regards, Chris Wilson

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, that makes sense, program the flash/eeprom and verify all is good, then program the fuse settings last.

 

Jim

 

Last Edited: Mon. Jan 15, 2018 - 05:14 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is that `cos it's a 16MHz clock on this board? Or something else Jim? Thanks.

Best regards, Chris Wilson

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A common problem we see here is someone will program the fuses of their chip to use an external clock or external xtal (easy to mix those two up) and brick their chip.

Since your adapter has an external xtal, and the target also has an external xtal, you should be fine, I just like to verify the flash memory before changing clock fuses, a two step process.  The xtal frequency will not matter for programming, it will find the correct xtal when placed in the kit.

 

Jim

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Does it matter if the off board programmer I have uses a 16MHz one?

 

Just to add to what Jim said:

 

The programmer board is its own, stand-alone, microcontroller project.

What is important is that it can connect to the PC and then program the target micro.

It can operate at any clock speed it was programmed to use.

It might run at 20 MHz, 16 MHz, 10 MHz,  3.579545 MHz, or anything else the project designer elected to use.

The requirements are that the programmer's clock is fast enough to run the code, and allow for accurate comm's with the PC, (baud rate error, etc.).

If one uses a very fast micro, then the actual code might only use a small part of the processing power available.

If one is using a relatively slow clock frequency, then the micro might be about max'd out, trying to do everything it can in the time available to perform given tasks.

Bottom line, as a stand alone programmer, you don't need to know, or care about, it's internal workings, (including its clock frequency).

You just need to know that it works.

 

For the target micro being programmed, the system designer has to determine what the micro's clock source will be.

For the software to run correctly the software has to match the hardware.

If the software thinks that the system will run at 2 MHz, and the hardware is actually running at 20 MHz, then a simple flash the LED at 1 Hz program will appear to be running 10 times too fast.

 

If the Ham Tx board was designed for a 16 MHz clock, then it needs the 16 MHz Xtal to run correctly.

 

Part II of this is that the micro can use a number of different clock sources, (and sometimes a divide by 8 option, as well).

The AVR's "Fuses", (actually programmable registers), tell the micro, amongst other thinks, how to configure its multiple clock options.

As the factory new micro chip will be configured to run on the internal RC oscillator, part of programming the chip is to set its Fuses to reconfigure it to use the externally connected Xtal.

 

One has to both load the "program" AND properly configuring the "Fuses" in order to have a working system.

 

Good luck with your project,

 

JC

KD8HKD

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the further info DocJC, much appreciated!

Best regards, Chris Wilson