Author Topic: STM32 blinking 30 LED's!  (Read 3701 times)

0 Members and 3 Guests are viewing this topic.

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3893
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: STM32 blinking 30 LED's!
« Reply #25 on: September 03, 2019, 12:51:02 pm »
... and that kind of current is only probably at the high end temperature extreme ;)
 

Offline Gibson486

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: us
Re: STM32 blinking 30 LED's!
« Reply #26 on: September 03, 2019, 09:58:13 pm »
Why would the stm32 not be able to do that? That is a fairly trivial task. You have the right idea, though. I would be more worried about current output. The chip can only output so much total current.
 

Offline KL27x

  • Super Contributor
  • ***
  • Posts: 4108
  • Country: us
Re: STM32 blinking 30 LED's!
« Reply #27 on: September 03, 2019, 10:41:44 pm »
Quote
1) Set the pin mode to input
2) Write a logic high or low to the input
:palm:

Quote
3) See how it "drives" the input pin with internal pullups
4) Realize a true tri-state buffer doesn't do that without additional circuitry

example code for arduino:
Code: [Select]
pinMode(2,INPUT);
digitalWrite(2,HIGH):
Or the alternative:
Code: [Select]
pinMode(2,INPUT_PULLUP);
Only in Arduino-Land do you set/write an input pin high or low. In the rest of the world, setting an input pin high or low does not compute. You can set the latch, but it only has an effect when the pin is set to output. You can write directly to the port on some micros, rather than the latch. But that just changes a number in a register. If you read the pin at any point in the future, the result is determined by w/e voltage is on the input pin at that time and nothing to do with what you wrote to the port register in the past.

Nowhere in the rest of the world does writing an input pin mean turning on an internal pullup. And who cares, anyway? What is this supposed to demonstrate?

There is no way any pin on any microcontroller meets your apparent definition of a "true tristate pin." A transistor drain/source is never actually open circuit, only very high impedance... which unless your micro can handle 1000's of volts on the I/O is the same thing. Whether it is truly open ciruit with a physical relay stuffed in there (haha) or high-Z, what's your beef? This is a state, is it not? Output low, output hi, hi-Z. I count 3 states. Truly/really. So is it not a true tristate I/O? That's rhetorical.

A more practical distinguishing thing is does the micro have ESD diodes clamping an I/O to rails? If it does, the input is limited to Vss-Vdd +-0.3ishV. You might have an argument that this is not a true tristate pin for this reason. Some micros have pins which can tolerate greater voltage than Vdd on input pins. Without the ESD diodes, an input would be tolerant of much greater voltage range. I have no idea where you are going with the pullup thing, though.
« Last Edit: September 04, 2019, 02:53:06 am by KL27x »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf