We have not implemented RC calibration byte read on handheld programmer as it is difficult to do it on a standalone unit. The number of calibration bytes varies from 0 to 4 depending on the AVR microcontroller being used, and they can be stored anywhere in flash or EEPROM at the user’s choice. This makes it tricky to implement.
The STK500 is reading the calibration byte from the device signature row (-O0 parameter) then storing it at EEPROM location 0 (-Se0), and presumably your firmware reads it from EEPROM location 0 and writes it to OSCCAL register.
This RC calibration byte is set in the AVR signature row during device testing, but there does not seem to be much variation in the value between different devices, that is 1 ATmega644P will have almost the same value as another ATmega644P. So, unless you need to be very accurate, you could just store a typical value in the EEPROM file
1) Run STK500 with this parameter
2) Read the AVR EEPROM and save to file
3) Load handheld programmer with this EEPROM file or add the value in location 0 to your existing EEPROM file if you have one
This will not be quite as accurate as using the -O, read calibration byte instruction but will be fairly close
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.
Microcontrollers, training, electronics and coding