Dear friends! Please, help me to solve one trouble.
I have connected R-2R DAC to ATmega32A on port P.
Digit capacity of DAC is 8 bits, so far as all of outputs of P are attach to R-2R DAC .
This code shall assign on port P:
PORTP=00000001;
PORTP=00000010;
PORTP=00000100;
PORTP=00001000;
etc.
PORTP=11111111;
This code manage R-2R DAC which forms output voltage.
Output voltage is minimum when code is 00000001.
Output voltage is maximum when code is 11111111.
My question: How to write the cycle for such code?
P.S Write the code sorting all importances from 00000001 before 11111111 is not good.
I have connected R-2R DAC to ATmega32A on port P.
Digit capacity of DAC is 8 bits, so far as all of outputs of P are attach to R-2R DAC .
This code shall assign on port P:
PORTP=00000001;
PORTP=00000010;
PORTP=00000100;
PORTP=00001000;
etc.
PORTP=11111111;
This code manage R-2R DAC which forms output voltage.
Output voltage is minimum when code is 00000001.
Output voltage is maximum when code is 11111111.
My question: How to write the cycle for such code?
P.S Write the code sorting all importances from 00000001 before 11111111 is not good.
Last edited: