NomakeWan: his board lacks an ICP header, not that it's needed...
Once again (the dad in me wants to add: "for the umpteenth time"), make sure the DTR line between the usb / bluetooth adapter and the controller board is disconnected when you're doing this. If not the bootloader programming delay could be invoked and that takes about 2 seconds. The only time the DTR line should be connected is for uploading to the flash. Put a switch between the controller board and the uart adapter or something.
Edit: If I owned an airplane, and had a nickel for every time I've uploaded a new flash image, forgotten to disconnect the DTR pin and then cranked the engine over with a serial logger pulsing the DTR line only to have it flood because of the programming delay, I could kill you all by raining bags upon bags of nickels down on you. But I wouldn't do that, because I like you. :-D
Also, don't try spamming the uart with requests while powering on - I've never tested this but it might potentially cause problems.
This is an approximation because I don't really want to take the time to build a proper and accurate timing mechanism, but from power on to the end of the setup routine takes less than 8 ms for me. At that point you're in the main loop. If you want to see it visually, at the very end of the setup() routine put a line like:
Code:
Serial.println(F("ready"));
Open a serial monitor program (i.e. [ctrl]+[shift]+[m] from the Arduino IDE) and then apply power to the board. If you can perceive a time delay with your senses alone (no instrumentation) you'd better lay off the caffeine / amphetamines / cocaine.
Bookmarks