Help me to send ECG wave using 18f452

General discussion on mikroBasic.
Post Reply
Author
Message
nishafonseka
Posts: 1
Joined: 17 Jul 2011 17:39

Help me to send ECG wave using 18f452

#1 Post by nishafonseka » 17 Jul 2011 17:52

Hi friends,
I need help to send a sine wave (analog) to computer via serial port. I am using 18f452 microprocessor to ADC and sending signal to USART. I am using matlab for read serial input.
I am using following program which i written using Mikroc software

unsigned int temp_res;
unsigned int X,Y;
void main() {
ADCON1 = 0x80; // Configure analog inputs and Vref
TRISA = 0xFF; // PORTA is input
TRISB = 0x3F; // Pins RB7, RB6 are outputs
TRISD = 0; // PORTD is output
Usart_Init(9600);
while(1) {
temp_res = Adc_Read(2); // Get results of AD conversion
Delay_Ms(2);



Usart_Write(ADRESL);
Usart_Write(ADRESH);


Delay_us(777);
}
}


but the thing is i cant get expected results from the matlab. If you can suggest a good program for this please reply me soon.
Thanks
Nisha Fonseka

Post Reply

Return to “mikroBasic General”