I am working on a project that uses a standalone Atmega 328-PU and HC05 Bluetooth module to drive an LED light strip. I am looking for a way to program the Atmega without removing it from the circuit board, and have had success in doing so via serial communication....but...
To increase performance, I have switched the bluetooth communication to use hardware serial (was using software serial before). Based on my understanding, this eliminates the options of programming the chip via serial or using bluetooth wireless as is demonstrated in this link.
The only viable option I see is to move back to using software serial or use Arduino as ISP.
More background information:
I moved away from using SoftwareSerial because it seemed to be less performant and was dropping bytes. Being somewhat of a novice at this, I saw dramatic (0% loss) using hardware serial, and haven't gone back to test with higher timeouts or adjusted baud rate (was using 38400 for starters).
The holy grail for me would be to be able to program the Atmega using the same hardware serial (connected to bluetooth) that is used to control the LED lights, but that seems to be just out of reach for now.
ISP and USB are problems when trying to push firmware updates to places where the desktop/laptop is not. For me, the holy grail is to be able to connect to a Linux SBC (Raspberry Pi) using Wi-Fi (e.g. SSH) and then build/compile my AVR firmware with the SBC and upload the firmware to a selected AVR on a multidrop wired serial interface. At 5$ the SBC is costing less than my AVR, but I still need the AVR to do some stuff (e.g. ADC, capture hardware...) that the Pi does not.
@Coding Badly, ISP is an option, and probably the last one given the configuration. The only downside to this is that it uses two additional jumpers beyond serial programming using the hardware USART. It does not allow for live debugging via a programming machine (my laptop), but I can do that via bluetooth and a connected device.
@ron_sutherland, I can bring the target device to a computer and program it, but have read of successes that folks have had with programming an Arduino via bluetooth, and went down that path until I realized the hardware serial could not be shared.
dmjlambert:
Shared with what? What does the HC-05 pair with when controlling the light strip?
Currently, an Android device pairs with the HC-05, and I'm working on a custom Android application to provide an interface for controlling the light strip intuitively. Since the bluetooth module is using the hardware serials pins on the Atmega, would it still be possible to program the Atmega using bluetooth?
I may be mistaken in assuming that there is anything being "shared", but am referring to being unable to upload a sketch using the hardware serial ports. I'll post a picture of the setup below, which was working to upload the sketch before moving the bluetooth the hardware serial ports. As it is, I'll probably end up moving to Arduino as ISP, which appears to only introduce one additional jumper, but cannot debug over conventional serial with Arduino IDE.