Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Debugging apps that use TX/RX pins (Read 4140 times)
Bob Jones
Full Member
***
Offline


Posts: 210
Location: Bellingham, WA
Joined: Dec 4th, 2015
Debugging apps that use TX/RX pins
Feb 24th, 2018 at 6:09pm
Print Post  
I want to use an Android app to control my robot car. There are many apps to choose from, but all use the TX/RX pins to communicate. I want to display the input from the Android on the Serial port, but this requires using two different Serial ports: one for the Android communication and a different port to display the dialog. How do I configure Visual Micro to accomplish this?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Debugging apps that use TX/RX pins
Reply #1 - Feb 24th, 2018 at 10:21pm
Print Post  
Hi

Are you using debugging or just wanting to use the serial monitor from your code?
  
Back to top
IP Logged
 
Bob Jones
Full Member
***
Offline


Posts: 210
Location: Bellingham, WA
Joined: Dec 4th, 2015
Re: Debugging apps that use TX/RX pins
Reply #2 - Feb 24th, 2018 at 10:33pm
Print Post  
Tim,

I am using debugging AND I use the Serial.print command to display what is happening inside my code.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Debugging apps that use TX/RX pins
Reply #3 - Feb 24th, 2018 at 10:51pm
Print Post  
If you take a look at the main doc index you will see "Debugging with different Ports, Pins and Speed you will see how the debugger can be configured to use Software Serial.

http://www.visualmicro.com/page/User-Guide.aspx?doc=index



  
Back to top
IP Logged
 
Bob Jones
Full Member
***
Offline


Posts: 210
Location: Bellingham, WA
Joined: Dec 4th, 2015
Re: Debugging apps that use TX/RX pins
Reply #4 - Feb 26th, 2018 at 6:04am
Print Post  
Tim,

Using SoftwareSerial, I got my Android phone to talk with the robot and have the diagnostic messages show up on a serial output window. 
I have the HC-05 module connected to pins 10 and 11. 

All serial ports in VM are pointing to a single COM port. This works just fine until I unplug the USB connection. At that point, any command I send from the terminal emulator on my phone causes the robot code to reboot. 

I can start the motors from my phone, but if I disconnect the USB, the motors stop too, even though they have their own 9V battery supply.

Since the robot is not connected to my PC, any output it generates is lost, so I don't know exactly what is happening. 

Any suggestions?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Debugging apps that use TX/RX pins
Reply #5 - Feb 26th, 2018 at 1:26pm
Print Post  
I'm not clear about the setup. 

1) Your phone is usb host to software serial 
and 
2) You have separate blue tooth unrelated to 1)?




  
Back to top
IP Logged
 
Bob Jones
Full Member
***
Offline


Posts: 210
Location: Bellingham, WA
Joined: Dec 4th, 2015
Re: Debugging apps that use TX/RX pins
Reply #6 - Feb 27th, 2018 at 5:29pm
Print Post  
Tim,

I am using software serial to communicate with the HC-05 over D2 and D3. I use Serial.print to display diagnostic output. I have added a command to my code that turns off all serial output on the hunch that the act of writing to serial output when the USB connection to my PC is disconnected, that may cause the fault. It appears, however that that did not fix the problem. 

So my question now has two parts:
1) How can I capture what is causing the fault when the robot is disconnected from the USB link?
2) When the USB is disconnected, what changes internally?

Thanks for your support.

Bob
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Debugging apps that use TX/RX pins
Reply #7 - Feb 27th, 2018 at 8:29pm
Print Post  
All hardware is different. It's down to the board to handle it.

Never heard of this happening before.
« Last Edit: Feb 27th, 2018 at 8:30pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint