Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 17:42 28 Nov 2024 Privacy Policy
Jump to

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: Germany
Posts: 554
Posted: 04:21pm 27 May 2023
Copy link to clipboard 
Print this post


Plasma
 
Plasmamac

Guru

Joined: 31/01/2019
Location: Germany
Posts: 554
Posted: 04:29pm 27 May 2023
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 6798
Posted: 04:39pm 27 May 2023
Copy link to clipboard 
Print this post

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: Netherlands
Posts: 4247
Posted: 08:19pm 27 May 2023
Copy link to clipboard 
Print this post

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: Germany
Posts: 554
Posted: 08:45pm 27 May 2023
Copy link to clipboard 
Print this post

i will switching sd card signals.
Plasma
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 09:25pm 27 May 2023
Copy link to clipboard 
Print this post

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: Germany
Posts: 554
Posted: 11:19pm 27 May 2023
Copy link to clipboard 
Print this post

thx i will give it a try
Plasma
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 07:06am 28 May 2023
Copy link to clipboard 
Print this post

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: Netherlands
Posts: 4247
Posted: 03:02pm 28 May 2023
Copy link to clipboard 
Print this post

  Mixtel90 said  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.


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 Kingdom
Posts: 6798
Posted: 04:08pm 28 May 2023
Copy link to clipboard 
Print this post

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


To reply to this topic, you need to log in.

© JAQ Software 2024