Skip to content
Snippets Groups Projects
Commit b3a08b79 authored by Mitalee Parikh's avatar Mitalee Parikh
Browse files

em pro

parent 06855e76
No related branches found
No related tags found
No related merge requests found
Pipeline #252726 passed
......@@ -2,15 +2,59 @@
---
This week is about learning how to design a PCB.
Contents
---
1. Using test equipment
2. Redraw a hello board
3.
#### Testing
I will do this part when I have access to the lab.
Using the test equipment in the lab to observe the operation of a microcontroller circuit board
1. Operating voltage on the board with *multimeter*
Using the test equipment in the lab to observe the operation of a microcontroller circuit board.
I used my hello board for this task. This tutorial on [How to use a multimeter](https://learn.sparkfun.com/tutorials/how-to-use-a-multimeter/all) is a good resource.
A multimeter is a handy piece of equipment used for measuring voltage, current, resistance and continuity.
1. Operating voltage, resistance and continuity on the board with *multimeter*
To measure Voltage:
Plug the black and the red probe into corresponding ports (depending on the model of multimeter).
Set the knob of multimeter to *V*.
Touch the black probe to the GND pin and the red probe to the VCC pin of the board.
The screen will display the voltage across GND and VCC.
![](./images/ed/voltage.jpg)
To measure Resistance:
Set the knob of multimeter to *R* or Ohm symbol. Use *range* button to select M ohm, Kilo Ohm or Ohm.
Touch the black and red probes to the two ends of any resistor on the board or the corresponding traces.
![](./images/ed/resistance.jpg)
To measure Current:
Current measurement for electronic circuit board is not very common, especially for surface mount circuit boards. To measure current, the flow of current must be physically interrupted and the multimeter must be connected in-line. This can be done by adding a jumper bridge in the design of the board.
Then by connecting the two probes of the multimeter in-line to the two jumper pads on the *mA* setting.
To check Continuity:
Continuity testing measures the resistance between two points. If the resistance is very low, there is a beep which means the two points are in continuity. If resistance is high, the circuit is open, and the multimeter won't beep.
This is the most useful to check connections and solder joints between microcontroller pins and header pins to connect inputs or outputs.
Set the multimeter to 'Continuity' - a diode symbol with propagation waves around it.
Touch the two probes on the two points to be checked and beep will give the feedback.
2. Use *oscilloscope* to check noise of operating voltage
![](./images/ed/machine.jpg)
This tutorial on [How to use a oscilloscope](https://learn.sparkfun.com/tutorials/how-to-use-an-oscilloscope/all) is helpful.
![](./images/ed/osc.jpg)
3. Interpret a data signal using a *logic analyser*
[Introduction](https://www.baldengineer.com/logic-analyzer-tutorial-introduction.html)
If this equipment is not available, another way to test microcontroller circuit boards is by making a simulation in web-apps like [TinkerCAD](https://www.tinkercad.com/) or the open-source Arduino simulator, [Wokwi](https://wokwi.com/).
#### Designing
I chose a hello.echo board based on ATtiny44 as it has the most available documentation.
......@@ -35,7 +79,7 @@ Added components:
1x switch
1x 1kΩ Resistor
[Data sheet for ATtiny44](http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7701_Automotive-Microcontrollers-ATtiny24-44-84_Datasheet.pdf)
[Data sheet for ATtiny44](http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7701_Automotive-Microcontrollers-ATtiny24-44-84_Datasheet.pdf) - You can find an explanation in the [Embedded Programming week](./Embedded Programming.md).
Pinout for Attiny44
......
#Embedded Programming
#Embedded Programming
---
This week is about learning how to program a microcontroller.
......@@ -9,27 +10,93 @@ This week is about learning how to program a microcontroller.
4. Programming with ftdi
5. References
6. Code files
---
1. Understanding a Datasheet
---
For Electronics Design, I modified the hello.ftdi.44 board by adding a pushbutton and an led. This board uses the Attiny44A, so I chose the same datasheet to understand it better.
The datasheet is available on the Atmel site. The document contains the main features of the MCU, the pinout diagram, architecture overview, register summary, assembly instruction set and packaging information, and describes the microcontroller features in detail.
[ATtiny44A datasheet](https://ww1.microchip.com/downloads/en/DeviceDoc/ATtiny24A-44A-84A-DataSheet-DS40002269A.pdf)
![features](./images/empro/features.jpg)
This main features page gives a lot of information about the microcontroller. It comes in 3 versions - the ATtiny24A, ATtiny44A and ATtiny84A. They all have the same architecture and feature set, but different amounts of flash memory.
You wan write/erase it 10,000 times.
After programming it can retain the data for 20 years at 85 degC and 100 years at 25 degC.
It has two PWM channels - it can be used to make analog signals into digital.
It also lists the peripherals, such as timer/counters, ADCs, analog comparators and serial interfaces.
The IC is available in different packaging- ranging from 14-pin SOIC or PDIP to 20-pin VQFN.
There are 12 programmable I/O lines on the MCU and it can operate with supply voltages from 1.8 - 5.5V, with operation at higher frequencies requiring higher supply voltages.
In all, it allows for optimisation of power consumption versus processing speed.
![pinout](./images/empro/pinout.jpg)
The most useful is the pinout of the MCU. Depending on the packaging, it helps design a PCB. It is important to note that all pins have multiple characteristics, so depending on the project, one can chose which pins to use for particular tasks.
The default pins are *VCC* (supply voltage) and *GND* (ground).
*Port B (PB3:PB0)* - is a 4-bit bi-directional I/O port with internal pull-up resistors.
PB3 has the RESET capability
*Port A (PA7:PA0)* - A is a 8-bit bi-directional I/O port with internal pull-up resistors. Port A has alternate functions as analog inputs for the ADC, analog comparator, timer/counter, SPI and pin change interrupt.
The first three chapters - pin configurations, overview and general information, cover most of the information in brief. The erst of the chapters talks in detail about CPU core, memories, clock system, power management, system control, interrupts, I/O ports, timer/counter with PWM, universal serial interface for communication, analog comparator, analog to digital converter and other peripheral information.
2. Comparing the performance and development workflows for different microcontroller families
---
Next task is to program the board you have made to do something, with as many different programming languages and programming environments as possible.
3. Programming with FabISP + Arduino IDE
---
For this task I will use my hello-board I made in Electronics Design week with an added led and pushbutton and program it using the FabISP I made in Electronics Production week in the Arduino IDE. I connect the hello board to the FabISP using a ribbon cable in the correct orientation. And the plug in the FabISP into a USB hub connected to my computer running a MacOS Big Sur.
![setup](./images/empro/setup.jpg)
To check if the FabISP is connected properly, check that the computer recognises it when you plug it in.
Apple drop-down > About this mac > System Report > Hardware > USB, it should show a USBtinySPI like in the picture.
![usb check](./images/empro/usb-check.jpg)
Second task, to check that the hello board is recognised, open Terminal and type in
`avrdude -c usbtiny -p t44`
It will initialize the AVR device, check fuses, and show the device signature address. This address is used for I2C or tother communication.
![avrdude](./images/empro/avrdude.jpg)
In the Arduino IDE software, the first task is to add in the URL for the ATtiny support in the "Additional Boards Manager URLs" in File > Preferences, then go to "Boards Manager...", look for the URL for ATtiny and install it. This will add the attiny familt to the drop-down for boards.
![board](./images/empro/board.jpg)
Next select the processor:
![processor](./images/empro/processor.jpg)
Then select either the internal 1MHz or internal 8MHz clock, according to what we found earlier by reading the datasheet.
![clock](./images/empro/clock.jpg)
Next select the Port, this is the computer port to which the ISP is plugged in.
![port](./images/empro/port.jpg)
Selct programmer as USBtinyISP, because the FabISP is going to program the hello board.
![programmer](./images/empro/programmer.jpg)
Now, write a code or open one from the Examples, define pins. Compile and upload using the programmer. If you change the clock, burn bootloader first.
![program](./images/empro/program.jpg)
I wrote a simple program to operate the led using the pushbutton.
![led-button](./images/empro/led-button.gif)
4. Programming with ftdi
4. Programming with avr-gcc
---
5. Programming with Atmel Studio
---
5. References
5. References
---
6. Code files
---
[Code (sketch) for programming with FabISP + Arduino IDE](docs/images/empro/led-button-44.zip)
[Code for...]
docs/images/ed/machine.jpg

39.1 KiB

docs/images/ed/osc.jpg

73.7 KiB

docs/images/ed/resistance.jpg

35.5 KiB

docs/images/ed/voltage.jpg

26.9 KiB

docs/images/empro/features.jpg

42.9 KiB

docs/images/empro/pinout.jpg

16.2 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment