lipooo
Messages postés4Date d'inscriptionvendredi 25 septembre 2009StatutMembreDernière intervention 5 avril 2012
-
3 avril 2012 à 15:09
lipooo
Messages postés4Date d'inscriptionvendredi 25 septembre 2009StatutMembreDernière intervention 5 avril 2012
-
5 avril 2012 à 16:02
bonjour tout le monde,
j'ai un programme en C
qui permet de calculer la fréquence cardiaque et l'affiche sur un lcd(2*16)
const char TIMER_START_VALUE = 8;
const char TIMER_RELOAD_VALUE = 125;
char sec, updateDisplay, reload;
long bat;
char bat_str [] = " ";
// LCD module connections
sbit LCD_RS at RD2_bit;
sbit LCD_EN at RD3_bit;
sbit LCD_D4 at RD4_bit;
sbit LCD_D5 at RD5_bit;
sbit LCD_D6 at RD6_bit;
sbit LCD_D7 at RD7_bit;
sbit LCD_RS_Direction at TRISD2_bit;
sbit LCD_EN_Direction at TRISD3_bit;
sbit LCD_D4_Direction at TRISD4_bit;
sbit LCD_D5_Direction at TRISD5_bit;
sbit LCD_D6_Direction at TRISD6_bit;
sbit LCD_D7_Direction at TRISD7_bit;
// End LCD module connections
}
void main() {
TrisB = 0xFF;
TrisC = 0;
PortC = 0;
TrisD = 0;
PortD = 0;
ADCON0 = 0;
ADCON1 = 0x0F;
Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF);// Cursor off
LCD_Out(1,1,"Heartbeats :"); // Write text in first row
updateDisplay 0; sec 0; reload = 0; bat = 0;
INTCON = 0xC0; // Set GIE, PEIE
INT0IE_bit = 1;
TMR0ON_bit = 0; // turn off the timer during setup
TMR0IE_bit = 1; // Enable TMRO interrupt
T08BIT_bit = 1; // Enable 8 bit control (as opposed to 16-bit)
T0CS_bit = 0; // use internal clock to trigger timer to count
PSA_bit = 0; // Use the prescaler to slow the timer down
T0PS0_bit = 1;
T0PS1_bit = 0;
T0PS2_bit = 1;
TMR0L = TIMER_START_VALUE;
reload = TIMER_RELOAD_VALUE;
TMR0ON_bit = 1; // start the timer
while (1) {
if (UpdateDisplay == 1) {
UpdateDisplay = 0;
WordToStr (bat, bat_str); bat = 0;
LCD_Out(2,1,bat_str);
}
}
}
void Interrupt (void) {
if (INTCON.TMR0IF) {
TMR0L = TIMER_START_VALUE;
T0IF_bit = 0;
if(reload == 0) {
reload = TIMER_RELOAD_VALUE + 1;
sec = sec + 1;
if (sec == 15) {
updateDisplay 1; sec 0;
}
}
reload = reload - 1;
}
if (INTCON.INT0IF) {
bat bat + 1; INT0IF_bit 0;
}
}
la simulation est jointe si dessous.
un modéle simple pour un signal ECG,
la carte d'acquistion du signal contient un pic 16f877 et un emetteur tx433
qui assure la transmission des données vers un recepteur qui est connecté directement avec le pc par le RS232,
(carte de réception contien le rx433,un pic16f876,le max232 et le connecteur RS232),une interface graphique sera crée avec labview,
mon objectif est d'ajouter un programme au précédent permet la transmission du signal réel et son affichage,
cptpingu
Messages postés3837Date d'inscriptiondimanche 12 décembre 2004StatutModérateurDernière intervention28 mars 2023123 3 avril 2012 à 15:46
Bonjour.
Quelle est la question précise ?
Sur quel point de ton code bloques-tu ?
(Je rappelle que l'on ne fournit pas de code, et qu'on ne fait pas la reflexion ou la recherche à la place de l'auteur. en revanche, on corrige des codes avec plaisir).
________________________________________________________________________
Historique de mes créations, et quelques articles:
[ http://0217021.free.fr/portfolio http://0217021.free.fr/portfolio]
Merci d'utiliser Réponse acceptée si un post répond à votre question
lipooo
Messages postés4Date d'inscriptionvendredi 25 septembre 2009StatutMembreDernière intervention 5 avril 2012 3 avril 2012 à 16:54
bon ma question est ; comment je peux transmettre le signal réel obtenue ?c'est a dire la transmission du signal vers le récepteur se fait point par point pour quelle soit durable,