Problem with the interrupt Pic32mx150F128b

Any bugs you encounter with Flowcode should be discussed here.
SpeedPIC32
Posts: 256
http://meble-kuchenne.info.pl
Joined: Thu Dec 10, 2020 2:35 pm
Has thanked: 36 times
Been thanked: 17 times

Flowcode v10 Problem with the interrupt Pic32mx150F128b

Post by SpeedPIC32 »

Problem with the interrupt HC05 UART RXint 1 UART RXint 2

Hello
it simply does not work.
I can send data to the smartphone
nothing comes back.
I use HC05 6 PIN from AZ delivery.

with kind regards
SpeedPic32
HC05 Int.fcfx
(21.03 KiB) Downloaded 52 times

chipfryer27
Valued Contributor
Posts: 1188
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 289 times
Been thanked: 418 times

Re: Problem with the interrupt Pic32mx150F128b

Post by chipfryer27 »

Hi

I'm not too familiar using interrupts on PPS pins, but I think your chart may need to be modified.

At present you are looping around a decision based on the result of a calculation that takes place if an interrupt occurs. The interrupt could occur at any time.

Assuming the interrupt took place when you were in your "No" branch. The program would immediately jump to your interrupt and set your variable to "1". However you then have a delay of at least one second (possibly two depending on when the interrupt takes place) before you test the variable and subsequently look to receive the incoming string. You would need to be very lucky indeed for such an interrupt to occur just at the right time for you to test, branch and receive a string. If you are that lucky please send me your choice in this weeks Lottery draw :)

You might consider using a Circular Buffer (populated by RxChar called during your interrupt) instead, or try and capture the entire string in your interrupt branch then setting your variable.

I don't see any BlueTooth configuration so assume you have paired them previously and they are acting as a transparent link. Are they sending the "Nein" back to your phone OK?

Hope this helps.

Regards

SpeedPIC32
Posts: 256
Joined: Thu Dec 10, 2020 2:35 pm
Has thanked: 36 times
Been thanked: 17 times

Re: Problem with the interrupt Pic32mx150F128b

Post by SpeedPIC32 »

hello chipfryer27
I have tested your suggestion, unfortunately without success.
I then programmed a version with a PIC32MZ. see the appendix, which works like this.
I am convinced that the interrupt does not work with the PIC32MX150F128B. this would have to be examined / tested more closely.

With kind regards
SpeedPic32
HC05 Int.fcfx
(20.09 KiB) Downloaded 40 times
HC05 Int PIC MZ.fcfx
(20.3 KiB) Downloaded 45 times

WingNut
Posts: 254
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 33 times
Been thanked: 23 times

Re: Problem with the interrupt Pic32mx150F128b

Post by WingNut »

I notice the interrupt says Enable RXINT3 in the flowchart but when you double click it to see how its set up, RXINT4 is highlighted

chipfryer27
Valued Contributor
Posts: 1188
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 289 times
Been thanked: 418 times

Re: Problem with the interrupt Pic32mx150F128b

Post by chipfryer27 »

Hi

Do you have a USB-TTL serial converter?

If so use a Terminal program on your PC and connect directly to your chip UART Tx/Rx (check +5v/+3v level compatibility)

In your chart enable a RXINT for your connected port, then enter an endless loop doing nothing.
In you interrupt routine use RxChar to receive a byte then immediately use SendChar to send the received character back out.

Now whatever you type in your terminal program should be echo'd back to you.

Regards

stefan.erni
Valued Contributor
Posts: 762
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 151 times
Been thanked: 171 times

Re: Problem with the interrupt Pic32mx150F128b

Post by stefan.erni »

Hi SpeedPIC32

Can you check if your PIC32MZ is MIPS32 ?


regards


Stefan

Change to MIPS32
Snag_743c0a.png
Snag_743c0a.png (211.53 KiB) Viewed 1224 times

SpeedPIC32
Posts: 256
Joined: Thu Dec 10, 2020 2:35 pm
Has thanked: 36 times
Been thanked: 17 times

Re: Problem with the interrupt Pic32mx150F128b

Post by SpeedPIC32 »

Hello,

great that so many respond so quickly to this topic.

0. This is only about the RXint on the PIC32MX150F128B.
nothing else.

1. The interrupt on the PIC32MX150F128B does not work.
for this i uploaded you HC05 int. fcfx.
2. the interrupt on the PIC32MZ2048EFH100 works very well.
I have uploaded HC05 int PIC MZ for you.
I am of the opinion that the interrupt should always work like on the PIC32MZ2048EFH100, thanks to our software FC10.
3. these are the same programs just two different PIC.
4. This is exactly how I programmed a high-speed counter, for example.

5. can you check if your PIC32MZ is a MIPS32?
yes the PIC32MZ is a MIPS32 and also programmed that way.

6. the RXint is also correct. it always goes from 1 to 0 on channel 1, from 2 to 1 on channel 2 and in my case from 4 to 3 on channel 4.
because every first channel, input or output starts with the number 0 and not with 1.

I would be happy if BenR could take a look at this.

With kind regards
SpeedP'IC32

chipfryer27
Valued Contributor
Posts: 1188
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 289 times
Been thanked: 418 times

Re: Problem with the interrupt Pic32mx150F128b

Post by chipfryer27 »

Hi

Thanks for the clarification. It wasn't too clear to me that your code worked on "x" but not on "y". Does sound as though it could be chip specific. No doubt Matrix will advise :)

Regards

SpeedPIC32
Posts: 256
Joined: Thu Dec 10, 2020 2:35 pm
Has thanked: 36 times
Been thanked: 17 times

Flowcode v10 Re: Problem with the interrupt Pic32mx150F128b

Post by SpeedPIC32 »

Hello

I also think that it is chip specific.
would be good for me if it could happen quickly because I have to finish a project with the chip.

With kind regards
SpeedP'IC32

BenR
Matrix Staff
Posts: 1760
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 447 times
Been thanked: 607 times

Re: Problem with the interrupt Pic32mx150F128b

Post by BenR »

Hello,

Im not sure if it's a problem with the interrupt or the baud rate of the UART. If you send out some data on the UART do you have anything you can use to check the timings are correct. It might be worth modifying the FPBDIV config setting to see if this makes a difference.

Post Reply