Browse Source

Pin 35 on Teensy 4.1 requires different mux setting

main_ledos
PaulStoffregen 4 years ago
parent
commit
5cd821c889
2 changed files with 15 additions and 10 deletions
  1. +5
    -1
      WS2812Serial.cpp
  2. +10
    -9
      readme.md

+ 5
- 1
WS2812Serial.cpp View File

uart->CTRL = (LPUART_CTRL_TE /*| LPUART_CTRL_TIE */ | LPUART_CTRL_TXINV); // enable transmitter and invert uart->CTRL = (LPUART_CTRL_TE /*| LPUART_CTRL_TIE */ | LPUART_CTRL_TXINV); // enable transmitter and invert
// We need to configure the TX pin now. // We need to configure the TX pin now.
*(portControlRegister(pin)) = IOMUXC_PAD_SRE | IOMUXC_PAD_DSE(3) | IOMUXC_PAD_SPEED(3); *(portControlRegister(pin)) = IOMUXC_PAD_SRE | IOMUXC_PAD_DSE(3) | IOMUXC_PAD_SPEED(3);
*(portConfigRegister(pin)) = 2; // from hardware table for each one, but I think they are all 2...
uint32_t pinmuxval = 2; // most of them use mux ALT2
#if defined(ARDUINO_TEENSY41)
if (pin == 35) pinmuxval = 1;
#endif
*(portConfigRegister(pin)) = pinmuxval;


dma->destination((volatile uint8_t&)uart->DATA); dma->destination((volatile uint8_t&)uart->DATA);
//Serial.printf("HWTrigger: %x\n", hwtrigger); //Serial.printf("HWTrigger: %x\n", hwtrigger);

+ 10
- 9
readme.md View File



## Supported Pins & Serial Ports ## Supported Pins & Serial Ports


| Port | Teensy LC | Teensy 3.2 | Teensy 3.5 | Teensy 3.6 | Teensy 4.0 |
| :------ | :---------: | :--------: | :--------: | :--------: | :--------: |
| Serial1 | 1, 4, 5, 24 | 1, 5 | 1, 5, 26 | 1, 5, 26 | 1 |
| Serial2 | | 10, 31 | 10 | 10 | 8 |
| Serial3 | | 8 | 8 | 8 | 14 |
| Serial4 | | | 32 | 32 | 17 |
| Serial5 | | | 33 | 33 | 20, 39 |
| Serial6 | | | 48 | | 24 |
| Serial7 | | | | | 29 |
| Port | Teensy LC | Teensy 3.2 | Teensy 3.5 | Teensy 3.6 | Teensy 4.0 | Teensy 4.1 |
| :------ | :---------: | :--------: | :--------: | :--------: | :--------: | :--------: |
| Serial1 | 1, 4, 5, 24 | 1, 5 | 1, 5, 26 | 1, 5, 26 | 1 | 1, 53 |
| Serial2 | | 10, 31 | 10 | 10 | 8 | 8 |
| Serial3 | | 8 | 8 | 8 | 14 | 14 |
| Serial4 | | | 32 | 32 | 17 | 17 |
| Serial5 | | | 33 | 33 | 20, 39 | 20, 47 |
| Serial6 | | | 48 | | 24 | 24 |
| Serial7 | | | | | 29 | 29 |
| Serial8 | | | | | | 35 |


Serial2 & Serial3 on Teensy LC are not supported, due to lack of configurable Serial2 & Serial3 on Teensy LC are not supported, due to lack of configurable
oversampling needed to run at the high speed required. oversampling needed to run at the high speed required.

Loading…
Cancel
Save