the led at D13, is flashing twice and than hold a little longer and repeat this over and over (only when usb-powered), so i was thinking where this behaviour comes from since im absolutly sure the scetch i uploaded worked just fine before shutdown
but now every startup my led on board keeps flashing, i've been thinking this causes unwanted delays in my RF-program
so, what is this sort of strange behaviour?
thanks,
Since you mentioned RF, one explanation could be that your circuit is drawing too much power and causing the USB supply to disconnect which then causes your Arduino to reset.
well, just an standard RF-module reciver with draws a maximum of 8mA and a max of 12v but i suply it with 5v so..
but anyway, i just unplugged everything from the arduino and reconnected the usb but still same result twice flashing and than holds for im geusing +/- 1sec
EDIT: when i open serial monitor it stops flashing and than prints twice "setup" on startup
this is my code (i only have 1 line in setup to print "setup)":
#include <VirtualWire.h>
void setup()
{
Serial.begin(9600);
Serial.println("setup");
vw_setup(24); // Bits per sec
vw_rx_start(); // Start the receiver PLL running
pinMode(13, OUTPUT);
}
void loop()
{
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;
if (vw_get_message(buf, &buflen)) // Non-blocking
{
int i;
// Message with a good checksum received, dump HEX
Serial.print("Got: ");
for (i = 0; i < buflen; i++)
{
Serial.print(buf[i], HEX);
Serial.print(" ");
digitalWrite(13, !digitalRead(13));
}
Serial.println("");
}
}
Okey, this is a mystery, it looks like arduino board keeps resetting until serial monitor recive data wich would just dissapear if serial monitor wouldnt be opened..
so is this for securety reason or am i using the usb power method at the wrong way?
*edit, same thing happens on my 9v external battery, is there someone out there wich know the awnser to this problem?
What is a "standard" RF-module? How about a link? How do you know it will work at 5v?
EDIT: when i open serial monitor it stops flashing and than prints twice "setup" on startup
Whenever the serial monitor connects or disconnects, the ATmega328 gets reset. When you upload code, the ATmega328 is reset to run the new code. Then you connect your serial monitor and it is reset again. It is very likely the "double" setups you are seeing is the first being stuck in the ATmega8u2 (or whatever serial-to-usb converter)'s buffer before the serial monitor opens.
Have you connected to the correct default pins for VirtualWire, since you aren't setting them in your code?
okey so those double setup prints are clear now, its a pretty good explation
and yes i have connected to the right default vw pins, those are transmitter D12, and reciver D11.
i'd like to add that my code and setups work just fine (except for the fact i only have 2m range on 0.1k bit/s. see: http://arduino.cc/forum/index.php/topic,102290.0.html)
when serial monitor conected to arduino the resetting stops and everything works like it should be, after that i can remove the usb cable and it still works fine until a power-off..
well, the problem lies before serial momnitor connects..
its is when my uno gets power from usb or external, then my program wich have been uploaded before doesn't execute. only the led at D13 blinks like as if it is resetting..
edit:
You described the behavior of what happens when the serial monitor connects.
is it normel behavior of arduino to hold the program back until serial monitor kicks in, even when powered through jackbarrel at 9v (without any usb suply)?
well, seems things get stranger and stranger, i've beentesting alot, and like i mentioned before i workin on rf projects, so i had orderd a saperate atmega328 a little while before.
but now it seems to be that the new 328 only works at the arduino on breadoard, when i put this new 328 chip into my arduino it is doing those flashing things..
but when i put back the old (original) 328 it doesn't do the stange thing and just runs the program uploaded in his memory.
i checked both chips but the resulst are that they are both atmega328p-pu Arduino uno bootloaded (the new chip came already bootloaded) so what is the difference between them?
is the new one bootloaded for the revision 3.0 arduino uno while the original is bootloaded for revision 2.0?
hai guys,
my adrino uno is working well but now there is a problem. When i power up my adrino uno the led 13 is not flashing but the power on light is ON and also i cannt upload new program to chip (which i brought new).
Please help me to solve this problem