when I added Collin's Object Oriented CAN callbacks to FlexCAN_T4, I also included compiler errors which you would have seen:
#if defined(__MK20DX256__) || defined(__MK64FX512__)
...
Type: Posts; User: tonton81
when I added Collin's Object Oriented CAN callbacks to FlexCAN_T4, I also included compiler errors which you would have seen:
#if defined(__MK20DX256__) || defined(__MK64FX512__)
...
use CAN0 in constructor for Teensy 3.2/3.5
Teensy 3.6 has CAN0 and CAN1....
check your transceiver's operating mode as well as per datasheet. 2 pins are involved. EN should be tied HIGH and S should be tied LOW
23892
also you should be using the /3 chip model for...
all your transmits are full, theres a connection issue, check your wiring
what pins are you using on teensy? CAN2 uses pins 0 and 1, also confirm first with the fifo interrupt example, it works as is just change the bus to CAN2 in constructor, if that still doesn't work,...
Just updated the library. It now supports:
mySPI.swapPins() --> swaps MISO with MOSI, so you can connect teensies together directly pin-to-pin:
13 13
12 12
11 11
10 10
Hey that is an interesting idea. We could setup the library to also be an SPI bus sniffer. The T4.x is capable of swapping the MISO/MOSI pins so you can log & sniff data going to and from the SPI...
As a spy? just don't hookup the return line so it wont try to send anything to it, it should be able to print out what it sees on the spi bus with the callback disabled
https://github.com/tonton81/SPISlave_T4
with the watchdog you can decide what to do in it's own callback, i think only 1 of the 4 watchdogs doesn't reset unless you tell it to
Just wanted to rule out if it was a PC issue or not
SPISlave_T4 has been released!
You may download it at https://github.com/tonton81/SPISlave_T4
An example is supplied as well.
It is based on TSPISlave for Teensy 3.x, except it has an...
try another PC, could be a windows issue
Yes! I got SPIMODE0 working! :D
It turns out that aside from setting the TDR in the ISR with the RDR read, the initial TDR must ALSO be populated initially in setup! So while the ISR keeps setting...
put it before setBaudRate
it wont change the bus activity, but it will probably make controller more responsive, you probably wouldn't notice. It's also used for different baudrates that don't reliably work at X MHz since...
2 sends before response, i think the motor needs a time gap between commands, not sure. I know for cars if you write too fast they also stop responding for a bit, and car's gap is usually 10ms (not...
not really, does the motor perhaps requires a delay between requests (like car's do?) try to put a small delay between each request. If you wamna know for sure if it's a transmit issue, have another...
MB99 is virtual, it's actually FIFO, check if your bus is properly terminated?
i dont see your sendStatusxRequest functions so I dont know for that part
there is a FIFO interrupt example that just works on the repo, just make sure you select the right bus in the constructor (CAN1,CAN2,CAN3)
1) masking not needed
2) need interrupt and callback
3)...
Oh! Isn't this interesting. Another limited feature of SPI slave. Even if the SION bit is set, it will NOT return 1 if the CS pin is HIGH. None of the SPI slave pins register as high or low on...
Another interesting issue I see with SPI slave mode, I added 8, 16, 32bit data transfer support. Here is whats weird:
LC is sending (SPI.transfer()) 8 bit data over to 8 bit slave mode T4. This...
Anyone playing with a non-DMA version, interrupt driven version of SPI Slave? I been working on one and my setup is as simple as this:
#include "SPISlave_T4.h"
SPISlave_T4<&SPI> mySPI;
...
Teensy 3.2, Arduino IDE 1.8.13, Teensyduino 1.53, I see no issue:
Sketch:
void setup() {
Serial.begin(115200);
}
void loop() {
char buff[100];
try transmitting in the loop and keep watching mailboxStatus(), if the TX mailboxes are filling up and not clearing, it means you have a connection issue, and is not the software.
You should be...
if you don't use events() in the loop() on the version in teensyduino, nothing will receive, either put events() in the loop() or update to latest commit on github
thats not a sliding window then, thats going back to static window again, and you'd then have to repopulate the list, which now has 1 value to start with :)
I don't see anyone here bashing, Frank just asked what you changed it with, no need to throw heat his way, people are here to help each other at both software and hardware levels.
that and also try changing clock using setClock(), default is 24mhz on T4, 16 on T3, and I use 60mhz in car. 24mhz didnt work well on honda's 125kbps possible arbitration timing with clock, but after...
did you try a USB3 port which provides 1.5A of current?
provide a demo code that shows the behaviour so we can try to replicate it
can you post your sketch code? its kbps not MHz, and I use his board
i didnt think a 600mhz cpu could handle a 1ghz bus :)
you could wrap all devices in a queue system and just queue up writes back to back, the wrapper will take care of the devices back-to-back, it is possible but a complexity to get there :) and also...
you mean handling 1 CS pin per device on the same bus is an issue? Ports cannot do parallel tasks, and SPI devices are synchronous, so it makes no sense to setup multiple objects if they would all...
the USB port is the fastest, it uses HID
yes the trace cut is equivalent to removing the power wire from the USB cord. using a powerless usb cable has benefit that you can reprogram teensy with (powerless cable) or without (powered usb...
the port itself is a singleton class yes, however the chipselect (CS) is what you toggle for different devices attached to the same port. The singleton is able to access all of them provided the...
okay then, remove the .clear() from the 2nd posted code, that window will now be moving (not stationary), with the oldest sample going off grid when newest sample is added :)
...
i edited the post above, typing it from my phone so... :)
250 size buffer would be 256, filling it completely is not mandatory but must always be power of 2 (example, 300 byte buffer needs a queue...
actually, depending if you want it samples over time, (posted above), or biggest number of all:
static uint32 sample_refresh = millis();
if ( millis() - sample_refresh >= 5 ) { // 5ms
...
it returns the biggest value in the queue of your samples, you also got min() median() average() deviation() and variance()
just be sure the queue is a power of 2. if you want 100 samples, you...
Circular_Buffer can find your largest value, no need to dequeue either if you plan to just keep filling the queue endlessly, oldest values will be overwritten, and you can easily check the biggest...
if the connection is broken or a time difference between frame sequence causes them to be out of order, isotp aborts the rebuild until a new isotp frame is issued. the callback fires only once after...
yeah, it should work on all 3.x/4.x, as the isotp plugin is tied to an independant background frame callback of FlexCAN_T4, and isotp manages the frames data it sees :)
everything should come in unless your behind a gateway on ford (never played with a ford) or using filters, which i see your not. what are you physically connected to, OBD port?
isotp works on sequences, you can't change that unless you change protocol. sending hex or decimal will result in same value either way, makes no difference to the ecu or teensy or any other device
...
use Circular_Buffer to queue serial bytes, you can easily peek() into the queue at any position:
buffer.peek(7) // checks the 8th byte in the queue
are you using the github latest copy? i dont think the one built in teensyduino has interrupt transmits or eventless loop capability
if you are not on the latest commits, you definately need...
thats not a power of 2 (10). bugs are bound to happen. try 16 for the constructor
take events() out. because you ran that in setup(), the interrupts genererate the message queue but you never rerun events() in loop to dequeue. if you want direct interrupt firing instead of queues,...
i cant see your code but that mailboxStatus says plenty.
Your transmit buffers are filling and not transmitting. Notice it consumes every TX mailbox and the mailbox frames are still the same? There...