isrrx routine

Coding and general discussion relating to user created compiler modules

Moderators: David Barker, Jerry Messina

Post Reply
richardb
Posts: 310
Joined: Tue Oct 03, 2006 8:54 pm

isrrx routine

Post by richardb » Mon Mar 18, 2024 10:47 am

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
Hmmm..

Jerry Messina
Swordfish Developer
Posts: 1473
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: isrrx routine

Post by Jerry Messina » Mon Mar 18, 2024 9:57 pm

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

Code: Select all

' read data from the buffer and output...
   while ISRRX.DataAvailable
      USART.Write(ISRRX.ReadByte)
   end while
Are you not getting any receive data? Can you expand on "odd problems"?

richardb
Posts: 310
Joined: Tue Oct 03, 2006 8:54 pm

Re: isrrx routine

Post by richardb » Tue Mar 19, 2024 8:14 am

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
Hmmm..

Post Reply