Smartio LUTs to cycle between 3 GPIO Pins - what is the best approach?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
dk
Level 1
Level 1
5 questions asked First comment on blog 5 likes given

Hi, I am trying to wrap my head around a potential smartio use:

Goal: Deterministic cycling between three GPIO signals that control isolated FETs to toggle between three voltage levels on *one* output pin. To avoid shorts, only one signal may be high, and a dead time between switching would be helpful. In the end I'd like to have a function that enables the smartio voltage cycling like cycle_voltage(count,ontime,deadtime);

Signal pins: SIG_GND, SIG_MID, SIG_HIGH -> controlling the external 0V, 75V, 135V switching in my application:

SIG_HIGH=1                          ________                                           135V              
                                                    |                 |
SIG_LOW=1           _______|                 |               ______...          75V
                                   |                                  |               |
SIG_GND=1 ____|                                  |______ |                            0V

Desired toggle behavior: 100-500uS signal high, then 0-1uS dead time, then signal high for next SIG_ pin. 

Questions:
- I want to 1) cycle and 2) control signal high time for each signal and dead time from firmware. How do I think of this problem in terms of Chip inputs, clocks and perhaps chained LUTs?
- Can I link the SAR ADC's EOS trigger to start the smartio cycling?
- Alternatively, would it be possible in smartio to start the ADC on the first voltage cycling and snapshot scan every X cycles? 

Thanks! 

0 Likes
1 Solution
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

To have repeatable deterministic timing one can use  DMA writing to the port from cyclical RAM buffer. It is quite deterministic if there are no other concurrent DMA. 

PS. Looks like an ion mobility sensor.. 

View solution in original post

0 Likes
6 Replies
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi,

I am not quite sure about the requirement with Smart IO here. How do you want the LUT to be configured ?

Regarding the second and third question, ADC trigger input can be an be driven by an LUT output if you see the configuration. This way it can be used to trigger a conversion.

Vasanth_0-1632391652911.png

 



Best Regards,
Vasanth

0 Likes
dk
Level 1
Level 1
5 questions asked First comment on blog 5 likes given

Thanks for the input. 

I'd like to implement the switching logic without CPU intervention, to avoid jitter. This is important because it would change timings in our sensor.

I basically want a logic table that quickly switches 3 output pins given two inputs: The clock and the input state. Clock would be 2-4 kHz, which is the required switching frequency for the ion shutter. 

I am not sure whether smartio is helpful here. What would you use to be as close to deterministic switching as possible?  With software GPIO switching we see ~0.5 - 1 uS delay between switching one pin high and one pin low depending on the microcontroller. What is the best way to quickly switch a pattern of pins in your eyes?  

Thanks,
Dirk 

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

To have repeatable deterministic timing one can use  DMA writing to the port from cyclical RAM buffer. It is quite deterministic if there are no other concurrent DMA. 

PS. Looks like an ion mobility sensor.. 

0 Likes
dk
Level 1
Level 1
5 questions asked First comment on blog 5 likes given

Thanks, I will explore that route. 

Great guess! It’s a GC-IMS. We’re trying to integrate as many functions as possible into the psoc. We want to avoid an FPGA solution. Feature set is controlling heating, solenoid switching, ion shutter operation, elution and drift time measurement and of course the ADC. Then we use a in-browser interface to manage the data and unify the GC and IMS timing dimensions. We want to use it for food audits.

If you don’t mind asking, do you have experience in writing sensor firmware? We are looking for freelancers. 

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Dirk,

I built a GC-IMS some 20 years ago. It didn't make me rich. As one of the potential applications was also meat quality control. There is nothing  new under the sun... 

dk
Level 1
Level 1
5 questions asked First comment on blog 5 likes given

Wise words 🙂

0 Likes