I want to share how to program baby oranguntan 328P from Arduino IDE using the serial port.
1-Load this modified arduino bootloader macetech.com/Arduino_20MHz.zip (ATmegaBOOT_168_atmega328_20MHz.hex) into your baby orangutan using an avr programmer
Now you can upload your code using serial port (you can use usb2uart, bluetooth hc05/hc06, wifi esp8266, etc). You have to choose the “Pololu Orangutan or 3pi robot w/ ATmega328P (serial)” board and the serial port of your usb2uart device. After pressing upload sketch, you have to reset quickly the baby orangutan. I have recorded a video that shows it:
Watch it at full resolution and full desktop to see details. First I show you the baby orangutan connected by serial to a usb2uart module. Then I change the skecth pololu.com/docs/0J17/4 to modify the led blinking speed. I push the upload button and then I join RST pin to ground with a wire during a second.
The best is you can program your robot based on baby oranguntan without wires, so you dont have to go where it is, take it, plug the programmer and then put it again on the floor.
I have recorded a video where I reprogram remotely the behaviour of 4 leds. The orangutan’s serial port is attached to a hc-06 bluetooth module and the reset pin is connected to PD7. So when baby orangutan receives the bytes 0x30 0x20 from the serial port (stk500 protocol sync sequence), the program configures the PD7 pin as output and then sets it to low, making a reset and starting the arduino bootloader, who finally reprogram the baby orangutan with the new skecth.
Very good job Osropa! Very impressive but I cannot repeat what you did. Dispite 4d efforts…
I tried with both HC05 & HC06, none allows me to upload my sketch to my Pololu Baby Orangutan.
I’m able to program via USB/TTL serial & manual Hard reset thanks to ATmegaBOOT_168_atmega328_20MHz.hex.
I’m able to use Serial Monitor with both HC05 & HC06 Bluetooth .
But I cannot upload my sketch via BT !?! Always this “avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x2a”.
What BT module module did you use please? Are sure this is HC05 or HC06? I read that HC05 & HC06 cannot manage the HW reset (stk500 protocol sync sequence).
Is your sketch making a hard reset? When I receive by serial port the bytes 0x30 and 0x20, I send a low signal to pin 7 (PD7), as it is connected directly to reset pin, the baby orangutan reboots and the bootloader starts, waiting for the next sequence of 0x30 and 0x20 bytes to begin the programming.
Very strange. I tried with 2 different baby and 2 BT, hc05 & hc06. Of course, pd7 is directly connected to reset. I also tried to program pd6 to hard reset… Always the same result: BT Serial Monitor but no BT sketch upload.
From your video, I can see that your Hc05 is not as used to be. It is bigger with external led, capa… Any reference please?
Yes I did set 57600bds into HC05/06 with AT command and it is working fine with Serial Monitor 57600bds over Bluetooth with Serial.println(“Test1”) every 500ms.
Thanks to your JPEG, I can see only Tx, Rx, 5V, Gnd coming out of your HC05, exactly like me. However, Baby connections are not very clear.
From video, it sounds that you do not use PD0 & PD1 as I would expect but PD1 & PD7 for HC05 com. Right?
Does your HC05 powered by the same 5V supply than your baby?
Finally I have recorded the demo again in mac environment with same results:
I have used a hc-05 commercial bluetooth and there is no difference.
Beside the fuses question, did you program the sketch the first time using a usb2serial in baby orangutan? That is necessary because the sketch code looks for the 0x30 and 0x20 bytes and makes a reset if they are found. At the beginning there isn’t any sketch with the code to do the reset when the bytes are received.
Hope it helps you to achieve the remote baby orangutan programming.
Your schematic helps a lot but it still does not work but I’m not far to succeed.
“Pololu Orangutan or 3pi robot w/ ATmega328P (serial)” selected
Schematic just confirms what I’ve been doing: PD0 & PD1. No cabling mistake.
Boot ATmegaBOOT_168_atmega328_20MHz.hex is well loaded into Flash with AVRfuses.
Fuse are good but AVRfuses does not allow to set nor to show “lockout”.
Copy paste of your sketch and IDE programming “Upload using programmer” (USBtinyISP).
PD7 for hard reset.
LED’s PB0…4 are flashing as expected
Serial Monitor running fine at 57600bds via Bluetooth.
RESET to GND does reboot the Baby, as expected
BT programming:
System wide configuration file is "/Users/Love16/Desktop/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/Users/Love16/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/cu.KissOiler-DevB
Using Programmer : arduino
Overriding Baud Rate : 57600
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x2a
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x2a
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x2a
While trying to upload via HC05, I can see the HC05 well pairing. But PD7 does not generate the required HW reset for upload. Strange…
If it fails, try first to program the arduino skecth and then the bootloader, but uncheck the “Erase device before programming” before program the bootloader.
If you think than PD7 is not working, try to connect a button between reset pin and GND and when the arduino wants to program it, press the button like in this video: