I am using a Teensy++ 2.0 for USB Raw HID communication. Nothing is connected to the Teensy, apart from the USB.
The packets I send are received incorrectly - the first byte is correct, then all the remaining 63 (or less, if configured, tested that too) are filled with the second byte.
For example, if I send "ABCDEF", the Teensy receives it as "ABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...". I've made sure that the issue is in the Teensy reading it, not echoing it but using the built in LED as some patience.
This occurs only on one of the Teensy++ 2.0s I have access to. It has become more of a curiosity now, as it seems to be a faulty board. I am looking for some confirmation and perhaps some insight into why this happens.
Here is the minimum code:
For sending the HID requests, I've used Node, and also Device Monitoring Studio. Same results for both of them, so the PC side is not at fault (and as mentioned before, only one teensy affected).
So it does seem to be faulty USB chip or something, buuuuuuuuuuuut....
The fun part is, that Serial communication works fine. And since the Teensy++ 2.0 uses USB for Serial, why does Serial communication work fine? Why would only raw HID have this problem?
Minimum code for Serial:
The packets I send are received incorrectly - the first byte is correct, then all the remaining 63 (or less, if configured, tested that too) are filled with the second byte.
For example, if I send "ABCDEF", the Teensy receives it as "ABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...". I've made sure that the issue is in the Teensy reading it, not echoing it but using the built in LED as some patience.
This occurs only on one of the Teensy++ 2.0s I have access to. It has become more of a curiosity now, as it seems to be a faulty board. I am looking for some confirmation and perhaps some insight into why this happens.
Here is the minimum code:
Code:
void setup() {}
char hidBufferIn[64];
void loop() {
int received = RawHID.recv(hidBufferIn, 20);
if(received > 0){
RawHID.send(hidBufferIn, 50);
}
delay(1000);
}
For sending the HID requests, I've used Node, and also Device Monitoring Studio. Same results for both of them, so the PC side is not at fault (and as mentioned before, only one teensy affected).
So it does seem to be faulty USB chip or something, buuuuuuuuuuuut....
The fun part is, that Serial communication works fine. And since the Teensy++ 2.0 uses USB for Serial, why does Serial communication work fine? Why would only raw HID have this problem?
Minimum code for Serial:
Code:
void setup() {
Serial.begin(9600);
}
char inc;
void loop() {
// put your main code here, to run repeatedly:
if (Serial.available() > 0) {
inc = Serial.read();
Serial.print("USB received: ");
Serial.println(inc);
}
}