Forum Rule: Always post complete source code & details to reproduce any issue!
Page 9 of 9 FirstFirst ... 7 8 9
Results 201 to 202 of 202

Thread: Teensy 4.0 which pins for which ADC

  1. #201
    Junior Member
    Join Date
    Aug 2019

    KurtE TeensyDocuments shows more pins... ?

    Quote Originally Posted by KurtE View Post
    I put my Excel documents up on github:
    Thank you for making this available.

    Your document shows many more pins than the "Welcome to Teensy 4.0" card/jpeg shows. For example, your card shows:
    Pin 0: SPI1(3) CS0 (I assume this was meant to be just "CS")
    Pin 1: SPI1(3) MISO

    First, is this sheet accurate? I assume it is. I'm guessing some pins weren't shown on the graphic due to lack of space.

    Can you point me to an example of how I activate those pins for that mode (e.g. Pin0 SPI1 CS)?

    Also, I was hoping to find something that helps me understand what Timers are shared by what (PWM) pins. Is that somehow encoded on this spreadsheet?
    I did find the answers to these questions in other posts... and do not believe your spreadsheet shows the timers associated with PWM pins.

    Last edited by JimKazmer; 02-19-2020 at 12:41 AM. Reason: found my answers

  2. #202
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    @JImKazmer - net sure what this has to do with Teensy 4 which pins....

    But I do try to make the spreadsheet as accurate as possible and as usable to myself as possible.

    I should mention there is no magic or voodoo in creating these table.

    For example Pin0, if you look at how each pin is defined. That is much of these tables were create as part of the T4 beta. Paul supplied a lot of the data, plus he stared the beta with some of the underlying stuff defined So if you look in cores\teensy4\core_pins.h

    If you look at CORE_PIN0_BIT you will see 3 likewise CORE_PIN0_PORTREG = GPIO6_DR So form this you know that this is logically pin 6.3. Note there is a little magic to know that some of the ports map to each other 0.3 is 6.3...

    You can do a few searches to find out that this corresponds to logical pin AD_B0_03. Now if you look at the reference manual for the IMXRT and in this case look for SW_MUC_CTRL_PAD_GPIO_AD_B0_03 Page 473 in my version, which I think is the same one as you can now download from PJRC...
    In here you see the Mux modes for this pin:
    MUX Mode Select Field.
    Select one of iomux modes to be used for pad: GPIO_AD_B0_03.
    000 ALT0 — Select mux mode: ALT0 mux port: FLEXCAN2_RX of instance: flexcan2
    001 ALT1 — Select mux mode: ALT1 mux port: XBAR1_INOUT17 of instance: xbar1
    010 ALT2 — Select mux mode: ALT2 mux port: LPUART6_RX of instance: lpuart6
    011 ALT3 — Select mux mode: ALT3 mux port: USB_OTG1_OC of instance: usb
    100 ALT4 — Select mux mode: ALT4 mux port: FLEXPWM1_PWMX01 of instance: flexpwm1
    101 ALT5 — Select mux mode: ALT5 mux port: GPIO1_IO03 of instance: gpio1
    110 ALT6 — Select mux mode: ALT6 mux port: REF_CLK_24M of instance: anatop
    111 ALT7 — Select mux mode: ALT7 mux port: LPSPI3_PCS0 of instance: lpspi3
    And in this you will see the different things that this pin can actually do, including the LPSIP3_PCS0 when Mode 7...

    Now as to how to convert this IO pin into SPI3 CS mode...
    You preferably use system function to do so, or you set this register to the value ox7, actually you probably want to or the setting with 0x10...

    Now if you find bugs in my tables, let me know.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts