Attiny13 Software Uart Bascom
Next, connect the Serial cable to the breadboard. I use a 6-pin header on my board to make it easy to attach and detach the cable. With the cable attached, the ATtiny is now powered up and running. The next step is to monitor the serial output.
/* Software UART * * This feature provides a software implementation of a UART allowing you to * perform serial communications. It supports speeds of up to 250Kbps, can be * configured to use a single IO pin and has an option to be interrupt driven. /* Software UART * * This feature provides a software implementation of a UART allowing you to * perform serial communications. It supports speeds of up to 250Kbps, can be * configured to use a single IO pin and has an option to be interrupt driven.
Open the Arduino IDE, select the COM port of your cable and open the Serial Monitor. Note that the Programmer option in the IDE needs to be set to AVRISP mkil for this to work. If you are using a USBtinyISR to program your ATtiny85, just change it in the IDE when you have completed the programming step.
Well we know 'baby sitting' on servo is wasting time. Updating every ms, so is good to have separated board and microcontroller to controlling the servo.
Unfortunately, servo controller out there is just over kill, and pricey. So this is where the idea come from.
Using ATTiny13 or ATTiny 13A (anything that at least has min 1KB flash and 64 Bytes Internal SRAM will works ) This design using single layer PCB (bottom layer only) and the firmware only has 0,1 ms resolution. As i build this for proof of concept only, when i have time, i'll update the firmware and the PCB with double layer so i can put led for power indicator and RX indicator. The reason why i only using 0,1 ms is because the reliability for UART.
The UART is very poor, its about 70% hit rate. So for using this, make sure you send the command at least 3 times. Its because this board only using internal clock, and bitbanging UART, since ATTiny13 does not has hardware USART/UART.
The UART technique is developed by Eric Evenchick. And if you take a look of his you even can use Half-duplex software UART single pin operation for this module. The command for this module only using UART. You can connect the RX pin to your arduino or other microcontroller TX pin. It has 2 type of command.
The first one is single update servo command, and the second one is for updating all servo on the same time. If you playing with by Benjamin Gray you would using the second command for updating all the servo for pointing your MeArm to the point that you want instead of only one by one. Because the firmware is beta version, you have to trial n error to add some delay for each character, so the communication miss rate is decreased (especially for 2nd command for updating all the servos). This is the sample command communication for updating the servo: 1st type (single update servo command): sent_string( 'A10'); //sent servo A valuesent_string( '!'
); //sent command to move the servo _delay_ms( 200); //wait for servo movement using delay for reliable communication sample: sent_string( 'A');_delay_ms( 1); //give a breath for the bit bang UARTsent_string( '1');_delay_ms( 1); //give a breath for the bit bang UARTsent_string( '0');_delay_ms( 1); //give a breath for the bit bang UARTsent_string( '!' ); //sent command to move the servo_delay_ms( 200); //wait for servo movement another sample: //sent value for all servos and move the servos sent_string( 'A10B15C10D20!' ); /*from command above, if any miss communication of one or more servos value, the another value that received will be processed*/ 2nd type (updating all the servo) sent_string( 'A10B15C10D20*') //sent value for 5 servos and move the servos /*with asterisk '*' (star) command, if any missed value all servos will not executed*/ nb: • Because of hit rate UART less than 70% there is good for you to repeat the command 3-5 times. • With a proper delay for each character being sent, i found the hit rate is among 95%. • All files is in 'Build Instruction' section. • More discussions at.
Components • 1 × ATTiny13 / ATTiny13A / ATTiny25 / ATTiny45 / ATTiny85 ~ about $1 any microcontroller that above or equal ATTiny 13 will works • 1 × Board for ATTiny ~ less than $0.5 from break out board or bread board. Look at schematic bellow for wiring. And also the greber file if you want to making like my board • 1 × Male Header ~ less than $0.2 color full headers will be awsome!!
• 2 × 0805 SMD Capacitor ~ less than $0.1 get bigger value you can get • 2 × 1206 SMD Resistor 0Ω less than $0.1 if you using masking/silk screen you can short it with a big blop of tin or wire Project Logs • • at 08:47 •. Yup you are right about the price. At my first attempt learning to design the electronic hardware i have to calculate what really i need, FLASH, RAM, etc. Just like Dave (from EEVBlog said) real engineer does not stuck on one microcontroller, they can not be limited from the chips choices. BUT (just like you said) i forgot my high school economic class, that mass production can bring down the price. Now days ATTiny85 is way cheaper than ATTiny13.