Writing to inputs...
Posted: Thu Jan 27, 2022 6:50 pm
Hi,
this is a ususual question on Arduino forums. AFAIR, the answer is : no !
But what about the STM32 (BluePill).
Is writing from output pins to input pins allowed ?
Not sure it is understandable ! Some explanations about the context...
The STM32F103 has two SPI ports. In my application, they are in use. I'd like to be able to programmatically, at compile time, switch between two SPI "inputs". Ok. SPI1 has an alternate pinout (PA4-PA7/PB5-PB4-PB3-PA15) ; the solution could be compiling for the main one or for the alternate one... Unfortunately, I can't use SPI1 as "input", as the input has to be 5V tolerant (comes from a MEGA). SPI2 is 5V tolerant, and already in use as input.
I've been thinking of using some free 5V tolerant pins and attaching a couple inteerrupt vectors in order to programmatically write to SPI2 ports. Like a internal port duplication.
The other SPI port (SPI1) is the "output", and cannot be used as input (no room on the PCB for MOSFETs as voltage shifters).
The actual schematics uses pin headers and jumpers. I'd like to get rid of them...
I don't have access to my MCUs for now, so I can't test. I'm currently rebuilding my small lab (woodworking, wiring, etc.).
It is a working project (protoboards) I'm enhancing. I can live with jumpers, but don't want to use SMDs ; want to use THT's as I've no SMDs but lots of THTs ! And also lots of BluePills.
I'm out of space. Maybe should I bite the bullet, and order populated PCBs... (costs are not the same...)
Thanks by advance.
this is a ususual question on Arduino forums. AFAIR, the answer is : no !
But what about the STM32 (BluePill).
Is writing from output pins to input pins allowed ?
Not sure it is understandable ! Some explanations about the context...
The STM32F103 has two SPI ports. In my application, they are in use. I'd like to be able to programmatically, at compile time, switch between two SPI "inputs". Ok. SPI1 has an alternate pinout (PA4-PA7/PB5-PB4-PB3-PA15) ; the solution could be compiling for the main one or for the alternate one... Unfortunately, I can't use SPI1 as "input", as the input has to be 5V tolerant (comes from a MEGA). SPI2 is 5V tolerant, and already in use as input.
I've been thinking of using some free 5V tolerant pins and attaching a couple inteerrupt vectors in order to programmatically write to SPI2 ports. Like a internal port duplication.
The other SPI port (SPI1) is the "output", and cannot be used as input (no room on the PCB for MOSFETs as voltage shifters).
The actual schematics uses pin headers and jumpers. I'd like to get rid of them...
I don't have access to my MCUs for now, so I can't test. I'm currently rebuilding my small lab (woodworking, wiring, etc.).
It is a working project (protoboards) I'm enhancing. I can live with jumpers, but don't want to use SMDs ; want to use THT's as I've no SMDs but lots of THTs ! And also lots of BluePills.
I'm out of space. Maybe should I bite the bullet, and order populated PCBs... (costs are not the same...)
Thanks by advance.