continuously read serial port data using Matlab & plot it continuously
Hello all,
i am not very much expert in MATLB... i am designing a real time pic microcontroller based ECG system...for that after processing the real time ECG data through PIC16F877a microcontroller than i have to display the real time ECG to an interface in the computer screen
can anybody share me some idea about how to make it??
ryt now i am able to collect the ECG data and process it to the computer UART through pic16f877a microcontroller continuously..
my code is---
#include "built_in.h"
unsigned int adc_rd;
void main()
{
unsigned int temp_res;
Uart1_Init(9600);
ADCON0 = 0xC1;
ADCON1 = 0x8E; // Configure AN0 pin as analog
TRISA = 0xFF; // PORTA is input
TRISC = TRISC & 0xFC; // Pins RC7, RC6 are outputs
TRISB = 0x00; // PORTB is output
Delay_ms(100);
do
{
temp_res = ADC_Read(0); // Get 10-bit results of AD conversion
//UART1_write_text("mukti");
UART1_write(Lo(temp_res)); // Send lower 8 bits to UART
Delay_ms(100);
UART1_write(Hi(temp_res)); // Send upper 8 bits to UART
Delay_ms(100);
PORTB = Lo(temp_res); // Send lower 8 bits to PORTB
PORTC = Hi(temp_res); // Send 2 most significant bits to RC7, RC6
}while(1);
}
now i have to show it matlab...