kookooli
Junior Member level 3
Hi friends...
I have a problem , i was woundering if someone can help me ...
i want to make samples from a signal every 3.5us approximately.
this is my code :
i turn on a timer just before sampling and turn the timer off after sampling is finished.
my problem is here that every sampling process would be approximately 6us
but we know that base on LPC2368 datasheet every sampling process time should be about 2.5us but i dont know why i cant reach that speed ?
I have a problem , i was woundering if someone can help me ...
i want to make samples from a signal every 3.5us approximately.
this is my code :
Code:
unsigned short read_adc(void){
AD0CR&=0xFFFFFF00;
AD0CR|=(1<<24)|(1<<4)|(1<<16);
while((AD0DR4&0x80000000)==0);
AD0CR&=0xF8FFFFFF;
return((AD0DR4>>6)&0x03FF);
}
i turn on a timer just before sampling and turn the timer off after sampling is finished.
my problem is here that every sampling process would be approximately 6us
but we know that base on LPC2368 datasheet every sampling process time should be about 2.5us but i dont know why i cant reach that speed ?
Last edited by a moderator: