I'm having some really odd problems with receiving data over usart using the isrrx2 routine using a 47q43 part. I had a look in the library folder for interrupts and noticed there is a xvISRRX2.bas file should i be using this for the q43 series?.
PS is there a prefered method of checking how much data is in the buffer before reading out the data.
Rich
isrrx routine
Moderators: David Barker, Jerry Messina
-
- Swordfish Developer
- Posts: 1473
- Joined: Fri Jan 30, 2009 6:27 pm
- Location: US
Re: isrrx routine
The xvISRRX2 module is for use with vectored interrupt mode. For "standard" interrupts the ISRRX2 module should work with the Q43.
Currently, there's no function to get the number of bytes in the buffer... if DataAvailable returns true then use ReadByte to get the data
Are you not getting any receive data? Can you expand on "odd problems"?
Currently, there's no function to get the number of bytes in the buffer... if DataAvailable returns true then use ReadByte to get the data
Code: Select all
' read data from the buffer and output...
while ISRRX.DataAvailable
USART.Write(ISRRX.ReadByte)
end while
Re: isrrx routine
I have a work around now but I don't like it.
I have 2 pcb's connected via rs485
if I check ISRRX.DataAvailable too often (1ms) i seem to get modifications to my input string where I collate and check the incoming packet.
even though if i send the input byte to a debug output the bytes coming in are correct.
I know this all sounds a bit mad but if I put a fixed delay after the first time I check ISRRX.DataAvailable then everything comes in fine.
I will come back to this a bit later and try and share some simplified code as it's pretty big and the 2 boards interact.
thanks again
Rich
I have 2 pcb's connected via rs485
if I check ISRRX.DataAvailable too often (1ms) i seem to get modifications to my input string where I collate and check the incoming packet.
even though if i send the input byte to a debug output the bytes coming in are correct.
I know this all sounds a bit mad but if I put a fixed delay after the first time I check ISRRX.DataAvailable then everything comes in fine.
I will come back to this a bit later and try and share some simplified code as it's pretty big and the 2 boards interact.
thanks again
Rich
Hmmm..