Difference between revisions of "Programming Power Fail Logger with Arduino IDE"
Line 1: | Line 1: | ||
'''Flash the Microcontroller''' with '''Power-Fail-Logger''' Program | '''Flash the Microcontroller''' with '''Power-Fail-Logger''' Program | ||
− | |||
− | |||
'''Test the connectivity from the programmer to the Power Fail Logger board''' | '''Test the connectivity from the programmer to the Power Fail Logger board''' | ||
+ | Using '''AVRDUDE''' validate the '''USBTiny''' is communicating with the '''Power Fail''' Module Microcontroller | ||
Connect the '''USBTinyISP''' to the '''AVR-ISP-6 pin header J7''' on the '''Power Fail Logger PCB''' . | Connect the '''USBTinyISP''' to the '''AVR-ISP-6 pin header J7''' on the '''Power Fail Logger PCB''' . | ||
− | + | On laptop using Windows CMD terminal type the following. Make sure you are in the AVRDude directory. | |
− | On laptop using Windows CMD type the following. Make sure you are in the AVRDude directory. | ||
'''avrdude -c usbtiny -p m328p -v''' | '''avrdude -c usbtiny -p m328p -v''' | ||
Line 12: | Line 10: | ||
==[[ AVRDUDE Class]]== | ==[[ AVRDUDE Class]]== | ||
'''Connect Serial Port to the RS232 Port''' | '''Connect Serial Port to the RS232 Port''' | ||
− | + | Plug into your laptop USB port the '''Prolific USB-to-Serial Comm Port''' | |
− | Connect the '''TX''', '''RX''', and '''Ground''' Pins to '''J4 | + | Connect the '''Prolific USB-to-Serial Comm Port''' to the '''RS232 Port''' on the Power Fail Board |
+ | Connect the '''TX''', '''RX''', and '''Ground''' Pins to '''J4'''. | ||
Prolific J4 Power Logger | Prolific J4 Power Logger | ||
TX - RX | TX - RX | ||
RX - TX | RX - TX | ||
GND - GND | GND - GND | ||
− | Use Windows '''Device Manager''' to validate which Comm Port is used. | + | Use Windows '''Device Manager''' to validate which Comm Port is used. You will need this later. |
− | '''Set up | + | '''Set up the Arduino IDE ''' |
Connect the '''USBTinyISP''' to the '''AVR-ISP-6 pin header J7''' on the '''Power Fail Logger PCB'''. | Connect the '''USBTinyISP''' to the '''AVR-ISP-6 pin header J7''' on the '''Power Fail Logger PCB'''. | ||
In the Arduino IDE click on '''Tools''' Tab - Select '''Programmer''' then select '''USBTinyISP'''.<br> | In the Arduino IDE click on '''Tools''' Tab - Select '''Programmer''' then select '''USBTinyISP'''.<br> | ||
− | |||
− | |||
In the Arduino IDE click on '''Tools''' Tab - Select '''Port''' then select the '''Prolific Port''' (Example Comm6).<br> | In the Arduino IDE click on '''Tools''' Tab - Select '''Port''' then select the '''Prolific Port''' (Example Comm6).<br> | ||
Select correct target board | Select correct target board |
Revision as of 22:38, 25 May 2021
Flash the Microcontroller with Power-Fail-Logger Program
Test the connectivity from the programmer to the Power Fail Logger board
Using AVRDUDE validate the USBTiny is communicating with the Power Fail Module Microcontroller Connect the USBTinyISP to the AVR-ISP-6 pin header J7 on the Power Fail Logger PCB . On laptop using Windows CMD terminal type the following. Make sure you are in the AVRDude directory. avrdude -c usbtiny -p m328p -v For more information about using AVRDude refer back to this link ==AVRDUDE Class==
Connect Serial Port to the RS232 Port
Plug into your laptop USB port the Prolific USB-to-Serial Comm Port Connect the Prolific USB-to-Serial Comm Port to the RS232 Port on the Power Fail Board Connect the TX, RX, and Ground Pins to J4. Prolific J4 Power Logger TX - RX RX - TX GND - GND Use Windows Device Manager to validate which Comm Port is used. You will need this later.
Set up the Arduino IDE
Connect the USBTinyISP to the AVR-ISP-6 pin header J7 on the Power Fail Logger PCB. In the Arduino IDE click on Tools Tab - Select Programmer then select USBTinyISP.
In the Arduino IDE click on Tools Tab - Select Port then select the Prolific Port (Example Comm6).
Select correct target board In the Arduino IDE click on Tools Tab - Select Board then select the Arduino Uno.
Flash the Microcontroller with Power-Fail-Logger Program
Paste the above program Power-Fail-Logger Program.ino into the Arduino IDE. In the Arduino IDE click on Sketch Tab - Select Upload Using Programmer
Validate the Power-Fail-Logger Program is running
After program has uploaded Validate In the Arduino IDE click on Tools Tab - Select Serial Monitor
Once the program has finished loading hit the Reset button on the Power Fail Logger Board. You should see the correct time and date display in the Serial Monitor.
Next Step Set up the SD Card reader