Interrupt UART RXINT1 on dsPIC 33EP256MU806

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
kadlcak
Flowcode V4 User
Posts: 9
Joined: Wed Oct 19, 2011 3:15 pm
Has thanked: 1 time
Contact:

Interrupt UART RXINT1 on dsPIC 33EP256MU806

Post 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-

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Interrupt UART RXINT1 on dsPIC 33EP256MU806

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

kadlcak
Flowcode V4 User
Posts: 9
Joined: Wed Oct 19, 2011 3:15 pm
Has thanked: 1 time
Contact:

Re: Interrupt UART RXINT1 on dsPIC 33EP256MU806

Post 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. ?????

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Interrupt UART RXINT1 on dsPIC 33EP256MU806

Post by LeighM »

What about hardware, anything running over-voltage, hot, inadequate power supply?

kadlcak
Flowcode V4 User
Posts: 9
Joined: Wed Oct 19, 2011 3:15 pm
Has thanked: 1 time
Contact:

Re: Interrupt UART RXINT1 on dsPIC 33EP256MU806

Post 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-
Attachments
Sampler_v3_0_30032020_dsPIC_VMM_INT.fcfx
(23.77 KiB) Downloaded 162 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Interrupt UART RXINT1 on dsPIC 33EP256MU806

Post 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

kadlcak
Flowcode V4 User
Posts: 9
Joined: Wed Oct 19, 2011 3:15 pm
Has thanked: 1 time
Contact:

Re: Interrupt UART RXINT1 on dsPIC 33EP256MU806

Post by kadlcak »

Hi,
thank you for your advice, I'll test it.
-j-

jlangbridge
Posts: 7
Joined: Mon Aug 26, 2019 4:20 pm
Been thanked: 1 time
Contact:

Re: Interrupt UART RXINT1 on dsPIC 33EP256MU806

Post 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).

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Interrupt UART RXINT1 on dsPIC 33EP256MU806

Post 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?

Post Reply