Interface and Connectivity ICs
MEMS and Sensors
Analog and Audio
EMI Filtering and Signal Conditioning
Power Management and Motor Control
SPC5 Automotive MCUs
ST25 NFC/RFID Tags and Readers
Switches and Multiplexers
STM32 MCUs Community
MEMS and Sensors Community
Automotive MCUs Community
STM8 MCUs Community
Help the community
Share your activities
Contribute your knowledge
About this community
to create and rate content, and to follow, bookmark, and share content with other members.
Question asked by
on Apr 19, 2005
on Apr 19, 2005 by 13962
Show 0 Likes
No one else has this question
Mark as assumed answered
This content has been marked as final.
Show 2 comments
(Required, will not be published)
Apr 8, 2005 9:58 AM
I use a ST7FLITE29 micro in my application.
Now I am planning to add a temperature sensor according to AN1755 "A HIGH PRECISION/RESOLUTION THERMOMETER USING ST7 AND NE555".
Unfortunately I have no I/O pin for it, so I need to expand the number of outputs.
Here is my pin usage:
PA0: Lite Input Capture (mains zero cross detection and RC calibration - see AN 1324)
PA1: drives a LED
PA2: output 1 (digital or PWM)
PA3: output 2 (digital or PWM)
PA4: output 3 (digital or PWM)
PA5: output 4 (digital or PWM)
PA6: push-button input
PA7: drives a LED
PB0: Analog key-press detection (see AN 979)
PB1: input 1 (digital or analog)
PB2: input 2 (digital or analog)
PB3: input 3 (digital or analog)
PB4: input 4 (digital or analog)
PB5: RS485 Driver or Receiver enable
PB6: RS485 data
I could use the input capture function associated to PA1, but I have to give up an high sink output which drives a led.
I have to expand the outputs to drive two leds with only a pin (PA7).
I found a solution: a M74HC161 (syncronous 4-bit counter with asyncronous clear) and some wiring.
The clear pin of M74HC161 is wired to ST7FLITE29 reset.
The clock pin of M74HC161 is wired to PA7.
The data-in pins of M74HC161 are pulled down to GND.
The load pin of M74HC161 is wired to the zero crossing detector (PA0).
The count enable pins of M74HC161 are pulled up.
The ouputs of M74HC161 drive the leds (up to four).
This circuit should work in the following way:
whenever a zero-crossing happens, the M74HC161 loads 0 when it receives the first pulse from PA7.
Then it counts the PA7 pulses.
By sending the right number of pulses after each zero-cross, it would be possible to light the leds up.
Is there a better (and cheaper) way to do the same thing?
I could obviously use a mid-range ST7 micro, but it would probably be more expensive.
Any suggestion is welcomed...
The new ST7FLITE1xB family shows that I/O shortage is an issue.
It is strange that no B-step exists for the ST7FLITE2x family...
Show 0 Likes
Apr 19, 2005 10:30 AM
I have found a better way to expand the number of I/O.
My previuous solution has the following cons:
- the number of pulses grows exponentially. Therefore it can be used for at most 4 outputs (i.e. 15 pulses).
- it needs an external signal (e.g. the zero-crossing pulse from a detector) to reset the counter value.
- it is a bit complex to implement in software
It has also the following pros:
- it needs no syncronization between the sender (ST7FLITE29) and the receiver (M74HC161)
- it needs only an I/O pin
My new solution is simpler. It uses a two-wire interface (Clock + Data) like the traditional trick of expanding the outputs by a standard shift register (74HC164).
This does not contrast to the number of available pins.
I missed the fact that one pin (PA6 in my application) can be changed from input to output when the input/output circuits are decoupled by a 4.7 K resistor, like it happens with the In-Circuit-Debugging.
Now the number of outputs is no more an issue for my application, since shift registers can be cascaded.
Show 0 Likes
Retrieving data ...
2018 STM32 Wish List
CubeMX SDIO DMA FatFS configuration
Please provide a way to download older version of the cube.
Efficiently use DMA with UART RX on STM32
Example code for stm32f4 SD card read via SPI