Sunday, March 4, 2018
UART library for EFM8BB1 Busy Bee microcontrollers
This UART library is made for EFM8 microcontrollers. It uses circular buffers for transmission and reception of data. This way large amounts of data can be sent or received with only 5 or 10 bytes per buffer, thus saving memory.
Uses 8 data bits, 1 stop bit, no parity. Supported baud rates: 9600, 14400, 19200, 38400, 57600, 115200, 128000, 256000.
On EFM8BB10F8G-A device, the UART pins are on port 0 and pin 4 is TX and pin 5 is used for RX.
Saturday, March 3, 2018
Eagle CAD Quick Tip | How to remove unwanted copper pour
Friday, March 2, 2018
Cheap and powerful 50 cents microcontroller | EFM8 Family
Thursday, February 1, 2018
How to build your own USB to UART serial converter using FT232 with voltage level shifting
The board includes 500mA fuse protection, EMI filtering, power LED indicator, RX and TX LED indicators, and a voltage level shifter that makes it compatible with 3.3V and 5V boards. This way you don't need to check the jumper if it outputs 5 or 3.3V so you don't risk burning your microcontroller. It works with both voltages.
Update: 2024, March, 6: I made another serial adapter build around FT231 which require less components since it is 5V tolerant and is also cheaper. It is part of a development board: https://www.programming-electronics-diy.xyz/2023/06/breadboard-development-board-for-avr.html#USB_Interface.
Wednesday, January 24, 2018
EAGLE CAD Tips | How to Add Custom Image Logo to Your PCB
In this video I show as an example a USB to UART board. Eagle expects a Bitmap image with less than 256 color depth.The text image was made in Inkscape and since Inkscape can't export Bitmap (.bmp), I exported the image as PNG, then using IrfanView I lowered the color depth to 2 colors and saved as Bitmap.
Saturday, October 28, 2017
How to use A4988 stepper motor driver module tutorial
A4988 stepper motor driver module
This
driver can be used to easily control a bipolar stepper motor or a
uni-polar stepper connected in a bipolar mode. Can output up to 2A per
phase (with a heatsink) and works with motor voltages from 8 to 35
volts.
- Simple step and direction control interface
- Five different step resolutions: full-step, half-step, quarter-step, eighth-step, and sixteenth-step
- Adjustable current control lets you set the maximum current output with a potentiometer, which lets you use voltages above your stepper motor’s rated voltage to achieve higher step rates
- Intelligent chopping control that automatically selects the correct current decay mode (fast decay or slow decay)
- Over-temperature thermal shutdown, under-voltage lockout, and crossover-current protection
- Short-to-ground and shorted-load protection
Library for A4988 stepper motor driver using timer interrupt
Update 4, October, 2023: I have made a new library for controlling stepper motor drivers that supports multiple motors and has a better acceleration algorithm. It can also coordinate xyz steppers.
This library is designed for AVR ATmega328 microcontroller, but with few adjustments can work with any AVR microcontroller with at least 3-4 Kb of flash program memory.
At the moment only one motor is supported.
Features
- the interrupt can be triggered by Timer0 or Timer1
- automatic microstepping mode selection
- can work with constant and very low speeds
- accelerated speed mode, with separate acceleration and deceleration settings
- can work with only one pin of the microcontroller if the rest are hardwired
Characteristics:
Features
|
Program Memory
|
Data Memory (SRAM)
|
All enabled
|
3552 bytes
|
40 bytes
|
Acceleration, no microstepping
|
3088 bytes
|
40 bytes
|
Microstepping, no acceleration
|
2104 bytes
|
14 bytes
|
No microstepping, no acceleration
|
1724 bytes
|
12 bytes
|
Compiled using avr-gcc (WinAVR 20100110) 4.3.3 and -Os optimization level and MATH_LIB = -lm.
If MATH_LIB = -lm is commented out in Make file, the memory with all functions enabled is 6520 bytes program and 304 bytes data memory.So allways uncomment MATH_LIB = -lm.