This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/EK-TM4C1294XL: GPIO_PinConfig Array: How to determine the right pin direction macro

Part Number: EK-TM4C1294XL
Other Parts Discussed in Thread: TM4C1294NCPDT

Tool/software: TI-RTOS

First, I'm using a ek-tm4c1294xl board with RTOS 2.16.1.14 and XDCtools 3.32.0.06 all in CCS v7.3.

I'm trying to add a pin config to the GPIO_PinConfig Array which is part of the GPIO_Config struct needed to initialize the GPIO driver. I know which interrupt config macro to use, but I don't know which pin direction config macro is appropriate. In/Out is easy enough, but open drain vs std and pull up vs pull down vs no pull.... that's not as clear. Should the macro to use be based on what I'm connecting the pin to or is it defined by board internals? I've looked at the documentation in tirtos_tivac_<version>/products/tidrivers_<version>/docs/doxygen for the GPIO macros, the RTOS User Guide, and the tm4c1294ncpdt datasheet, but none seem to answer the question.

How can I definitively know which macro to choose? Thanks for your help.

  • Hi,
    What do plan to connect the GPIO pin to your external device? It is application dependent to choose what pin type to specify. You will use open drain if you are connecting to a bus with multiple drivers on it and the bus has an external pullup. When configured in open-drain the MCU and all drivers on the bus will only pull down on the bus for logic 0. When drivers are not driving the bus the default pullup is equal to logic 1.

  • Hello Charles,
    I'm planning on connecting it to a PWM line from a sensor, so the pin's job is to, when its interrupts are enabled, trigger interrupts on both edges of the PWM signal. Range is 0.7-4.3V for low and high levels.

    Thank you
  • Hi Alberto,
    I think Bruno has already advice you in another thread not to drive 4.3V as TM4C129 is not 5V tolerant. You should keep it to 3.3V.
  • Note too - that should, "fastest/squarest/least reflected" arrival of those PWM signals be desired - and your sensor does not provide an (active or push-pull type output) - you are likely to require (far lower value) than the (relatively) high-value of the MCU's internal "pull-up/down" internal resistor.

    You've been "twice now" alerted to the "danger inherent" in that (non-standard & beyond MCU spec) 4V3 signal level.    It may prove that such (unusual) voltage results from a "diode drop" imposed upon a 5V0 signal level - and should such diode be present - the sensor's ability to  "present an effective (logic-low)"  may prove questionable.    (note that (both) your "0V7 and 4V3"  register as,  "unusual voltage levels - thus (bit) suspect."

    Your link to such sensor would seem a well-chosen (even comforting) addition...

  • Thank you both for the voltage warning. The link to the sensor's datasheet is below. I believe the engineer that chose this sensor model was optimizing for price rather than whether it natively played well with the board, so it's up to me to make it work at least in the short run (if we end up thinking it needs to be replaced, that'll have to be done after we get something demonstrable with this model since time is an issue). However, if you have any professional critique of the sensor, I welcome it.

    Additionally, as a more direct response to Charles' initial response, the pin to which it is connected is strictly for this sensor, so no other drivers interfere.

    www.samyoungsnc.com/products/3-1%20Specification%20DSM501.pdf
  • Staff will "visit your link" later - yet for now - I must advise that your, "Routing that sensor signal (after limiting its "signal swing" to "MCU spec levels) to ONLY one MCU pin - adds: "Time, Complexity, & Effort" to your job. You may greatly, "Speed, Ease & Enhance" your design by routing that same (now limited) sensor signal to TWO MCU pins - each one configured to, "Interrupt upon a "Different Signal Edge!"

    Should you elect TWO Timer pins for this role - your job is almost guaranteed to "speed AND ease" - which proves (very) much to your advantage...
  • I checked the datasheet. You just need to make sure the pin is configured as input on the MCU side and the pin voltage is adapted to MCU's TTL level. As cb1 mentioned, I'm not sure why you need a RTOS to run such an application (if the dust sensor measurement is your only task).