7. Electronics design | MyMiniBoard_X14¶
Use the test equipment in your lab to observe the operation of a microcontroller circuit board (in minimum, check operating voltage on the board with multimeter or voltmeter and use oscilloscope to check noise of operating voltage and interpret a data signal). Document your work (in a group or individually):
Group assignment page: here.
My individual part: I have documented it in the Probing a microcontroller section.
Redraw one of the echo hello-world boards or something equivalent, add (at least) a button and LED (with current-limiting resistor) or equivalent input and output, check the design rules, make it, test it:
MyMiniBoard_X14 is a simple and compact board that can be used to test the features of the ATtinyX14 microcontrollers with didactic practices using sensors and actuators.
MyMiniBoard_X14 uses all of the pins of the ATtinyX14 microcontroller:
Take in account that tags for FTDI connection refer to the incoming device.
- NC = No connection
- DP = Digital pin
- DAC = Digital-to-analog converter
- Microcontroller: ATtiny1614
- FTDI connection.
- I2C connection.
- UPDI connection + VCC + GND.
- 5 Input/Output pins + VCC + GND.
- Onboard Input: Button, using the internal pull-up resistors.
- Onboard Output: LED_Out.
- LED_On: is just a LED to indicate when it is connected.
1uF capacitor to filter the noise in VCC.
4.7kOhms resistors for I2C connection.
Resistor for LEDs, as is well known, should be calculated, but since it’s a learning practice, for prevention we are advised to used 499Ohms resistors.
The following table describes the relationship between the board pinout (including onboard LED and Button) described above and the microcontroller pin number, that will be used when coding:
|Board Pinout||Arduino p. pin||C programming pin|
Based on the ATtinyX14 pinout information.
For this practice I used the ATtiny1614 from the ATtinyX14 series, but since they have the same pinout, any of them can be used on this board.
|Flash (program memory)||2048 bytes||4096 bytes||8192 bytes||16384 bytes|
|Flash w/Optiboot||1536 bytes||3584 bytes||7680 bytes||15872 bytes|
|RAM||128 bytes||256 bytes||512 bytes||2048 bytes|
|EEPROM||64 bytes||128 bytes||128 bytes||256 bytes|
|Bootloader||Optiboot (optional, not recommended)||Optiboot (optional, not recommended)||Optiboot (optional)||Optiboot (optional)|
|GPIO Pins||12 (11 usable)||12 (11 usable)||12 (11 usable)||12 (11 usable)|
|ADC Channels||10 (9 usable)||10 (9 usable)||10 (9 usable)||10 (9 usable)|
|Timer Type B||1||1||1||2|
|Timer Type D||Yes||Yes||Yes||Yes|
|Interfaces||UART, SPI, I2C||UART, SPI, I2C||UART, SPI, I2C||UART, SPI, I2C|
|Clock options||Internal 20/16/10/8/5/4/1 MHz||Internal 20/16/10/8/5/4/1 MHz||Internal 20/16/10/8/5/4/1 MHz||Internal 20/16/10/8/5/4/1 MHz|
Material taken from SpenceKonde.
The software I used for it was KiCad.
Requirements, considerations and component selection:
I used the ATtiny1614 microcontroller cause it has the a fair amount of pins for testing different features, input and output devices for developing more specific boards for specific applications.
UPDI connection for programming.
FTDI connection for serial communication.
1uF capacitor for voltage stabilization.
A LED to indicate when it’s connected.
Vcc, GND and Input/Output pins.
Built-in button and LED for basic programming tests.
3D view of the board
I just found interesting the fact that we can also have a 3D version of the board.
I manufactured the board by milling.
- Milling machine: MonoFab SRM-20
- Tool: V-bit 0.2-0.5mm
SMD = 1206
|1||LED Yellow (LED_Out)|
|1||LED Green (LED_On)|
|18||Single row right-angle male pin header|
It’s recommended to use an USB extension or hub for connecting to the PC.
For the first time we need to add the MegaTinyCore to the Arduino IDE:
- Open the Arduino IDE.
- File > Preferences
- Paste the following link in Additional Boards Manager URLs: http://drazzy.com/package_drazzy.com_index.json
- Press OK
- Tools > Board > Boards Manager
- Search for MegaTinyCore (by Spence Konde):
The latest version when I made it was the 2.2.9, which I had some issues with (very long installation time and then no compiling); version 2.2.8 presented no problems at all. Take in account that the only test I made was the Blinking with the onboard LED.
I tested it with a basic Blinking LED:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Upload a Code¶
To upload a code to the Board, we just need to use the following highlighted settings in the Arduino IDE:
After selecting these options and when testing the board by the first time, press Burn Bootloader to setup the Microcontroller; then you can just press the Upload button:
Probing a microcontroller¶
I have used the Hello boards that I have manufactured during the Electronics production:
Checking operating voltage with a multimeter:
Checking noise of operating voltage with an oscilloscope:
For this task I wanted to see the difference that a capacitor makes in the noise of the operating voltage, then I have made a first test with with the 1uF capacitor, I removed the capacitor and made the second test:
Test with capacitor:
Test without capacitor:
Even with the capacitor there is noise, but the peaks are less pronounced in comparison.
Interpreting a data signal:
For this task I have used a “Fading code”, based on a Fading example code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
- The code fades out from max to min, then fades out from max to min a LED.
- The LED on this board is on a digital pin, so I cannot show that effect on the LED.
- I have edited the code adding a second pin as output, then now I apply the fading effect to one digital and one PWM pin to see what happens.
- I connected Channel A to the PWM pin, and the Channel B to the digital pin:
I have set a different magnitude in the Vertical axis for the channels so I can clearly see both of the signals.
- This is what happens if we try to apply PWM to a pin that is not made for it. It will only offer High and Low output signals.
- If a LED was connected to pin 0 (the yellow signal in the oscilloscope), it would lower and raise its light intensity.
- If a LED was connected to pin 3 (the green signal in the oscilloscope), it would just turn on and off.
Assignment outlook and details¶
I have worked a bit with Eagle before, but this was my first experience with KiCad, I learned the basics of how to work with it during a lecture with my instructors.
I haven’t add details of “how I did it” throughout the documentation cause I like how it looks like this, just a page that explains the features of it, and offers the necessary to replicate it (and of course, proof that it works 😅).
A mental note I got from this experience for future boards was… use wider clearances or you will have issues when soldering and will probably have short circuits. Despite it didn’t result as clean as I would have liked… I’m proud of my board 😄.
The most common commands when making the schematic are:
Place symbol to select a component:
Place wire to connect the components:
Place global label indicate connection between components when using only Wire could result in a confusing result:
After the layout it’s necessary to specify the footprint for each component:
When making the layout, we start arranging the components.
The two commands I use the most when making the Layout are:
Route track to determine the physical connections of the components:
Add filled zones to fill the parts in blank as GND: