• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Arduino startup issues

Status
Not open for further replies.

dr pepper

Well-Known Member
Most Helpful Member
For me this should be simple.
I have an arduino, it just receives serial data and display it on an lcd.
The serial stream on the i/p is continuous, and is present before power on.
At power on the code just hangs, however if I press reset after power on the code runs and the display works just fine.
So I guess the 'duino doesnt like data on the serial port at power on, maybe its going into programming mode or something.
I tried flushing the serial buffer after boot, nut nada, I also tried a delay before initing the serial port nothing there either.
I didnt think there was a difference between power on reset and the reset button.
Any ideas how I can fix this?, I spose a reed relay or switching tranny might do the trick but I'd rather do something a little more elegant in code.
 

ericgibbs

Well-Known Member
Most Helpful Member
hi,
I have a Ard UNO running with a HC12 RXR, incoming serial data rate of 2secs, of 50 ASCII chrs, it is restarting OK at power boot.

The other system is a Ard NANO which receives HC12 data, which can get corrupted which causes it to hang, so I have programmed a 12F683 to give a NANO Reset after 60secs, work OK.

When I am reprogramming the Arduino's I have a simple slide switch in the incoming RX line, else I get Arduino warnings during compile/load.
E
 

ronsimpson

Well-Known Member
Most Helpful Member
It could be the LCD has not had time to get up and going. Trying to write to the LCD too soon might hand the program.
 

dr pepper

Well-Known Member
Most Helpful Member
The code doesnt 'listen' to the lcd, the read/write is permanently tied low, however I did wonder if the 'duino was running & display wasnt, but theres no data transfer according to my logic probe.

I managed to get the thing to 'work' kinda, I put a tranny which with no i/p pulls the serial pin high, theres a resistor in series with the incoming data, when the 'duino has booted it turns the tranny off with a spare i/o pin, it works but its a bodge, and I still dont know why.
 

alec_t

Well-Known Member
Most Helpful Member
Dunno about the 'duino, but many ICs do strange things if they have signals on their data pins but no valid power supply. The protection diodes on the data pins allow current to flow into the IC.
 

dr pepper

Well-Known Member
Most Helpful Member
Yes I dont spose the processor would like being powered up & down 9600 times a second.
 

KeepItSimpleStupid

Well-Known Member
Most Helpful Member
In some cases, you can actually power the chip through the I/O pins. You really shouldn't have data present on power up without protection.
Effectively Vcc=0 and say your input is 5 V. There is a current limit for each pin. So, series resistors or level translators are required.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top