Not sure if this is going to Bobby. If so, hi Bobby long time no talk to.
Anyway, I am now trying to use INTA for my TX/RX ISR. Everything is working well for the 40 byte command/response data transferred between the two processors.
The problem I am having is with the large block data (292 byte response packet). This would require four 60 byte blocks and one 52 byte block left over.
When I set the 485LG bit and start transmitting the 292 byte packet, I can't get the streaming of the data to work.
My question is this:
Should the THR Space Available Interrupt continue to be set?
I'm using the following setup when getting ready to send 292 bytes:
- TLR value set to 0x0F (60 Byte Tx FIFO)
- 485LG bit set to 1
- 485EN bit set to 1
- RCVEN bit set to 1
- RHR Interrupt Enabled
- THR Interrupt Enabled
- IRQA Enabled
Inside the ISR I perform the following:
- Read the IIR
- A switch statement acts on the active interrupt
- RHR Interrupt reads the request packet and generates a response packet( in this case 292 bytes)
- Once the response packet is generated, the THR interrupt is enabled
- Inside the THR case, transmit a byte and re enable the THR Interrupt until finished with the 292 bytes
- Once finished, disable the THR Interrupt
- Receive the next request and generate the response again.
Do I need to actually break the transmission into four 60 byte blocks and the final 52 byte block?
When getting ready for the 52 byte block, do I need to set the 485LG bit to 0?
Thank you for the help,
Reif Heck