Go Down

Topic: Micro not sending serial data (Read 424 times) previous topic - next topic

victorb17

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.

James C4S

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.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

victorb17

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: [Select]
void setup()
{
  //initialize pins
  Serial.begin(9600);
  while (!Serial);
}

James C4S

Did you change the serial port referenced in your VB code?
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

PeterVH

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.

Go Up