Forum Rule: Always post complete source code & details to reproduce any issue!

# Search:

Type: Posts; User: tonton81

Page 1 of 10 1

1. ## Thread: Query speed limit teensy 4.1

by tonton81
Replies
27
Views
480

### is the toggle method faster?

is the toggle method faster?
2. ## Thread: Reading data from CAN bus volkswagen

by tonton81
Replies
8
Views
264

### standard pids are fine, but not OEM specific....

standard pids are fine, but not OEM specific. each car and year can be different. Some data is already in stream while you have the option to request them. But not all requested pids are available,...
3. ## Thread: Firm attachment of Teensy 4.1

by tonton81
Replies
4
Views
233

### well i use it in automotive environment, its...

well i use it in automotive environment, its socketed to a triple CAN board, and i am using all 3 CANs on my vehicle, no issues here. it's mounted in a project box in the trunk.

if you are not...
4. ## Thread: Function to find index in 2D array based on sensor values

by tonton81
Replies
10
Views
191

### constrain(map(value,-1100.0f, 1100.0f, 0.0f,...

constrain(map(value,-1100.0f, 1100.0f, 0.0f, 44.0f), 0.0f, 44.0f)

:)
5. ## Thread: Function to find index in 2D array based on sensor values

by tonton81
Replies
10
Views
191

### there are other ways to round up or down, you...

there are other ways to round up or down, you want rounding to closest integer?

i think you solved your issue above?
6. ## Thread: Function to find index in 2D array based on sensor values

by tonton81
Replies
10
Views
191

### Try this: 903/50 is 18.06 then (cast)/store it...

Try this:
903/50 is 18.06 then (cast)/store it into an integer then it will be 18. 18 then multiply by 50 gives you 900.

323/50 == (int)6.46 x 50 == 300
7. ## Thread: 5V on Vin leads to 4.8V on 3.3V pins?

by tonton81
Replies
8
Views
167

### This usually happens when your DMM battery is low...

This usually happens when your DMM battery is low (offscale readings), also make sure you have a good ground path when testing voltages
8. ## Thread: FlexCAN_T4 - FlexCAN for Teensy 4

by tonton81
Replies
371
Views
27,482

### the only difference between 4.0 and 4.1 is that...

the only difference between 4.0 and 4.1 is that CAN3 has been routed to pins 30 and 31 at edge of board, the other CAN1 and CAN2 have same regular and alternate pins. It's already updated in the...
9. ## Thread: Circular_Buffer

by tonton81
Replies
186
Views
16,980

### I havn't played with SD or USB utils so I...

I havn't played with SD or USB utils so I wouldn't be of much help on that part, but a circular queue you could assign 512 bytes and when it is full via size() you can write that block to the SD or...
10. ## Thread: Teensy 3.6 and FTDI board

by tonton81
Replies
1
Views
157

### an fdti board can not be used to program teensy....

an fdti board can not be used to program teensy. You need to connect the usb cable directly from teensy to pc to program. fdti board only works for serial uarts, but they will NOT reprogram teensy
...
11. ## Thread: New Tesnsy 4.0 not being detected

by tonton81
Replies
7
Views
201

### try another PC as well, in case your Windows has...

try another PC as well, in case your Windows has usb driver issues or hardware problem
12. ## Thread: Teensy 4 SPI polling issue

by tonton81
Replies
11
Views
243

### ill show you the sketch soon, but it's basically...

ill show you the sketch soon, but it's basically once the ISR sets a volatile variable, it runs the digitalwrite from loop(), like

void loop() {
if (var) {
mcp.digitalWrite(35, HIGH);
...
13. ## Thread: Teensy 4 SPI polling issue

by tonton81
Replies
11
Views
243

### delayMicroseconds(500) still failed, i havn't...

delayMicroseconds(500) still failed, i havn't went lower than 5ms to test more but i must be near that sweet spot between 500us and 5ms
14. ## Thread: Teensy 4 SPI polling issue

by tonton81
Replies
11
Views
243

### that may be a possibility, however the...

that may be a possibility, however the digitalwrite section only uses transfer16, just checked, some other functions use both, but they're not running by the time the loop is hit. but by the time the...
15. ## Thread: Teensy 4 SPI polling issue

by tonton81
Replies
11
Views
243

### yes maybe tomorrow when i get back on laptop i...

yes maybe tomorrow when i get back on laptop i can zip up the code, but its mostly digitalwrites consistantly on the SPI port expander. I used to use the DIP versions of 'em on T3.5 and they never...
16. ## Thread: Teensy 4 SPI polling issue

by tonton81
Replies
11
Views
243

### note: the spi accesses are not ran from interrupt...

note: the spi accesses are not ran from interrupt routines or threads, so loop only. i tried 10mhz, 8mhz, 2mhz, 1mhz, 100khz, same issue, so i dont think its about speed, more like the clock line at...
17. ## Thread: Teensy 4 SPI polling issue

by tonton81
Replies
11
Views
243

### Teensy 4 SPI polling issue

Just added the 128gpio setup to teensy 4.0 in my car project and in its test stages of wiring everything was fine. When i started adding consistant SPI polling in the loop controlling the MCP23S17s,...
18. ## Thread: IDE crashed, source code file corrupted

by tonton81
Replies
11
Views
289

### It's the IDE, if a PC is unstable and crashes,...

It's the IDE, if a PC is unstable and crashes, under rare circumnstances during an upload or save when the crash occurs, you can end up with a blank sketch.
19. ## Thread: FlexCAN_T4 - FlexCAN for Teensy 4

by tonton81
Replies
371
Views
27,482

### very odd, there is no trickery in the read...

very odd, there is no trickery in the read (polling) function, and it doesn't play with timers, interrupts, or other hardware, just reads the memory of the mailbox, what happens if you comment out...
20. ## Thread: FlexCAN_T4 - FlexCAN for Teensy 4

by tonton81
Replies
371
Views
27,482

### found the problem? I don't think the I2C has any...

found the problem? I don't think the I2C has any influence on flexcan it should work fine, the triple CAN board from skpang uses an I2C display addon.
21. ## Thread: FlexCAN_T4 - FlexCAN for Teensy 4

by tonton81
Replies
371
Views
27,482

### which specific subroutine causes it to not work?...

which specific subroutine causes it to not work? (you said read one..?which)
22. ## Thread: FlexCAN_T4 - FlexCAN for Teensy 4

by tonton81
Replies
371
Views
27,482

### have you tried starting the I2C before and after...

have you tried starting the I2C before and after flexcan begin?
do you have a sketch?
have you tried different I2C clockspeeds?

did you try modifying the flexcan clock?
Canx.setClock(CLK_60MHz)...
23. ## Thread: Teensy 4.0 vs 3.2 speed comparison

by tonton81
Replies
7
Views
349

### i don't know if this optomizes out, not a...

i don't know if this optomizes out, not a compiler expert, but it does quiet the compiler
(void)rs;
24. ## Thread: Correct way to use same SPI pins with different SPI master and Slave libraries? T3.6

by tonton81
Replies
12
Views
256

### try to disable slave's NVICIRQ before modifying...

try to disable slave's NVICIRQ before modifying it for master, maybe it's stuck in there when the peripheral transitions and it's not handled
25. ## Thread: Correct way to use same SPI pins with different SPI master and Slave libraries? T3.6

by tonton81
Replies
12
Views
256

### be sure spi.begin() runs first before having tft...

be sure spi.begin() runs first before having tft take over
26. ## Thread: Correct way to use same SPI pins with different SPI master and Slave libraries? T3.6

by tonton81
Replies
12
Views
256

### you should be able to copy the relevant spi bus...

you should be able to copy the relevant spi bus block in tspislave and run that in your sketch to switch to slave, but just need to run spi.begin after to control the lcd then
27. ## Thread: Correct way to use same SPI pins with different SPI master and Slave libraries? T3.6

by tonton81
Replies
12
Views
256

### if the slave is ready though to accept...

if the slave is ready though to accept calibration data from another mcu the tft SI/SO lines may interfere in the data process, even if only one of it's line is tri-stated, so data corruption will be...
28. ## Thread: Correct way to use same SPI pins with different SPI master and Slave libraries? T3.6

by tonton81
Replies
12
Views
256

### you can't use master and slave on same bus at...

you can't use master and slave on same bus at same time, or switch, well, you can switch but you need to change the whole bus configuration to do so every time. better to use 2 spi busses

if you...
29. ## Thread: FlexCAN_T4 - FlexCAN for Teensy 4

by tonton81
Replies
371
Views
27,482

### think of a mailbox as just a queue. now all your...

think of a mailbox as just a queue. now all your data is in queues.

When you do a Can2.read(msg), that is actually polling the mailboxes, and not interrupt driven. You can start with that for now...
30. ## Thread: FlexCAN_T4 - FlexCAN for Teensy 4

by tonton81
Replies
371
Views
27,482

### you can lower the mailbox count if needed,...

you can lower the mailbox count if needed, example, instead of 64 mailboxes, you can setup 8, so you can store up to 8 latest frames. or, with FIFO, you'll have 6 latest frames with 8 transmit...
31. ## Thread: FlexCAN_T4 - FlexCAN for Teensy 4

by tonton81
Replies
371
Views
27,482

### it is a bit confusing at first, think of each...

it is a bit confusing at first, think of each mailbox as a random queue to hold incomming frames, can also be referred to as a message box. if you have 64 mailboxes, without reading any of them, you...
32. ## Thread: FlexCAN_T4 - FlexCAN for Teensy 4

by tonton81
Replies
371
Views
27,482

### Check the link in the first post, it has a large...

Check the link in the first post, it has a large readme, plus there are a couple examples in there. Some brief comments about functions can be found in the source file, but if you are looking for...
33. ## Thread: FlexCAN_T4 - FlexCAN for Teensy 4

by tonton81
Replies
371
Views
27,482

### yes msadie you're right, FIFO wasn't meant to be...

yes msadie you're right, FIFO wasn't meant to be used in enableMBInterrupt(). I will have to set a limiter based on MAXMB size so people would be forced to use enableFIFOInterrupt() instead
34. ## Thread: FlexCAN_T4 - FlexCAN for Teensy 4

by tonton81
Replies
371
Views
27,482

### are you looping the busses? do you have...

are you looping the busses? do you have termination?
35. ## Thread: FlexCAN_T4 - FlexCAN for Teensy 4

by tonton81
Replies
371
Views
27,482

### the old flexcan library or the MCP library could...

the old flexcan library or the MCP library could be emulated with a dummy class that will forward their controls over to the latest flexcan driver. i dodn't say i'd write a canopen stack thats an...
36. ## Thread: Remove compiler warnings from libraries we ship

by tonton81
Replies
10
Views
536

### when i get this error: "warning: 'val' may be...

when i get this error:
"warning: 'val' may be used uninitialized in this function"

i formed a habit of setting the variable to 0 when creating it
int val = 0;

the compiler just doesn't like:...
37. ## Thread: FlexCAN_T4 - FlexCAN for Teensy 4

by tonton81
Replies
371
Views
27,482

### I havn't messed with CANopen so at the moment I...

I havn't messed with CANopen so at the moment I couldn't give you an answer. If there is a library that uses it and it's working on teensy (most likely with old flexcan library), I may try to port it...
38. ## Thread: Delivery timeframes? (Yes I know - Covid!)

by tonton81
Replies
6
Views
464

### i've ordered from the states couple times over...

i've ordered from the states couple times over the past few months. the delivery takes about a month from USA to Canada. The delivery companies have more load now than they used to during christmas...
39. ## Thread: FlexCAN_T4 - FlexCAN for Teensy 4

by tonton81
Replies
371
Views
27,482

### better to have it hard wired than in code, pins...

better to have it hard wired than in code, pins go hi impedance when the MCU is disconnected, rebooted, or reprogrammed. If a state needs to be enforced when the MCU is unavailable, a resistor is...
40. ## Thread: Which CANBus enabled Teensy has a -40 to 85 deg C temperature range?

by tonton81
Replies
2
Views
226

### i've had teensy 3.5 in my old car for years...

i've had teensy 3.5 in my old car for years throughout winter ice and summer heat on canbus running 24/7... it is pretty stable, but you could always run some tests with a furnace and a freezer if...
41. ## Thread: Teensy 4: Global vs local variables speed of execution

by tonton81
Replies
148
Views
3,464

### oh no, not division :P try >> 1 shift instead...

oh no, not division :P

try >> 1 shift instead of / 2

sorry trying to stay on 'topic' of performance :D
42. ## Thread: Teensy 4: Global vs local variables speed of execution

by tonton81
Replies
148
Views
3,464

### const uint8_t adc_pins[10] = {A0, A1, A2, A3, A4,...

const uint8_t adc_pins[10] = {A0, A1, A2, A3, A4, A5, A6, A7, A8, A9};
43. ## Thread: WDT_T4 - Watchdog Library for Teensy 4

by tonton81
Replies
11
Views
818

### if you dont set it, it is unused, just comment it...

if you dont set it, it is unused, just comment it out. Only valid watchdog pins would be set (provided you put in a matching pin), invalid ones or not set wont touch any pins
44. ## Thread: WDT_T4 - Watchdog Library for Teensy 4

by tonton81
Replies
11
Views
818

### the pin is used to drive the output should the...

the pin is used to drive the output should the watchdog be triggered. this allows the watchdog to reset an external board
45. ## Thread: Teensy 4.0 serial buffer

by tonton81
Replies
4
Views
278

### you have a couple options, 1) serialEvents...

you have a couple options,

1) serialEvents function that fires from yield() whenever serial data appears

2) modify the core's serial buffer, default 64 bytes, but it restores after a reinstall...
46. ## Thread: Teensy 3.2 with external MCP2515/Tranceiver

by tonton81
Replies
7
Views
278

### you could always go into the library source and...

you could always go into the library source and change the teensy's #ifdef to something other than what teensy detects as, so it wouldn't use the onboard controller or occupy resources, and it should...
47. ## Thread: Teensy 3.2 with external MCP2515/Tranceiver

by tonton81
Replies
7
Views
278

### normally pin 10 is commonly used to be CS, but...

normally pin 10 is commonly used to be CS, but you can use any pin actually.
48. ## Thread: Teensy 3.2 with external MCP2515/Tranceiver

by tonton81
Replies
7
Views
278

### hooking it up to teensy's SPI is no different...

hooking it up to teensy's SPI is no different than hooking it to an arduino. But you have to find a working library for that chip, many versions can be found on github. The one built into Teensy has...
49. ## Thread: FlexCAN_T4 - FlexCAN for Teensy 4

by tonton81
Replies
371
Views
27,482

### I put the previous flexcan in a branch of the...

I put the previous flexcan in a branch of the repo "before-TX-interrupts"

Update7 has been applied to "master" branch, so no need to patch it anymore.
50. ## Thread: Teensy 4.0 Internal Temperature measurement

by tonton81
Replies
39
Views
1,896

### Using 4.0 in automotive environment it runs 24/7...

Using 4.0 in automotive environment it runs 24/7 on CAN without issues, cabin temperatures here now with summer reached high 70's celcius, no heatsink on T4, enclosed in an atmega2560 enclosure box...
Results 1 to 50 of 500
Page 1 of 10 1