Hi,
In a project I currently achieve, I found a problem that may be code related.
I have a CAN enhanced module that read 4 TK sensors temperature and send them over the CAN bus. I also have USB connection to allow module configuration per serial commands (this can also be do using specifics CAN frames).
Problem :
- If I have the USB cable attached to a computer, the module won't operate. There is no COM port for teensy in the windows hardware screen. No CAN frame is send
- If I have the USB cable attached to a computer, the module won't operate. Then if I press the program button windows detect the Teensy and program it. At the next boot the module operate as normal (COM is available and CAN frames are send)
- If the cable is unplugged on boot sequence, the module operate. CAN frames are send as normal operation. If I then plug the USB cable in my computer, a COM port is created for teensy and I can access it.
My guess :
The way I initiate Serial COM fail if the teensy is plugged at boot sequence ?
Here is the setup code :
Then in Loop I have :
Does anyone can tell me if I have do something the wrong way ?
Thank,
Manu
In a project I currently achieve, I found a problem that may be code related.
I have a CAN enhanced module that read 4 TK sensors temperature and send them over the CAN bus. I also have USB connection to allow module configuration per serial commands (this can also be do using specifics CAN frames).
Problem :
- If I have the USB cable attached to a computer, the module won't operate. There is no COM port for teensy in the windows hardware screen. No CAN frame is send
- If I have the USB cable attached to a computer, the module won't operate. Then if I press the program button windows detect the Teensy and program it. At the next boot the module operate as normal (COM is available and CAN frames are send)
- If the cable is unplugged on boot sequence, the module operate. CAN frames are send as normal operation. If I then plug the USB cable in my computer, a COM port is created for teensy and I can access it.
My guess :
The way I initiate Serial COM fail if the teensy is plugged at boot sequence ?
Here is the setup code :
Code:
void setup() {
Serial.begin (115200);
Serial.setTimeout(100);
// Do the other setup tasks
}
Then in Loop I have :
Code:
void loop() {
if (Serial.available()) // Mode configuration.
{
confFromSerialWithCRC();
}
// Do the other loop tasks
}
Does anyone can tell me if I have do something the wrong way ?
Thank,
Manu