Difference between revisions of "OpenPLC-with-LDmicro/C2/Programming-OpenPLC/English"
Nancyvarkey (Talk | contribs) |
|||
Line 80: | Line 80: | ||
Recall that we have explained these connections in the earlier tutorials. | Recall that we have explained these connections in the earlier tutorials. | ||
− | Turn | + | Turn '''ON''' the '''power supply'''. |
Make sure that one of the '''LEDs''' on '''USBasp''' is glowing. | Make sure that one of the '''LEDs''' on '''USBasp''' is glowing. | ||
Line 87: | Line 87: | ||
|- | |- | ||
− | | style="border:1pt solid #000000;padding:0.176cm;"| | + | | style="border:1pt solid #000000;padding:0.176cm;"| Press '''CTRL+ALT+T''' keys |
| style="border:1pt solid #000000;padding:0.176cm;"| Open the '''terminal''' by pressing '''CTRL+ALT+T''' keys simultaneously. | | style="border:1pt solid #000000;padding:0.176cm;"| Open the '''terminal''' by pressing '''CTRL+ALT+T''' keys simultaneously. | ||
Latest revision as of 14:33, 1 July 2021
|
|
Slide 1:
Welcome Slide |
Welcome to the spoken tutorial on Programming OpenPLC. |
Slide 2:
Learning Objectives
|
In this tutorial, we will learn how to program the OpenPLC Mainboard |
Slide 3:
System Requirements
|
To record this tutorial I am using:
|
Slide 4:
Pre-requisites
|
To follow this tutorial, you should know
|
Now, we’ll see how to upload a program to OpenPLC Mainboard. | |
Slide 5: Code file - sample.hex
|
We will use the sample.hex file which was created earlier.
|
Slide6:
USBasp-programmer.jpg |
We are using a USBasp, to program our Mainboard. |
Slide 7:
Mainboard-computer-connection.jpg |
Make the connections as shown in the picture.
Connect SMPS and USBasp to the Mainboard as shown here. Recall that we have explained these connections in the earlier tutorials. Turn ON the power supply. Make sure that one of the LEDs on USBasp is glowing. This indicates that the programmer is connected properly. |
Press CTRL+ALT+T keys | Open the terminal by pressing CTRL+ALT+T keys simultaneously.
If you’re a Windows user open command prompt. |
Type cd Desktop/LDmicro
Press ENTER |
Type cd Desktop/LDmicro and press Enter.
I have saved a file sample.hex in the above folder. Go to the location where you’ve saved the hex file. |
Type,
avrdude -c usbasp -p m16 -U flash:w:sample.hex |
Now type the command as shown.
For uploading the program we are using a command line tool, AVRDUDE |
Highlight according to narration | hyphen c indicates the programmer id of the programmer.
Since we are using an USBasp programmer, here the id is given as usbasp. |
Highlight according to narration | hyphen p indicates the part number of the microcontroller that we are using.
In our case it is ATMEGA16. So we have specified it as m16. |
Highlight according to narration | hyphen capital U handles all memory read and write operations. |
Type flash | flash indicates the flash memory and w indicates the write operations. |
Highlight according to narration | sample.hex is the file that we want to upload. |
Press ENTER | Press ENTER. |
Highlight red light | We can see another LED on the USBasp is blinking.
This indicates that it is communicating with the Mainboard appropriately. |
Highlight avrdude: 364 bytes of flash verified | In the terminal, we get avrdude: 364 bytes of flash verified |
Highlight the output | Note that the number of bytes varies from program to program. |
If you don’t get either of the indications, it means that programming isn’t done properly. | |
Slide 8:
Additional Reading Material |
Refer to the Additional reading material of this tutorial to know more about:
|
Let us see various part numbers for different controllers & programmers. | |
Slide 9: Controller’s part number list
List of part number for Controllers and Programmers is given in the below link: https://www.nongnu.org/avrdude/user-manual/avrdude_4.html#Option-Descriptions
|
Go to the given link. |
Highlight m16
Highlight usbasp |
In this tutorial, we have used ATmega16.
We can observe that the part id is m16 according to the list. The part id of USBasp programmer as ‘usbasp’. You can refer to this manual, if you are using a different microcontroller or programmer. It also contains the information of the command line options to control AVRDUDE’s behavior. |
This brings us to the end of this tutorial.
Let us summarize. | |
Slide 10:
Summary We have learnt how to
|
In this tutorial, we learnt to program the OpenPLC Mainboard |
Slide 12:
About Spoken Tutorial project |
The video at the following link summarises the Spoken Tutorial project.
Please download and watch it. |
Slide 13:
Spoken Tutorial workshops |
The Spoken Tutorial Project team:
For more details, please write to us. |
Slide 14:
Forum for specific questions: |
|
Slide 15:
Forum for specific questions: |
|
Slide 16:
Acknowledgement |
Spoken Tutorial project is funded by MHRD, Government of India. |
Slide 17:
Thank you slide |
This tutorial has been contributed by FOSSEE and Spoken Tutorial Project, IIT Bombay.
And this is Harsha Priyanka from FOSSEE team, signing off. Thanks for watching. |