bhoomi_shah2906
Member level 1
hi..
i am using serial ADC for converting the analog signal in digital...
in this I am using follow code....
for(i=12;i>0;i++)
{
clk_low;
asm("nop");
if ((PINB & 0x01)==0x01) data|=(1<<i);
else data&=~(1<<i);
clk_high;
}
i am reading the data at proper time...
now my problem is it takes so much time for jump and for loop.
it takes around 1.2us after clk_high to go up to clk_low signal..
i want to read the data at faster rate...
so ca anyone suggest me the code which can read the data faster than my this code..
i am using the atmega32 controller with 16MHz crystal frequency..
i am using serial ADC for converting the analog signal in digital...
in this I am using follow code....
for(i=12;i>0;i++)
{
clk_low;
asm("nop");
if ((PINB & 0x01)==0x01) data|=(1<<i);
else data&=~(1<<i);
clk_high;
}
i am reading the data at proper time...
now my problem is it takes so much time for jump and for loop.
it takes around 1.2us after clk_high to go up to clk_low signal..
i want to read the data at faster rate...
so ca anyone suggest me the code which can read the data faster than my this code..
i am using the atmega32 controller with 16MHz crystal frequency..