Hello,
I start saying that I don’t have experience with microcontrollers and with Arduino. I'm working on a project to develop a new device and I'm considering buying a microcontroller on Arduino card. I would need some advice.
In my application I would need to use the same port as input and output, not at the same time. An example of application might be:
the port provides 5 V output for 100 microseconds;
waiting time of about 10 microseconds;
the port reads the incoming signal for another 100 (or 90) microseconds;
again 5 V output and so on ...
Is it feasible, even in terms of switching rate of the port from output to input?
What card would you recommend?
A clarification, I forgot to write: the 5 V I would like to output are 5 Vac (30 to 70 kHz) and, consequently, also the read signal will be ac (same frequency)
So, to generate a 40 kHz square wave I could change from 0 V to 5 V every 12.5 microseconds; that signal would excite my system for 100 microseconds, and then I could switch the port to read the response of my device for the next 100 microseconds. The reading will be digital, I suppose. I mean, by reading fast enough I could reconstruct the response to the 40 kHz signal, but, since the response signal will be quite low (some mV) I will need a ADC before.
I mean, by reading fast enough I could reconstruct the response to the 40 kHz signal, but, since the response signal will be quite low (some mV) I will need a ADC before.
On the Arduino Uno, the ADC takes by default about 110 microseconds to do a conversion. Higher sample rates are possible, with loss of resolution.
davide_PdP:
In my application I would need to use the same port as input and output, not at the same time
I think you mean pin, not port. In a microcontroller is port is a set of pins, usually of related function,
that map to a memory address in the address-map of the processor.
Yes you can change a pin from input to output and back again however you like.
Thank you all for the answers. So, I have to pay attention to the ADC sampling rate.
I will see what I manage to do and, in case, I will come back to ask for further help