Page 1 of 1

Interrupt UART RXINT1 on dsPIC 33EP256MU806

Posted: Fri Mar 27, 2020 12:06 pm
by kadlcak
Hi,
in my program I use Interrupt UART RXINT1 on dsPIC 33EP256MU806 with internal clock (frequency 7.37 MHz). The program works correctly for about 2 minutes. Then the processor restarts ??? Please can someone advise me where the fault is. When I test a program on the same processor on the BL0032 board, there is no problem. Can there be an error in using the internal clock? Thanks a lot. -j-

Re: Interrupt UART RXINT1 on dsPIC 33EP256MU806

Posted: Fri Mar 27, 2020 1:02 pm
by Benj
Hello,

Could be something like the watchdog timer, can you check this is disabled in the device configuration.

Another potential cause of a reset could be something like a divide by 0 occuring in the program.

Re: Interrupt UART RXINT1 on dsPIC 33EP256MU806

Posted: Fri Mar 27, 2020 4:17 pm
by kadlcak
Hallo Benj,
thank you for the quick reply. I turned off the watchdog timer, but it had no effect. Divide by zero I checked, but as I wrote on BL0032 it runs smoothly. ?????

Re: Interrupt UART RXINT1 on dsPIC 33EP256MU806

Posted: Fri Mar 27, 2020 4:43 pm
by LeighM
What about hardware, anything running over-voltage, hot, inadequate power supply?

Re: Interrupt UART RXINT1 on dsPIC 33EP256MU806

Posted: Mon Mar 30, 2020 7:14 am
by kadlcak
Hello,
I checked the power supply, disconnected all peripherals physically, no change. Similarly, I did so in the program, leaving only the main program and the macro, which is called by the interrupt. Processor resets periodically after 156 cycles in "Main"
I'm sending the program, including the settings, if possible please see what's wrong.
Thanks -j-

Re: Interrupt UART RXINT1 on dsPIC 33EP256MU806

Posted: Mon Mar 30, 2020 9:40 am
by LeighM
Hi,
This is another example of where you would be better using the circular buffer component.
Doing too much in an interrupt will cause problems.
You really need to be just receiving the one character, into a buffer, on the interrupt.
Then process the information back out of the buffer in the main loop.
This also has the benefit of being able to synchronise with the protocol, i.e. waiting for the STX before you then proceed to process the data

Re: Interrupt UART RXINT1 on dsPIC 33EP256MU806

Posted: Mon Apr 06, 2020 6:43 am
by kadlcak
Hi,
thank you for your advice, I'll test it.
-j-

Re: Interrupt UART RXINT1 on dsPIC 33EP256MU806

Posted: Thu Jun 04, 2020 5:47 pm
by jlangbridge
Not exactly the same thing, but I've been having reset problems with the BL0032. I'm working on a project that uses a lot of Bluetooth comms (I've rewritten the driver using interrupts). It's hard to keep the board up and running for long, it just keeps on rebooting. I can't quite remember, but I think that the problem came up when we started looking at the UART. However, when powered using the power supply, and disconnected from USB, it is rock solid.

I've hooked this up to another board, and I've set a pulse on a GPIO when it boots, and the delay is extremely variable. Sometimes 5 minutes, sometimes 20. Currently, running on wall power, I'm at 1 hour 57 minutes (but my systick of one second is probably a bit off). Looks like something to do with the USB µC, but I haven't put a USB sniffer on it.

I've tried this on my Dell dock (which isn't really a reference) as well as directly on my computer (XPS 15) and a colleague has the same problem, using different hardware. USB2 and USB3 (not type C, haven't tried).

Re: Interrupt UART RXINT1 on dsPIC 33EP256MU806

Posted: Fri Jun 05, 2020 10:22 am
by Benj
Hello,

Could it be the USB cable you are using? If the Eblocks board and Bluetooth comms plus anything else connected is trying to consume more current then the USB cable can provide then the voltage may be dipping causing the microcontroller to brown out and reset.

Please can you try using a high current mobile phone charge cable and see if this makes a difference.

Or does the board reset when connected to the PSU and the USB is connected but fine when just the PSU is connected?