Teensy and Visual Studio

Status
Not open for further replies.
Hi!
So i'm working on a project that involves communicating a Teensy 3.2 with PC using USB.
On the PC side is a Visual Studio App that read the serial information via serialPort.isOpen() then serialPort.bytesToRead() and finally serialPort.readLine().
On the teensy side is just Serial.println().
But the thing is, i cant communicate between the two.
The app receives the first string, but it freezes after that.
Does anyone know anything that could influenciate in this communication?
Thank you!!
 
Does Teensy println show on SerMon as expected?

Does the Teensy keep running? Blinking LED or something showing it is running?
 
What is SerMon? Serial Monitor? Just when I don't use the Visual Studio. After I open the Serial connection in the VS it stops working even after closing the VS.
Sometimes yes, sometimes it justs freezes.
 
Generally assumed there is a working Arduino IDE install on poster's machine for Teensy Code review and a common base system. Is the Teensy sketch compiled for USB Type: Serial - or other?

In the IDE is a Serial Monitor or SerMon. If you have an alternate Serial Monitor that is good to see it work. If compiled as USB Serial only a single program can consume the that connection, the same connection has to drop to allow programming - either under software control or a Button push.

If opening Visual Studio breaks the connection - that that may be pointing toward the problem.
 
USB type: Serial
I just used the serial monitor the first time I compiled the code to see if it was working. But after that I tried only the VS by recompiling it or pushing the reset button, but it didn't work. The app got the first or two lines correct, but after that it froze. I tried the same code (same string sending by serial.print) with an arduíno nano and it ran smoothly.
 
Not sure how to read : 'just used the serial monitor the first time I compiled the code'

Does SerMon work if tried again? Teensy USB is unique - generally much better - though it may be sensing something odd as addressed from the PC code.
Did you confirm the Teensy is still running when the output froze?

Follow this link and install TyCommander as a trusted Serial Monitor. That post or the updated Post #1 will lead to released program. I get the ZIP and the unzip to a clean known directory and run TyCommander.exe from there. With the Teensy selected and the 'Serial' tab shown and the upper 'Serial <-\->' selected the Teensy output will appear in that window. If it cannot be selected then something has ownership of the USB port and needs to be released.
 
Not sure how to read : 'just used the serial monitor the first time I compiled the code'

Does SerMon work if tried again? Teensy USB is unique - generally much better - though it may be sensing something odd as addressed from the PC code.
Did you confirm the Teensy is still running when the output froze?

Follow this link and install TyCommander as a trusted Serial Monitor. That post or the updated Post #1 will lead to released program. I get the ZIP and the unzip to a clean known directory and run TyCommander.exe from there. With the Teensy selected and the 'Serial' tab shown and the upper 'Serial <-\->' selected the Teensy output will appear in that window. If it cannot be selected then something has ownership of the USB port and needs to be released.

I just tested the first time with the serial monitor to see if the code on teensy was transmitting the right information. Then I closed the Serial Monitor and rebooted the teensy. Even so, the program on VS would freeze almost instantly. But the same code on an arduíno nano would work perfectly. After I open the VS, even if I close it, the serial Monitor would only work if I rebooted the teensy again.
I think it keeps running, because I have an interrupt routine the blinks the led if the interruption occurs.
Okay! I will try that, thank you!
 
Status
Not open for further replies.
Back
Top