Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

wireless ECG using bluetooth module

Status
Not open for further replies.

mednadjib

Newbie level 2
Newbie level 2
Joined
May 2, 2013
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,304
Hi every one,
I'm doing an project in which i'll capture real time ECG signal and convert it in to digital form using PIC16F877A micro-controller , and i will transfer with bluetooth module ARF32, so with my programm, icant simulate it with miKroC,

Please help me with this code :

#include <16F877.h>
#fuses hs, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=20000000)
//============================
float f1,f2,v;
setup_adc_ports(RA0_ANALOG); // pin A0 est une entrée analogique
setup_adc(ADC_CLOCK_INTERNAL); // configure le CAN
void Serial_Init(void); // Initialisation Port série 9600 baud 8 data bit ,1 bit stop, pas de parité
void Serial_Putchar(unsigned char cD); // Cette fonction envoie des données sur le port série
bit bSerie;

delay_ms(300);


void main() //****************** debut Main ******************************
{
GIE=1; PEIE=1; // Autorise les intérruptions
TRISC=0b10000000; // RC7 RX en entré, RC6 TX en sortie
Serial_Init(); // Initialisation port série
}// ************************ fin de main******************************

void Serial_Init(void) // Initialisation Port série 9600 baud 8 data bit, 1 bit stop, pas de parité
{
RCIE=1; // valide l'interruption de réception
RCSTA=0b10010000; // SPEN=1 valide le port série, CREN=1 valide la réception de donnée
TXSTA=0b00100110; // high speed mode brgh1 , TXEN 1 autorise émission de donnée
SPBRG=25; // 9600 baud
bSerie=0; // si 1 traité caractère serie reçu.
}

void Serial_Putchar(unsigned char cD) // Emission de donnée sur le port série
{
while(!TXIF); // si 1 registre d'émission vide, donc on sort de la boucle
TXREG=cD; // On place le caractère cD à envoyer dans le registre TXREG
while(!TRMT); // Lorsque TRMT passe à 1 TXREG recoit la donnée cD
}
 

hey,, there is two pins, RC7 is conected to Tx of bt module as entry, and RC6 to Rx as output,

- - - Updated - - -

how i should compile my programm???
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top