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.

UART interrupt not returnning to main programm

Status
Not open for further replies.

niloufar-navidi

Junior Member level 1
Joined
Mar 4, 2010
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,291
Activity points
1,454
UART interrupt not returnning to the main programm (loop)

Hi
I have written this code for UART interruption with basic language for basscom but when the first interrupt occurs it does not return into the loop and it displays HI over and over again on the lcd , Would you please help me with it ?


Code Basic4GL - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$regfile = "M32DEF.DAT"
$crystal = 12000000
$baud = 9600
Config Lcdpin = Pin , Db4 = Portb.4 , Db5 = Portb.5 , Db6 = Portb.6 , Db7 = _
Portb.7 , E = Portb.3 , Rs = Portb.2
Config Lcd = 16 * 2
 
 
On Urxc Intlab Nosave
Enable Urxc
Enable Interrupts
 
Cls
Cursor Off
 
Do
Cls
Loop
 
 
End
 
Intlab:
 
Lcd "Hi"
 
Return
End

 
Last edited by a moderator:

Don't you have to clear the interrupt flag in the interrupt routine?
Interrupt flag clearing may be possibly performed by the compiler automatically , but you'll at least need to read the UART RX buffer before, which is obviously missing in the code.
 
Interrupt flag clearing may be possibly performed by the compiler automatically , but you'll at least need to read the UART RX buffer before, which is obviously missing in the code.

Thanks so much it helped me a lot I am using udr flags .
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top