Upload Arduino sketch to Atmega328: Difference between revisions
(→-5-) |
|||
(7 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
This is a guide to upgrade a sketch on atmel atmega328 chip. | This is a guide to upgrade a sketch on atmel atmega328 chip. | ||
Involved product are RPICT8, RPICT7V1, RPCT4V3 | Involved product are RPICT8, RPICT7V1, RPCT4V3. | ||
=Preliminaries= | =Preliminaries= | ||
Line 21: | Line 21: | ||
==-1-== | ==-1-== | ||
Connect the Nanoprog to the circuit board to program using the 6 pin ribbon cable. | Connect the Nanoprog to the circuit board to program using the 6 pin ribbon cable. | ||
[[File:IMG_1148_small.png]] | [[File:IMG_1148_small.png | 300px]] | ||
==-2-== | ==-2-== | ||
Line 34: | Line 34: | ||
Then select '''Sketch''' | '''Upload Using Programmer'''. | Then select '''Sketch''' | '''Upload Using Programmer'''. | ||
Let the sketch being uploaded. Once the upload | Let the sketch being uploaded. Once the upload completed the eeprom will be erased. | ||
==-3-== | ==-3-== | ||
Line 48: | Line 48: | ||
Use the lcl-rpict-config.py tool to upload the new configuration. | Use the lcl-rpict-config.py tool to upload the new configuration. | ||
==-5-== | |||
Test the new sketch using the linux cat command. | |||
Stop all program using the serial port (emonhub, gateways etc...) | |||
Run these two commands below. The data will be displayed. Stop the cat command with a Ctrl ^C. | |||
stty -echo -F /dev/ttyAMA0 raw speed 38400 | |||
cat /dev/ttyAMA0 | |||
=FAQ= | |||
==Getting the uploaded sketch version in use== | |||
Run the cat command as explained above. | |||
Remove the board from Raspberripy and re-insert it again. The first line coming out of the cat command will show the current version. |
Latest revision as of 20:27, 26 September 2021
Overview
This is a guide to upgrade a sketch on atmel atmega328 chip.
Involved product are RPICT8, RPICT7V1, RPCT4V3.
Preliminaries
Required hardware is the Nanoprog.
The board hosting the Atmega328 chip will have an ISP connector (In System Programmer). This is a 6 pin connector as 3x2.
Required software is the Arduino IDE.
Download the desired sketch to upload. Each product page will have a link to the latest sketch.
Steps
-1-
Connect the Nanoprog to the circuit board to program using the 6 pin ribbon cable.
-2-
[OPTIONAL]
This might be optional if you are uploading to a minor version change (e.g. 2.5.4. to 2.5.5). For major version upgrade the eeprom will most certainly need to be erased before uploading.
Get the eeprom erase sketch. eeprom_erase_v1_0.ino
Open this sketch with the Arduino IDE.
Then select Sketch | Upload Using Programmer.
Let the sketch being uploaded. Once the upload completed the eeprom will be erased.
-3-
Open the new sketch to upload with the Arduino IDE. Then select Sketch | Upload Using Programmer.
-4-
Disconnect the circuit board from the Nanoprog. The configuration will be blank and need to be uploaded again.
Get the default configuration from the configuration guide. At time of writing the latest is this following page here. Over_Serial_Configuration_-_Sketch_2.8#Restore_Default_Config.
Use the lcl-rpict-config.py tool to upload the new configuration.
-5-
Test the new sketch using the linux cat command. Stop all program using the serial port (emonhub, gateways etc...)
Run these two commands below. The data will be displayed. Stop the cat command with a Ctrl ^C.
stty -echo -F /dev/ttyAMA0 raw speed 38400 cat /dev/ttyAMA0
FAQ
Getting the uploaded sketch version in use
Run the cat command as explained above. Remove the board from Raspberripy and re-insert it again. The first line coming out of the cat command will show the current version.