Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Switching output pin via gpio ?
Author | Message | ||||
Plasmamac Guru Joined: 31/01/2019 Location: GermanyPosts: 554 |
Plasma |
||||
Plasmamac Guru Joined: 31/01/2019 Location: GermanyPosts: 554 |
Hi , i have 5 signal input pins and need to translate the status to other 5 output ( lets say port 2) and will switch When to other pins ( lets say Port3) via software. Is this possible with gpio assembler? Thx Like a switch relay with 5 input and 10 output pins Edited 2023-05-28 02:34 by Plasmamac Plasma |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6798 |
You don't need a PIO. Have a look at the PORT command. (Hint: as a command it writes to multiple pins, as a function it reads from multiple pins) Edited 2023-05-28 04:19 by Mixtel90 Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4247 |
When the input signals (the 5) are high speed (10kHz and higher) you need PIO to do this. But when the inputs change slower you can use the PORT command to do this very efficient. Volhout PicomiteVGA PETSCII ROBOTS |
||||
Plasmamac Guru Joined: 31/01/2019 Location: GermanyPosts: 554 |
i will switching sd card signals. Plasma |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4247 |
Use hardware to do that. Impossible in mmbasic, Pio could do it, but is easier to take a 74hc244 and use each enable to select a set of 4 buffers. Much less chance for latecy problems when pio has delays. Volhout Edited 2023-05-28 07:30 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
Plasmamac Guru Joined: 31/01/2019 Location: GermanyPosts: 554 |
thx i will give it a try Plasma |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6798 |
A couple of CD4066 quad bilateral switch chips (one for each SD) might work here as they are bi-directional. Actually, you only need to switch CS. All other connections can be bussed. However. You may have trouble with MMBasic. It's not designed to handle two SD cards. Edited 2023-05-28 17:09 by Mixtel90 Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4247 |
Mick, carefull. When powered from 3.3V the 4066's can be more than 1000 ohm. See this screenshot from the datasheet. When running at 5V it is already 400-500 ohm. PicomiteVGA PETSCII ROBOTS |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6798 |
Good point. I'd forgotten why I didn't use the 4066 as a joystick A/B switch when I was designing the PicoGAME. :) They took up too much space too. Luckily, just switching CS will do for SPI. A quad 2-input NAND will do it nicely. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Print this page |