9. Embedded programming¶
This is completely new for me. Like I said earlier, I have no idea what I made on the Electronics design week. I copied a schematic from a previous fab-graduate & did the design rules & routing on Eagle by Autodesk. This week I am supposed to programme the “light blinking board with a button” that I made on week 7.
I would like to thank my instructors who didn’t give up on me until the concepts were clear to me. I understood that
- VCC & GND are for power supply.
- If you keep the reset pin low for a full clock pulse length or more, the programme will be reset. Here reset means the programme stops & runs from start again (it does not mean the proggrame is wiped from the IC)
- Ports can be used as input or output.
- pull up & pull down resistors help the IC from misbehaving in an environment filled with outside EMF.
- Some ports are connected to analog to digital or vice-versae converters.
- Using an IDE/ C programming/ Hex codes or assembly language we can programme the board to make output when a certain input is received.
I started working with Arduino IDE since it was easier to understand.
Go to File > Preferences for adding our FabISP board to Arduino
Add the weblink from here for downloading the same
Checking whether the new board shows up in the menu
I learned the arduino IDE programming syntax from here
Code for Blink function
Error because of loose connections
Blinking after the connection was corrected
Code for Fading using Analog write
After the Arduino based programming was done, I tried programming directly in C using Atmel Studio. Since the IDE & Chip are coming from the same parent company. There was no hassle to work.
Programming on Atmel Studio using C
Code for blinking in C. Here almost all the students had a confusion on the usage of (1<<X) on the code where X can be any number within the bit length of that port. Our Instructers were really awesome in that they wrote down the bit by bit transformation happening in these lines on a white board and that really helped us a lot.
Blinking video after Programming in Atmel