Joined: 28 Jun 2005 Posts: 200 Location: Ashburton / Mid Canterbury / New Zealand
Posted: Fri Jul 31, 2015 11:40 am Post subject: Adruino Resetting with incomming serial data
Hi all
I've got a Arduino mega project hooked up to a PC for sensor data logging. The comms is USB to the micro USB port on the arduino. I have got MS Access to send an sensor ID via the usb comms. The Arduino reads this ID and reads the sensor and transmits the data back. Works well
I have noticed something weird. When the ID request is transmitted to the Arduino for the first time only ,the Arduino resets. Then it runs up fully. This is not a big issue I'm just wondering why and should it.
Here is the code snippet that reads the comms
Code:
Serial_flag =Ischarwaiting()'Listen to the Uart rs232 port for data to turn up
If Serial_flag =1Then'We got something in the Uart
Rx_data =0
Rx_data =Waitkey()'Get it
Filter_command 'Call the sub that fiilters the ID and reads the sensor
Locate1 , 1 LcdSpace(16) Locate1 , 1 Lcd Rx_data ;": "; Sensor_value ' Display it on the LCD before it is sent out. Used for data checking
Print Sensor_value 'Send the data back to access
Tx_data =0 End If
The whole project works well but just trips up for a few cycles at the start
Joined: 22 Apr 2009 Posts: 17 Location: USA, San Diego
Posted: Mon Aug 03, 2015 2:29 pm Post subject:
I had to cut the reset line that was connected on the ftdi chip. Works fine now and if I need to program it again, I manually press the reset button on the arduino as soon I click to program it.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum