Arduino digital I/O

1 回表示 (過去 30 日間)
David McQueen
David McQueen 2019 年 12 月 11 日
回答済み: Rohan Kale 2020 年 2 月 14 日
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

回答 (1 件)

Rohan Kale
Rohan Kale 2020 年 2 月 14 日
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®:

カテゴリ

Help Center および File ExchangeMATLAB Support Package for Arduino Hardware についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by