Arduino digital I/O

2 visualizaciones (últimos 30 días)
David McQueen
David McQueen el 11 de Dic. de 2019
Respondida: Rohan Kale el 14 de Feb. de 2020
I am using an Arduino Mega 2560 to control a 5-bit parallel digital RF attenuator. At this time I am sending 1 bit at a time with 'writeDigitalPin', which is slow. Is there such a thing as 'writeDigitalWord' so I can write all 5 bits at once? Dave

Respuestas (1)

Rohan Kale
Rohan Kale el 14 de Feb. de 2020
It is my understanding that you are trying to write an attenuation value by setting the 5-bits of the attenuator simultaneously. I also think that the timing of the control waveforms, i.e. the RF attenuation bits, may be critical as far as varying the RF power attenuation in realtime is concerned. However, there are no such methods/APIs as of R2019b under the MATLAB® Support Package for Arduino® hardware, which might provide a functionality to write the Arduino board's port pins simulatenously, i.e port write.
But I think you may consider a quick workaround using shiftregisters to write approproiate data to the RF attenuator, if it is not too much of a modificaiton to your hardware setup. Please refer to the documentation page on working with the shift register using MATLAB®:

Categorías

Más información sobre MATLAB Support Package for Arduino Hardware en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by