|
|
View previous topic :: View next topic |
Author |
Message |
smit
Joined: 30 Jul 2009 Posts: 2
|
uart don't interrupt |
Posted: Thu Jul 30, 2009 1:15 pm |
|
|
Hi
interrupt doesn't work on circuit. Can you look at the codes and tell me where I'm making wrong?
Code: |
#include <18F4620.h>
#FUSES NOWDT,WDT128,H4,NOPROTECT,BROWNOUT,NOPUT,STVREN,NODEBUG,NOLVP,NOWRT,NOWRTB,NOWRTC,NOCPD,NOCPB,NOEBTR,NOEBTRB,CCP2B3
#device ADC=10
#use delay(clock=32Mhz,oscillator=8Mhz)
#use rs232(baud=9600, uart, parity=N, stop=1,bits=8)
#define FAST_GLCD
#include "HDM64GS12.c"
#include <MATH.H>
#include "graphics.c"
.
.
.
.
.
#INT_RDA
void SeriVeriAl(void)
{
veri=getc();
alll=true;
}
void main(void) // Ana program
{
clear_interrupt(INT_RDA);
enable_interrupts(INT_RDA);
disable_interrupts(INT_timer0);
enable_interrupts(GLOBAL);
setup_adc( ADC_CLOCK_INTERNAL );
setup_adc_ports( AN0_TO_AN2);
do{
if(alll){sprintf(dene3,"G");glcd_text57(15,8,dene3,1,ON);}
}while(TRUE);
}
|
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Jul 30, 2009 1:27 pm |
|
|
What's the reason for the mux ? Your mux is controlled by a PIC pin.
What's the default state of a PIC pin, upon power-on reset ? Fix that,
or get rid of the mux. |
|
|
smit
Joined: 30 Jul 2009 Posts: 2
|
|
Posted: Thu Jul 30, 2009 2:27 pm |
|
|
PIC pin choose one of RS232 modules. PIC pin receives the transmission but doesn't make interrupt. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Jul 30, 2009 2:32 pm |
|
|
Where is the line in your posted code that selects the module ? |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1933 Location: Norman, OK
|
|
Posted: Thu Jul 30, 2009 3:51 pm |
|
|
According to the datasheet pin 7 (Enable/Strobe) must be low and I don't see pin 7 connected in the schematic. It looks like the Enable shows as pin 3 in the drawing but pin 3 is also connected as an input so I may be seeing it wrong. _________________ Google and Forum Search are some of your best tools!!!! |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|