It seems it may have been a breadboard issue. I tried a new breadboard with the same software and hardware setup, and it worked fine. Thank you for helping me narrow down the issue!
I'd second the suggestion to use hardware quadrature encoder counting. The Teensy processor can do it so you should. Basically nobody tries to do encoder capture in software. I've certainly never done it on any motor controllers. Granted, I was...
I'm not familiar with this waveshare board you mention but an SN65HVD230 is a transceiver only and thus you could use three of those to get three CAN buses at the same time. You can extend the number of buses by adding SPI connected CAN modules...
There is an NDK for running C++ modules on Android. So, it may be possible to use that to set this up. However, I'd venture a guess that you can't directly do USB manipulation from the NDK. I don't know for sure, but usually hardware access is...
Not totally sure if this will work, so just brainstorming here.
The CAN bus transceiver receive pin going to the Teensy is always being driven either HIGH or LOW. If there is no CAN bus activity or it is disconnected, the output is driven LOW...
USB is done partially in software. What this means is that any time the teensy reboots it will reset the USB stack and you will have a connection cycle. You would have to try to reset differently. One option (not perfect) is to simply call the...
Yeah, sorry, that was a typo on my part. I was typing in the code directly to the forum here without having ever tested it. So, I just forgot the .buf on the second byte of each line.
@Dsolberg8132:
The following should work better (note changes in BOLD - sorry for the lack of formatting . . . can't do color/bold inside of CODE tags !!):
switch (msg.buf[1]) {
case 0x75:
output_voltage = (msg.buf[6] * 256 +...
Figured this out and thought it would be helpful (and so there's a record out there if I ever have to figure this out again).
I was in a situation where I had to in order to ensure that hotplugged systems of multiple teensies into one board...
So, lets say your received frame is in a variable called frame.
float voltage, current;
switch (frame.buf[1])
{
case 0x75:
voltage = (frame.buf[6] * 256 + frame[7]) / 1000.0f;
break;
case 0x81:
current =...
Connect the motor. Then put your scope on the CAN_RX pin. If your scope does CAN decoding that would be great otherwise it's going to be harder to figure things out. At the very end of the transmitted message is an ACK bit that the motor should...
The general rule of thumb is to expect at least 10 bits per byte. On true serial this is certainly true as you will have at least a start and stop bit so sending 8 bits requires at least 10 bits. But, USB also has overhead. There are potentially...
Hardware serial is literally an order or two of magnitude slower than USB serial. The USB serial link is limited only by the bus bandwidth. On USB2 that's around 480mbs. You won't be likely to get quite 480mbs but as you found, 20 megabytes per...
Do you have any communication issues of your Teensy with other chips?
If you have an oscilloscope that can connect to your computer over USB or that can store CSV files on a USB stick, then there is a new open-source software for you which...