PDA

View Full Version : DT Interrupts and HSERIN / HSEROUT



rsocor01
- 12th February 2020, 23:29
Hi,

I'm using the DT USB Interrupts in the link below. In the same program, I'm using a few HSERIN and HSEROUT commands. I know that these two things don't like each other. However, since this DT USB interrupt happens so quickly, I thought that it might not affect the HSERIN and HSEROUT commands at all. Should I disable the interrupts before using these commands?

http://www.picbasic.co.uk/forum/showthread.php?t=13356&p=94292#post94292

richard
- 14th February 2020, 00:45
seems no one else wants to comment
reading the thread you linked it seems that using hserin/out rather than serin/out was the solution for serial comms when a usb int was used.
if you disable usb int for more than 10mS your usb "connection" will be lost

i have no issues using hserout or spi comms with the cdc usb function with the usb int

rsocor01
- 14th February 2020, 04:28
Richard, thanks for the reply. I was concerned that the interrupt might interfere with the HSERIN and HSEROUT commands.

richard
- 14th February 2020, 04:39
hserout could never be affected by interrupts in any normal sort of asynchronous use
hserin will not be affected by interrupts in any normal sort of asynchronous use provided the isr does not take so long as to cause a buffer overrun