<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>MEL PICBASIC Forum - PBP3</title>
		<link>https://www.picbasic.co.uk/forum/</link>
		<description>Discussion related to the PBP3 compiler</description>
		<language>en</language>
		<lastBuildDate>Fri, 06 Mar 2026 14:58:50 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>https://www.picbasic.co.uk/forum/images/misc/rss.png</url>
			<title>MEL PICBASIC Forum - PBP3</title>
			<link>https://www.picbasic.co.uk/forum/</link>
		</image>
		<item>
			<title>18F2580 with strange behaviour when using Hserin and RX interrupt</title>
			<link>https://www.picbasic.co.uk/forum/showthread.php/27108-18F2580-with-strange-behaviour-when-using-Hserin-and-RX-interrupt?goto=newpost</link>
			<pubDate>Sun, 15 Feb 2026 15:48:54 GMT</pubDate>
			<description><![CDATA[Hi guys, 
 
I'm facing a weird behaviour with my 18F2580 using Hserin and RX interrupts and I was hoping someone could help. 
 
 
I'm trying to run a...]]></description>
			<content:encoded><![CDATA[<div>Hi guys,<br />
<br />
I'm facing a weird behaviour with my 18F2580 using Hserin and RX interrupts and I was hoping someone could help.<br />
<br />
<br />
I'm trying to run a code that when an incoming 2 characters is received, it triggers the interrupt and reads the message.<br />
Once it reads the message, it goes back the the main routine.<br />
<br />
The issue is that, once it is turned on, it does not show the correct characters being sent.<br />
However, the interrupt trigger is being done and once it reads the message, goes back to the main routine.<br />
<br />
But if I send a long message, from that point on, it will show the correct characters being sent but no longer goes back to the main routine!<br />
<br />
Not sure why it does not show the correct message in the first place and also, can't understand why it fails to jump from the interrupt routine back to the main routine!<br />
<br />
The message is being sent via bluetooth with a BT module connected directly to the MCU.<br />
The TX from the MCU is disabled because i only need to receive and not transmit.<br />
<br />
I filmed this behaviour which can be seen in the link below.<br />
<br />
This is the code:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"><br />
'****************************************************************<br />
'*&nbsp; Name&nbsp; &nbsp; : IC_3_COMTEST2.PBP&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  *<br />
'*&nbsp; Author&nbsp; :&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  *<br />
'*&nbsp; Notice&nbsp; : Copyright (c) 2024 [select VIEW...EDITOR OPTIONS] *<br />
'*&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : All Rights Reserved&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  *<br />
'*&nbsp; Date&nbsp; &nbsp; : 19/12/2024&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *<br />
'*&nbsp; Version : 1.0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  *<br />
'*&nbsp; Notes&nbsp;  : 18F2580 MCU&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  *<br />
'*&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  *<br />
'****************************************************************<br />
'<br />
;----[18F2580 Hardware Configuration]-------------------------------------------<br />
#IF __PROCESSOR__ = &quot;18F2580&quot;<br />
&nbsp; #DEFINE MCU_FOUND 1<br />
#CONFIG<br />
&nbsp; CONFIG&nbsp; OSC = IRCIO67&nbsp; &nbsp; &nbsp; ; Internal oscillator block, port function on RA6 and RA7<br />
&nbsp; CONFIG&nbsp; FCMEN = ON&nbsp; &nbsp; &nbsp; &nbsp; ; Fail-Safe Clock Monitor ENABLED<br />
&nbsp; CONFIG&nbsp; IESO = OFF&nbsp; &nbsp; &nbsp; &nbsp;  ; Oscillator Switchover mode disabled<br />
&nbsp; CONFIG&nbsp; PWRT = OFF&nbsp; &nbsp; &nbsp; &nbsp;  ; PWRT disabled<br />
&nbsp; CONFIG&nbsp; BOREN = OFF&nbsp; &nbsp; &nbsp; &nbsp; ; Brown-out Reset disabled in hardware and software<br />
&nbsp; CONFIG&nbsp; BORV = 3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ; VBOR set to 2.1V<br />
&nbsp; CONFIG&nbsp; WDT = ON&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ; WDT ENABLED (control is placed on the SWDTEN bit)<br />
&nbsp; CONFIG&nbsp; WDTPS = 512&nbsp; &nbsp; &nbsp; &nbsp; ; 1:512<br />
&nbsp; CONFIG&nbsp; PBADEN = OFF&nbsp; &nbsp; &nbsp;  ; PORTB&lt;4:0&gt; pins are configured as digital I/O on Reset<br />
&nbsp; CONFIG&nbsp; LPT1OSC = OFF&nbsp; &nbsp; &nbsp; ; Timer1 configured for higher power operation<br />
&nbsp; CONFIG&nbsp; MCLRE = OFF&nbsp; &nbsp; &nbsp; &nbsp; ; RE3 input pin enabled; MCLR disabled<br />
&nbsp; CONFIG&nbsp; STVREN = OFF&nbsp; &nbsp; &nbsp; &nbsp; ; Stack full/underflow will NOT cause Reset<br />
&nbsp; CONFIG&nbsp; LVP = OFF&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; Single-Supply ICSP disabled<br />
&nbsp; CONFIG&nbsp; BBSIZ = 1024&nbsp; &nbsp; &nbsp;  ; 1K words (2K bytes) boot block<br />
&nbsp; CONFIG&nbsp; XINST = OFF&nbsp; &nbsp; &nbsp; &nbsp; ; Instruction set extension and Indexed Addressing mode disabled (Legacy mode)<br />
&nbsp; CONFIG&nbsp; DEBUG = OFF&nbsp; &nbsp; &nbsp; &nbsp; ; Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins<br />
&nbsp; CONFIG&nbsp; CP0 = OFF&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; Block 0 (000800-001FFFh) not code-protected<br />
&nbsp; CONFIG&nbsp; CP1 = OFF&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; Block 1 (002000-003FFFh) not code-protected<br />
&nbsp; CONFIG&nbsp; CP2 = OFF&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; Block 2 (004000-005FFFh) not code-protected<br />
&nbsp; CONFIG&nbsp; CP3 = OFF&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; Block 3 (006000-007FFFh) not code-protected<br />
&nbsp; CONFIG&nbsp; CPB = OFF&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; Boot block (000000-0007FFh) not code-protected<br />
&nbsp; CONFIG&nbsp; CPD = OFF&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; Data EEPROM not code-protected<br />
&nbsp; CONFIG&nbsp; WRT0 = OFF&nbsp; &nbsp; &nbsp; &nbsp;  ; Block 0 (000800-001FFFh) not write-protected<br />
&nbsp; CONFIG&nbsp; WRT1 = OFF&nbsp; &nbsp; &nbsp; &nbsp;  ; Block 1 (002000-003FFFh) not write-protected<br />
&nbsp; CONFIG&nbsp; WRT2 = OFF&nbsp; &nbsp; &nbsp; &nbsp;  ; Block 2 (004000-005FFFh) not write-protected<br />
&nbsp; CONFIG&nbsp; WRT3 = OFF&nbsp; &nbsp; &nbsp; &nbsp;  ; Block 3 (006000-007FFFh) not write-protected<br />
&nbsp; CONFIG&nbsp; WRTC = OFF&nbsp; &nbsp; &nbsp; &nbsp;  ; Configuration registers (300000-3000FFh) not write-protected<br />
&nbsp; CONFIG&nbsp; WRTB = OFF&nbsp; &nbsp; &nbsp; &nbsp;  ; Boot block (000000-0007FFh) not write-protected<br />
&nbsp; CONFIG&nbsp; WRTD = OFF&nbsp; &nbsp; &nbsp; &nbsp;  ; Data EEPROM not write-protected<br />
&nbsp; CONFIG&nbsp; EBTR0 = OFF&nbsp; &nbsp; &nbsp; &nbsp; ; Block 0 (000800-001FFFh) not protected from table reads executed in other blocks<br />
&nbsp; CONFIG&nbsp; EBTR1 = OFF&nbsp; &nbsp; &nbsp; &nbsp; ; Block 1 (002000-003FFFh) not protected from table reads executed in other blocks<br />
&nbsp; CONFIG&nbsp; EBTR2 = OFF&nbsp; &nbsp; &nbsp; &nbsp; ; Block 2 (004000-005FFFh) not protected from table reads executed in other blocks<br />
&nbsp; CONFIG&nbsp; EBTR3 = OFF&nbsp; &nbsp; &nbsp; &nbsp; ; Block 3 (006000-007FFFh) not protected from table reads executed in other blocks<br />
&nbsp; CONFIG&nbsp; EBTRB = OFF&nbsp; &nbsp; &nbsp; &nbsp; ; Boot block (000000-0007FFh) not protected from table reads executed in other blocks<br />
#ENDCONFIG<br />
<br />
<br />
#ENDIF<br />
<br />
<br />
;----[Verify Configs have been specified for Selected Processor]----------------<br />
;&nbsp; &nbsp; &nbsp;  Note: Only include this routine once, after all #CONFIG blocks<br />
#IFNDEF MCU_FOUND<br />
&nbsp; #ERROR &quot;No CONFIGs found for [&quot; + __PROCESSOR__ +&quot;]&quot;<br />
#ENDIF<br />
<br />
<br />
'*****************************************************************************<br />
<br />
<br />
OSCCON =%01110010 '8MHz INTOSC <br />
OSCTUNE=%01000000 '<br />
<br />
<br />
DEFINE OSC 8<br />
<br />
<br />
'*****************************************************************************<br />
<br />
<br />
INCLUDE &quot;ALLDIGITAL.pbp&quot;<br />
DEFINE SHOWDIGITAL 1<br />
<br />
<br />
'*****************************************************************************<br />
<br />
<br />
Define HSER_BAUD 9600<br />
DEFINE HSER_RCSTA 90h ' Enable serial port &amp; continuous receive<br />
'DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1<br />
DEFINE HSER_SPBRG 12&nbsp; ' <br />
DEFINE HSER_CLROERR 1 ' Clear overflow automatically<br />
'DEFINE HSER_CLEAR = On<br />
<br />
<br />
<br />
<br />
RXBYTE&nbsp; VAR BYTE<br />
RXFLAG&nbsp; VAR BIT<br />
RX1 VAR BYTE<br />
RX2 VAR BYTE<br />
RX3 VAR BYTE<br />
RX4 VAR BYTE<br />
RX5 VAR BYTE<br />
RX6 VAR BYTE<br />
<br />
<br />
<br />
<br />
CT&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BYTE<br />
CT2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BYTE<br />
<br />
<br />
INTFLAG&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BYTE<br />
MOODCHANGE&nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WORD<br />
<br />
<br />
'PIE1.5 = 1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ' RCIE<br />
INTCON = %11000000&nbsp; &nbsp; &nbsp; ' GIE + PEIE<br />
<br />
<br />
'*****************************************************************************<br />
<br />
<br />
PORTA=%00000000<br />
PORTB=%00000000<br />
PORTC=%00000000<br />
<br />
<br />
TRISA=%00000000&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
TRISB=%00000000<br />
TRISC=%10000000&nbsp;  'RC7 - RX pin as input<br />
<br />
<br />
'*****************************************************************************<br />
'PORTS &amp; PINS <br />
<br />
<br />
A0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; PORTA.0&nbsp;  '<br />
A1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; PORTA.1&nbsp;  '<br />
A2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; PORTA.2&nbsp;  '<br />
A3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; PORTA.3&nbsp;  '<br />
A4&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; PORTA.4&nbsp;  '<br />
A5&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; PORTA.5&nbsp;  '<br />
A6&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; PORTA.6&nbsp;  '<br />
LED1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; PORTA.7&nbsp;  '<br />
<br />
<br />
B0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; PORTB.0&nbsp;  '<br />
B1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; PORTB.1&nbsp;  '<br />
B2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; PORTB.2&nbsp;  '<br />
B3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; PORTB.3&nbsp;  '<br />
LED2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; PORTB.4&nbsp;  '<br />
B5&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; PORTB.5&nbsp;  '<br />
B6&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; PORTB.6&nbsp;  '<br />
B7&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; PORTB.7&nbsp;  '<br />
<br />
<br />
C0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; PORTC.0&nbsp;  '<br />
C1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; PORTC.1&nbsp;  '<br />
C2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; PORTC.2&nbsp;  '<br />
C3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; PORTC.3&nbsp;  '<br />
C4&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; PORTC.4&nbsp;  '<br />
C5&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VAR&nbsp; PORTC.5&nbsp;  '<br />
IC_TX&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  VAR&nbsp; PORTC.6&nbsp;  'TX HARDWARE PIN / Not Used as TX<br />
IC_RX&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  VAR&nbsp; PORTC.7&nbsp;  'RX HARDWARE PIN<br />
<br />
<br />
INCLUDE &quot;modedefs.bas&quot; <br />
<br />
<br />
'[DISPLAY SETTINGS]*****************************************************************************<br />
<br />
<br />
char var byte<br />
x&nbsp; &nbsp; var byte&nbsp; <br />
y&nbsp; &nbsp; var byte&nbsp; &nbsp; <br />
BUFF VAR BYTE[16]<br />
<br />
<br />
;use this define for hw i2c <br />
'#define hwi2c 1 <br />
<br />
<br />
;set and uncomment these to use softi2c<br />
SCL var PortA.6&nbsp; &nbsp; &nbsp; ' I2C Clock<br />
SDA var PortC.0&nbsp; &nbsp; &nbsp; ' I2C Data<br />
<br />
<br />
;set these&nbsp; to match display<br />
ssdheight con 3&nbsp; &nbsp; &nbsp; ; 7 = 8 PAGES&nbsp; 64*128 ,&nbsp; 3 = 4 pages 32*128<br />
ssdwidth&nbsp; con 127&nbsp; &nbsp; ; 128 PIXELS WIDE<br />
sdd1306_addr con $78<br />
Include &quot;ssd1306_I2C.INC&quot;&nbsp; ' bring it in<br />
include &quot;font7x5_18.bas&quot;<br />
<br />
<br />
'[INTERRUPT SETTINGS]*****************************************************************************<br />
<br />
<br />
<br />
<br />
INCLUDE &quot;DT_INTS-18.bas&quot;<br />
INCLUDE &quot;ReEnterPBP-18.bas&quot;<br />
<br />
<br />
ASM<br />
INT_LIST&nbsp; macro&nbsp; &nbsp; ; IntSource, Label, Type, ResetFlag?<br />
&nbsp; &nbsp; INT_Handler&nbsp;  RX_INT, _RxISR,&nbsp;  PBP,&nbsp; yes<br />
&nbsp; &nbsp; ENDM<br />
&nbsp; &nbsp; INT_CREATE<br />
&nbsp; &nbsp; INT_ENABLE&nbsp; &nbsp; RX_INT&nbsp; ;enables external (INT) interrupts<br />
ENDASM<br />
<br />
<br />
'*****************************************************************************<br />
<br />
<br />
'wsave var byte $20 system ;location for W if in bank0<br />
'wsave var byte $70 system ;location for W if in bank0<br />
'..... If any of these next three lines cause an error ...Comment them out to fix the problem...<br />
'............which variables are needed, depends on the chip you are using.......<br />
wsave1 var byte $A0 system ;location for W if in bank0<br />
wsave2 var byte $120 system ;location for W if in bank0<br />
wsave3 var byte $1A0 system ;location for W if in bank0<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
'[INIT]*****************************************************************************<br />
<br />
<br />
INIT:<br />
<br />
<br />
clear<br />
<br />
<br />
PORTB=%00000000<br />
<br />
<br />
BIG_TEXT = 0<br />
<br />
<br />
PAUSE 1000<br />
<br />
<br />
high led1<br />
high led2<br />
pause 500<br />
low led1<br />
low led2<br />
<br />
<br />
PAUSE 500<br />
<br />
<br />
gosub glcd_init<br />
GLCD_CLR<br />
ARRAYWRITE BUFF,[&quot;INIT OK&quot;,0]<br />
GLCDSTR&nbsp; 0,0,BUFF<br />
<br />
<br />
PAUSE 500<br />
<br />
<br />
goto main<br />
<br />
<br />
'[MAIN ROUTINE]*****************************************************************************<br />
<br />
<br />
main:<br />
<br />
<br />
gosub glcd_init<br />
GLCD_CLR<br />
ARRAYWRITE BUFF,[&quot;WAITING&quot;,0]<br />
GLCDSTR&nbsp; 0,0,BUFF<br />
<br />
<br />
toggle LED1<br />
<br />
<br />
pause 1000<br />
<br />
<br />
gosub calculat<br />
<br />
<br />
goto main<br />
<br />
<br />
'[INTERRUPT ROUTINE]*****************************************************************************<br />
<br />
<br />
RxISR:<br />
<br />
<br />
<br />
<br />
HSERIN [RX1, RX2, RX3, rx4]<br />
<br />
<br />
'ASCII TO DECIMAL CONVERSION<br />
rx1 = (rx3 - &quot;0&quot;) * 10<br />
rx1 = rx1 + (rx4 - &quot;0&quot;)<br />
<br />
<br />
gosub glcd_init<br />
GLCD_CLR<br />
ARRAYWRITE BUFF,[&quot;RX1= &quot;, dec RX1,0]<br />
GLCDSTR&nbsp; 0,0,BUFF<br />
<br />
<br />
PAUSE 1000<br />
<br />
<br />
@ INT_RETURN<br />
<br />
<br />
'[CONFIRMATION ROUTINE]*****************************************************************************<br />
<br />
<br />
calculat:<br />
<br />
<br />
<br />
<br />
if RX1=57 then<br />
<br />
<br />
gosub glcd_init<br />
GLCD_CLR<br />
ARRAYWRITE BUFF,[&quot;GOOD DATA RECEIVED&quot;,0]<br />
GLCDSTR&nbsp; 0,0,BUFF<br />
<br />
<br />
PAUSE 500<br />
high led2<br />
PAUSE 5000<br />
LOW led2<br />
<br />
<br />
endif<br />
<br />
<br />
<br />
<br />
return<br />
<br />
<br />
'*****************************************************************************<br />
end</code><hr />
</div>Link for the video showing how it behaves:<br />
<a href="https://www.canva.com/design/DAHBZ6VgQfI/pRHYJ7z5Ci2NSus0BYBpFg/edit?utm_content=DAHBZ6VgQfI&amp;utm_campaign=designshare&amp;utm_medium=link2&amp;utm_source=sharebutton" target="_blank">https://www.canva.com/design/DAHBZ6V...ce=sharebutton</a><br />
<br />
Thanks in advance for any tips on how to get this code working as it is supposed to.</div>

]]></content:encoded>
			<category domain="https://www.picbasic.co.uk/forum/forumdisplay.php/37-PBP3">PBP3</category>
			<dc:creator>PaulMaker</dc:creator>
			<guid isPermaLink="true">https://www.picbasic.co.uk/forum/showthread.php/27108-18F2580-with-strange-behaviour-when-using-Hserin-and-RX-interrupt</guid>
		</item>
	</channel>
</rss>
