For any discussion not specifically related to your project
User avatar
By gcosens
#66988
Hi all, really sorry if this has been covered before - I did a bit of searching the forum / digging in the manual and couldn't turn up clear answers so just looking for some pointers here :)

I'm currently running on a UA4C board with Mega2560 and I'd like to try migrating to Teensy or STM32. I'm mostly interested in using the PWM fan control option to drive an electric temperature gauge.

I noticed some talk of a Teensy -> Mega2560 adapter board designed by noisymime but I haven't been able to find it on the hardware Github. Does anyone know where I can either purchase a finished board or find the project files so I can get one made?

Also, is a specific Teensy version recommended? I saw some comments about 4.1 not being supported but not sure if that's still up to date info and whether all of the earlier Teensy's are compatible?
By dazq
#67019
The teensy adaptor was removed from the hardware GitHub some time back to get an update, then COVID hit and teensy3.5 became hard to source.

You can see the design still (some of us saved it) ,take a look at my GitHub speedy files ( I am autohome2 on GitHub)
It could be updated to support teensy 4.1 which DOES work (josh did some more work recently)
User avatar
By gcosens
#67092
I've borrowed a Teensy 4.1 to have a play with.

I've used the UA4C board map as that is my preferred target but I noticed some of the UA4C pin assignments seem to cause conflicts when used with the Teensy.

For example, CLT is assigned to A4 on the UA4C.
A4 is the same pin as D18 on the Teensy and D18 is assigned to Tach2 on the UA4C.

The IAT input also has a similar conflict with Tach1

I just wanted to mention this in case it's useful info for others.

If I do migrate to Teensy, I will try to find a Board Layout setting which has no conflicts and design an adapter board to match it to the UA4C pinout.
User avatar
By PSIG
#67094
What PCB layout pin assignment for Teensy 4.1 are you using? I would suggest (if possible) using one that is already set in init.ino, and match-up the pins on your new adapter board, e.g., A4 to A1. Else, create your own pin mapping for cleaner layout.

Examples of UA4C (Mega2560) and Bear Cub (T4.1) from init.ino:
Code: Select all
----------
  //Pin mappings as per the UA4C shield
      pinInjector1 = 8; //Output pin injector 1 is on
      pinInjector2 = 7; //Output pin injector 2 is on
      pinInjector3 = 6; //Output pin injector 3 is on
      pinInjector4 = 5; //Output pin injector 4 is on
      pinInjector5 = 45; //Output pin injector 5 is on PLACEHOLDER value for now
      pinCoil1 = 35; //Pin for coil 1
      pinCoil2 = 36; //Pin for coil 2
      pinCoil3 = 33; //Pin for coil 3
      pinCoil4 = 34; //Pin for coil 4
      pinCoil5 = 44; //Pin for coil 5 PLACEHOLDER value for now
      pinTrigger = 19; //The CAS pin
      pinTrigger2 = 18; //The Cam Sensor pin
      pinTrigger3 = 3; //The Cam sensor 2 pin
      pinFlex = 20; // Flex sensor
      pinTPS = A3; //TPS input pin
      pinMAP = A0; //MAP sensor pin
      pinBaro = A7; //Baro sensor pin
      pinIAT = A5; //IAT sensor pin
      pinCLT = A4; //CLS sensor pin
      pinO2 = A1; //O2 Sensor pin
      pinO2_2 = A9; //O2 sensor pin (second sensor)
      pinBat = A2; //Battery reference voltage pin
      pinSpareTemp1 = A8; //spare Analog input 1
      pinLaunch = 37; //Can be overwritten below
      pinDisplayReset = 48; // OLED reset pin PLACEHOLDER value for now
      pinTachOut = 22; //Tacho output pin
      pinIdle1 = 9; //Single wire idle control
      pinIdle2 = 10; //2 wire idle control
      pinFuelPump = 23; //Fuel pump output
      pinVVT_1 = 11; //Default VVT output
      pinVVT_2 = 48; //Default VVT2 output
      pinStepperDir = 32; //Direction pin  for DRV8825 driver
      pinStepperStep = 31; //Step pin for DRV8825 driver
      pinStepperEnable = 30; //Enable pin for DRV8825 driver
      pinBoost = 12; //Boost control
      pinSpareLOut1 = 26; //low current output spare1
      pinSpareLOut2 = 27; //low current output spare2
      pinSpareLOut3 = 28; //low current output spare3
      pinSpareLOut4 = 29; //low current output spare4
      pinFan = 24; //Pin for the fan output
      pinResetControl = 46; //Reset control output PLACEHOLDER value for now

----------
 //Pin mappings for the Bear Cub (Teensy 4.1)
      pinInjector1 = 6;
      pinInjector2 = 7;
      pinInjector3 = 9;
      pinInjector4 = 8;
      pinInjector5 = 0; //Not used
      pinCoil1 = 2;
      pinCoil2 = 3;
      pinCoil3 = 4;
      pinCoil4 = 5;

      pinTrigger = 20; //The CAS pin
      pinTrigger2 = 21; //The Cam Sensor pin
      pinFlex = 37; // Flex sensor
      pinMAP = A5; //MAP sensor pin
      pinBaro = A4; //Baro sensor pin
      pinBat = A15; //Battery reference voltage pin
      pinTPS = A3; //TPS input pin
      pinIAT = A0; //IAT sensor pin
      pinCLT = A1; //CLS sensor pin
      pinO2 = A2; //O2 Sensor pin
      pinLaunch = 36;

      pinSpareTemp1 = A16; //spare Analog input 1
      pinSpareTemp2 = A17; //spare Analog input 2
      pinTachOut = 38; //Tacho output pin
      pinIdle1 = 27; //Single wire idle control
      pinIdle2 = 26; //2 wire idle control. Shared with Spare 1 output
      pinFuelPump = 10; //Fuel pump output
      pinVVT_1 = 28; //Default VVT output
      pinStepperDir = 32; //Direction pin  for DRV8825 driver
      pinStepperStep = 31; //Step pin for DRV8825 driver
      pinStepperEnable = 30; //Enable pin for DRV8825 driver
      pinBoost = 24; //Boost control
      pinSpareLOut1 = 29; //low current output spare1
      pinSpareLOut2 = 26; //low current output spare2
      pinSpareLOut3 = 28; //low current output spare3
      pinSpareLOut4 = 29; //low current output spare4
      pinFan = 25; //Pin for the fan output
      pinResetControl = 46; //Reset control output PLACEHOLDER value for now
----------
User avatar
By gcosens
#67107
Thanks for the nudge towards init.cpp! The V0.4 pin layout in there has a compiler directive to reshuffle the pin assignments for Teensy 4.1. I switched over to the V0.4 pin assignment for this test and am getting some better results now.

One of the things I wanted to compare was spark timing accuracy between Mega and Teensy and I was surprised to find the Mega 2560 accuracy appears to be better than the Teensy:

With both uCs driven in parallel from Ardu-Stim with a 36-1 pattern and timing locked at 0 degrees I was getting ~16.81us scatter from the Mega and 58.69us from the Teensy.

Based on this I think I'll stick with the Mega after all :)

I've managed to dig up a few obscure wiring diag[…]

Niiiice... 8-) Looking forward to your updates![…]

I'd be surprised if its not a 32-bit processor on[…]

I search for the datasheet of the IC and the on[…]

Still can't find what you're looking for?