Pages: [1]   Go Down
Author Topic: Micro not sending serial data  (Read 361 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I created a sketch and a VB project with a uno board.  The uno reads an analog sensor then sends that data to vb to display in a progress bar.  It has been working great.  Then I wanted to get the micro.  So I wired it up the same, uploaded the same sketch (changed board type), and now it won't work with my vb program. 

What I have noticed is, if I open the serial monitor in the Arudino ide I see the incoming serial data, and the tx light is on on the micro.  When I open my vb program the rx light blinks when the program opens the port, but does nothing else (no tx light). If I close the vb program, the rx light blinks again. 

Am I doing something wrong?  I know the drivers are installed correctly.  If they weren't I wouldn't be able to see the incoming data in serial monitor, right?

Thanks, Victor.
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 63
Posts: 6049
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Try telling the board to wait until serial is ready.

After the serial.being, add:    while (!Serial);

This should only be used for the Leonardo and Micro.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It still does not work.  I did see that in the documentation.  Just to make sure I have it correct, here is the setup:


Code:
void setup()
{
  //initialize pins
  Serial.begin(9600);
  while (!Serial);
}
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 63
Posts: 6049
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Did you change the serial port referenced in your VB code?
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Offline Offline
Full Member
***
Karma: 9
Posts: 109
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I think the vb program does not set the (virtual) DTR signal for the serial port.
Try setting the port's DtrEnable property to True.
Logged

Pages: [1]   Go Up
Jump to: