ATmega168 and win forms app USB communication problem

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dear users of AVRfreaks forum i have a question regarding a project which i was hope some of you might answer.

I have a problem with getting windows forms app communicating with arduino duemillanove with ATmega168. Basically project is about win app sending pwm values and arduino responding with pulse counter states(the controlled object is a robot arm). I've fixed the arduino to work as i want to and i've tested it with bray's terminal.

When i switched to windows forms app sometimes it worked sometimes it didn't. After observing it for a while it came to me that terminal resets my chip when it connects to the board and my win app doesn't. so my question is: How can i get Windows forms app to reset the chip just as terminal does.

Thank you a lot.

"If what you have done yesterday still looks big to you, you haven't done much today. - Mikhail Gorbachev"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The default action for opening any COM port is to assert the DTR line. Most AVR apps ignore all the RS232 housekeeping lines.
The Arduino uses the DTR to momentarily reset the board. You can change this behaviour by breaking a solder link on the pcb.

The DTR line stays put throughout any session, so I would not expect any extra reset pulses unless you close and re-open the COM port.

I have no idea what 'windows forms app' does.

I doubt that you actually want your running Arduino application to be reset unless you want the application to re-start.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've found the DTRenable property and now everything works just as it was intended. Thank you a lot.

Ivan.

"If what you have done yesterday still looks big to you, you haven't done much today. - Mikhail Gorbachev"