-
Older Activity
-
Today, 08:42 AM
each usb has it's own registey entry in windows. just because 1.... maybe 100 work, and 1 doesn't may or may not be hardware, but it could be a corruptee registry entry for that specific device in windows. Try to...
4 replies | 99 view(s)
-
Today, 03:52 AM
what about driving some gpios as GND output between those pins?
3 replies | 68 view(s)
-
03-04-2021, 05:10 AM
button chatter, debounce needed. anyways, better to set state to the gpio result (HIGH (1) or LOW(0)) then set digitalwrite the state, that should solve that problem
state = digitalReadFast(interruptPin);
10 replies | 357 view(s)
-
03-03-2021, 06:01 AM
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__)
static_assert(_bus == CAN0,...
5 replies | 99 view(s)
-
03-02-2021, 11:34 PM
use CAN0 in constructor for Teensy 3.2/3.5
Teensy 3.6 has CAN0 and CAN1....
5 replies | 99 view(s)
-
03-02-2021, 01:37 PM
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
also you should be using the /3 chip model for Teensy, not the /E
5 replies | 116 view(s)
-
03-02-2021, 01:29 PM
all your transmits are full, theres a connection issue, check your wiring
5 replies | 116 view(s)
-
03-02-2021, 01:03 PM
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, try to print...
5 replies | 116 view(s)
-
03-02-2021, 09:19 AM
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
4 replies | 151 view(s)
-
03-02-2021, 05:55 AM
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 devices. The outgoing...
4 replies | 151 view(s)
-
03-02-2021, 05:42 AM
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
4 replies | 151 view(s)
-
03-01-2021, 02:09 PM
https://github.com/tonton81/SPISlave_T4
19 replies | 1701 view(s)
-
02-28-2021, 11:21 PM
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
21 replies | 355 view(s)
-
02-25-2021, 03:56 PM
Just wanted to rule out if it was a PC issue or not
17 replies | 461 view(s)
-
02-25-2021, 03:37 PM
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 additional feature. Not...
4 replies | 151 view(s)
-
02-25-2021, 01:09 PM
try another PC, could be a windows issue
17 replies | 461 view(s)
-
02-23-2021, 06:39 AM
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 a new TDR while...
19 replies | 1701 view(s)
-
02-22-2021, 06:18 PM
put it before setBaudRate
14 replies | 297 view(s)
-
02-22-2021, 08:07 AM
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 bitrate is calculated...
14 replies | 297 view(s)
-
02-22-2021, 07:54 AM
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 uS) :)
the fact...
14 replies | 297 view(s)
-
02-22-2021, 07:23 AM
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 node on the network...
14 replies | 297 view(s)
-
02-22-2021, 06:43 AM
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
14 replies | 297 view(s)
-
02-22-2021, 05:58 AM
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) fifo has ordered...
14 replies | 297 view(s)
-
02-22-2021, 04:53 AM
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 GPIO7_DR, however...... as...
19 replies | 1701 view(s)
-
02-22-2021, 02:03 AM
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 works.
LC then sends...
19 replies | 1701 view(s)
-
02-21-2021, 04:16 AM
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;
void setup() {
...
19 replies | 1701 view(s)
-
02-17-2021, 08:28 AM
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;
float val = 23.5;
2 replies | 110 view(s)
-
02-17-2021, 03:47 AM
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 using pins 22 and 23...
571 replies | 48711 view(s)
-
02-17-2021, 03:12 AM
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
571 replies | 48711 view(s)
-
02-15-2021, 07:40 PM
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 :)
17 replies | 377 view(s)
-
02-15-2021, 07:35 PM
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.
15 replies | 490 view(s)
-
02-15-2021, 06:43 PM
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 switching to...
4 replies | 151 view(s)
-
02-15-2021, 08:42 AM
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
15 replies | 490 view(s)
-
02-15-2021, 07:53 AM
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 :)
4 replies | 151 view(s)
-
02-14-2021, 10:27 PM
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 don't forget about the...
15 replies | 353 view(s)
-
02-14-2021, 09:06 PM
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 toggle the same port...
15 replies | 353 view(s)
-
02-14-2021, 07:51 PM
the USB port is the fastest, it uses HID
8 replies | 326 view(s)
-
02-14-2021, 07:46 PM
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 cable) external power...
3 replies | 148 view(s)
-
02-14-2021, 07:33 PM
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 device(s) tri-states are...
15 replies | 353 view(s)
-
02-14-2021, 07:25 PM
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 :)
queue.write(sample); //take samples
...
17 replies | 377 view(s)
-
02-14-2021, 07:12 PM
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 size of 512)
if...
17 replies | 377 view(s)
-
02-14-2021, 06:53 PM
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
Serial.print("This is the...
17 replies | 377 view(s)
-
02-14-2021, 06:46 PM
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 need a queue of 128.
17 replies | 377 view(s)
-
02-14-2021, 06:36 PM
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 value using the max()...
17 replies | 377 view(s)
-
02-14-2021, 06:21 PM
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 a successful...
571 replies | 48711 view(s)
-
02-13-2021, 05:57 PM
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 :)
571 replies | 48711 view(s)
-
02-13-2021, 03:16 AM
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?
571 replies | 48711 view(s)
-
02-12-2021, 03:57 PM
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
if your sending...
571 replies | 48711 view(s)
-
02-12-2021, 03:10 AM
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
4 replies | 213 view(s)
-
02-12-2021, 03:07 AM
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 events() in the loop()
571 replies | 48711 view(s)
-
02-12-2021, 03:04 AM
thats not a power of 2 (10). bugs are bound to happen. try 16 for the constructor
205 replies | 21461 view(s)
-
02-11-2021, 03:06 AM
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, remove events()...
571 replies | 48711 view(s)
-
02-10-2021, 03:12 AM
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 is a transmit issue....
1 replies | 104 view(s)
-
02-09-2021, 07:39 PM
yes although im not sure SD latency will play a role but it,s best to build a buffer block before writing to SD
example, have the CAN frames goto a buffer and after it's filled have the loop() write to SD
571 replies | 48711 view(s)
-
02-09-2021, 03:32 PM
yes FIFO for ordered frames, however, if polling you most likely will loose frames if your loop() code is slow. events() has nothing to do with polling whether you use it or not, since your not using...
571 replies | 48711 view(s)
-
02-09-2021, 02:55 AM
unfortunately fifo has only one callback, but yeah 1 would be another filter spot. if you consume 2 more mailboxes fifo can have 16 filters. more complexity for you though :) however, your still limited to a 6 deep fifo...
571 replies | 48711 view(s)
-
02-08-2021, 07:30 PM
yes thats correct, i'll be off to work now so i'll check back in ~ 9 hours on my break time :D
571 replies | 48711 view(s)
-
02-08-2021, 06:35 PM
yes there is no software load when the hardware filters out messages. with 6 message deep FIFO your messages will be ordered. Even without filters, you should be fine without loosing messages if you have fifo/mb...
571 replies | 48711 view(s)
-
02-08-2021, 06:11 PM
you want to capture only one message on all mailboxes and FIFO or just enable FIFO and mailboxes to capture all messages but assign only mailbox filtering for ECU?
or do you want FIFO only for ordered reception...
571 replies | 48711 view(s)
-
02-08-2021, 08:28 AM
Well if we take this info as example:
can0 7DF 02 09 02 00 00 00 00 00
can0 7E8 10 14 49 02 01 33 46 41
can0 7E0 30 00 00 00 00 00 00 00
can0 7E8 21 44 50 34 46 4A 32 42
can0 7E8 ...
571 replies | 48711 view(s)
-
02-08-2021, 07:52 AM
You mean have it send after the response? You can do that from FlexCAN_T4 callback if you see your request and send it. Then isotp callback will give you the buffer after
If your talking about the 3rd byte 0xF, thats...
571 replies | 48711 view(s)
-
02-08-2021, 07:42 AM
I found a fix. @PaulStoffregen , C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4\eeprom.c, declare as volatile and initialize status for flash_wait function:
volatile uint8_t status = 0;
seems to be...
5 replies | 230 view(s)
-
02-07-2021, 11:22 PM
isotp_server was updated, with an example, showing how to serve multiple buffers on CAN, and to send them to their own bus if needed
The ESP32 is requesting all 3 buffers using 6 CAN frames to Teensy 4, and all...
571 replies | 48711 view(s)
-
02-05-2021, 07:32 AM
if you are requesting from ECU, you use isotp not isotp_server
571 replies | 48711 view(s)
-
02-05-2021, 05:40 AM
ecu doesnt make the request, teensy does, example have another teensy do the request to the isotp_server
571 replies | 48711 view(s)
-
02-04-2021, 08:56 AM
im running the exact demo i put in examples, so send the proper request..
571 replies | 48711 view(s)
-
02-04-2021, 08:55 AM
... yes, so on the other teensy which is running the isotp client...
do a request
0x726, 0x22 0xF1 0x90 0x00 0x00 0x00 0x00 0x00
then the flow control frame
0x726, 0x30 0x00 0x00 0x00 0x00 0x00 0x00 0x00
if that...
571 replies | 48711 view(s)
-
02-04-2021, 07:03 AM
you need to send a frame to the ID with the request code you used
if you set 0x020902 in constructor for example, you must request the ID with bytes as 02 09 02 00 00 00 00 00
if you used a request code of 0x55,...
571 replies | 48711 view(s)
-
02-03-2021, 02:50 PM
Just uploaded isotp_server to the repo, with an example sketch.
To test it, run the isotp.h example on another teensy, and use this:
CAN_message_t msg;
ISOTP_data config;
config.id = 0x666;
...
571 replies | 48711 view(s)
-
02-03-2021, 12:13 PM
yeah you can put your response code in your buffer (the one you passed in the constructor. only thing is you can set it positive or negative, but, if the request is wrong, it wont send the payload, so the requester will...
571 replies | 48711 view(s)
-
02-03-2021, 11:50 AM
actually the response from the VIN from ECU will be in the same array. So thats allready clear :)
the server is not fully binded yet with network requests, still deciding how to implement things. i am also thinking...
571 replies | 48711 view(s)
-
02-03-2021, 03:11 AM
yeah, we could make response similar to ECUs, but that will severely limit the up-to-4 byte request code (of your choice) on the isotp server end, It doesn't mean I can't do nothing about it, I could, but we would be...
571 replies | 48711 view(s)
-
02-02-2021, 03:52 PM
Actual interaction log of an ECU request -> response:
can0 7DF 02 09 02 00 00 00 00 00
can0 7E8 10 14 49 02 01 33 46 41
can0 7E0 30 00 00 00 00 00 00 00
can0 7E8 21 44 50 34 46 4A 32...
571 replies | 48711 view(s)
-
02-02-2021, 11:30 AM
i dont understand your question?
data starts at 3rd byte of first frame, 2nd on remaining
0x01B inclusive (12bits, 4 nibbles from byte0 and 8 from byte 1) is the size from first frame, byte0 of re.aining frames is for...
571 replies | 48711 view(s)
-
02-02-2021, 10:24 AM
How do you guys feel about a simulated isotp request server? sort of like requesting a vin?
Current progress on isotp_server.....
#include <isotp_server.h>
const uint32_t canid = 0x666;
const uint32_t request =...
571 replies | 48711 view(s)
-
02-01-2021, 04:27 PM
@rezo, you can send and receive full payloads at any time, if you are making requests like to a car, like for vin, yes you need to send an initial frame request followed by a flow control frame, the VIN would appear in...
571 replies | 48711 view(s)
-
02-01-2021, 06:54 AM
Speaking of flow control, I just added ISOTP plugin for flexcan. Example is on the repo. This allows teensy to send long messages (up to 4095 bytes). It works with the circular array system, and can rebuild multiple...
571 replies | 48711 view(s)
-
01-30-2021, 05:00 PM
You should print the frame and double check your conditions match up. Also set the filters after enabling FIFO.
Proper order:
begin
setmaxmb
enable fifo
filters
571 replies | 48711 view(s)
-
01-29-2021, 07:16 PM
yes, that is the expected behaviour for wdog1, that pin usually drives an external reset pin
also, after the watchdog reset, that pin is still driven LOW to make sure an external processor fully resets the system....
13 replies | 1850 view(s)
-
01-29-2021, 03:10 PM
Try this:
can1.setClock(CLK_60MHz);
can1.setBaudRate(95238);
I made an ESP32 version of this CAN library and the closest match it shows on the ESP32 is 95238. So when I put that on teensy @ 60MHz peripheral...
571 replies | 48711 view(s)
-
01-29-2021, 03:01 AM
events() dequeues while the interrupt queues. so depending on your delays, if you let the queue build up to max you'll just be tossing frames after. you could also do a while(Can0.events()); and it'll dequeue everything...
571 replies | 48711 view(s)
-
01-28-2021, 02:34 PM
wouldn't common sense not need a performance hit? i could sprinkle conditions all over but thats extra cpu :) size() and available() are there for reference
205 replies | 21461 view(s)
-
01-28-2021, 03:08 AM
yes, the queue itself worked, the return was wrong by one offset. essentially when deleting items from front or back, the head moves forward and tail moves backward, respectively. even though it does, the data is still...
205 replies | 21461 view(s)
-
01-27-2021, 06:40 PM
Fixed:
https://github.com/tonton81/Circular_Buffer/commit/6ec0bc149ac4b40a71b9b4aec26ccb11c34da917#diff-05031bd28244fb1791d9704abd4df93cb9b7b7f89a9e373b7a857ca91373bb87
205 replies | 21461 view(s)
-
01-27-2021, 01:14 PM
can you setup a small example i can load to test?
205 replies | 21461 view(s)
-
01-25-2021, 03:43 PM
Shouldn't you set the filter only after running begin()?
15 replies | 1502 view(s)
-
01-24-2021, 05:30 PM
for ordered frames you need FIFO, otherwise you'll have to build your own frame re-assembly code for multiframe (you can build both ways, but FIFO would make the rebuilding easier, also remove events() from the loop().
571 replies | 48711 view(s)
-
01-23-2021, 08:54 PM
Yeah, that would require defining CAN2, CAN3, asserts should work as is:
typedef enum CAN_DEV_TABLE {
#if defined(__IMXRT1062__)
CAN0 = (uint32_t)0x0, <------------- This was added to support the...
571 replies | 48711 view(s)
-
01-23-2021, 08:37 PM
You can try this?
added checks:
#if defined(__MK20DX256__) || defined(__MK64FX512__)
static_assert(_bus == CAN0, "Only CAN0 works on Teensy 3.2/3.5");
#endif
#if defined(__MK66FX1M0__)
571 replies | 48711 view(s)