Interrupt UART RXINT1 on dsPIC 33EP256MU806

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

Moderator: Benj

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

Postby kadlcak » Fri Mar 27, 2020 12:06 pm

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: 14790
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4752 times
Been thanked: 4358 times
Contact:

Re: Interrupt UART RXINT1 on dsPIC 33EP256MU806

Postby Benj » Fri Mar 27, 2020 1:02 pm

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

Postby kadlcak » Fri Mar 27, 2020 4:17 pm

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: 2012
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 480 times
Been thanked: 689 times
Contact:

Re: Interrupt UART RXINT1 on dsPIC 33EP256MU806

Postby LeighM » Fri Mar 27, 2020 4:43 pm

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

Postby kadlcak » Mon Mar 30, 2020 7:14 am

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 5 times

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

Re: Interrupt UART RXINT1 on dsPIC 33EP256MU806

Postby LeighM » Mon Mar 30, 2020 9:40 am

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

Postby kadlcak » Mon Apr 06, 2020 6:43 am

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