Mikroc uart

Fermé
mido - 3 mars 2011 à 14:52
Bonjour,

Bonjour,
je suis un débutant en mikroc ,je travail un programme sur pic 18F4520 le sujet et la suite :je veux envoyer et recevoir sur la port RX une chaîne caractère puis afficher sur un LCD en utiliser l'interruption s'il vous plais aidez moi de trouve les erreur car le programme si dessous et compiler mais la simulation sur ISIS7 ne fonctionne pas et merci
sbit LCD_RS at RC4_bit;
sbit LCD_EN at RC5_bit;
sbit LCD_D7 at RC3_bit;
sbit LCD_D6 at RC2_bit;
sbit LCD_D5 at RC1_bit;
sbit LCD_D4 at RC0_bit;
// Pin direction
sbit LCD_RS_Direction at TRISC4_bit;
sbit LCD_EN_Direction at TRISC5_bit;
sbit LCD_D7_Direction at TRISC3_bit;
sbit LCD_D6_Direction at TRISC2_bit;
sbit LCD_D5_Direction at TRISC1_bit;
sbit LCD_D4_Direction at TRISC0_bit;
void interupt();
unsigned char RFID[5];
int cmp=0;
int i=0;
void main ()
{
INTCON = 0xC0;
TXSTA|=0x2E;
RCSTA|=0x90;
TRISC=0x00;
PORTC=0x00;
Lcd_Init();
lcd_cmd(_lcd_clear);
lcd_Cmd(_LCD_CURSOR_OFF);
while(1)
{
uart1_init(9600);
Delay_ms(100);
uart1_write_text("hamdi");
lcd_chr(1,i+1,RFID[cmp-1]);
i++;
if (i==5)
{i=0;
}
}
}
void interupt()
{
if (PIR1.RCIF==1)
{
RFID[cmp]=RCREG;
cmp++;
PIR1.RCIF=0;
}
}