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
Problem with the interrupt Pic32mx150F128b
-
- Posts: 256
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 10, 2020 2:35 pm
- Has thanked: 36 times
- Been thanked: 17 times
-
- 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
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
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
-
- Posts: 256
- Joined: Thu Dec 10, 2020 2:35 pm
- Has thanked: 36 times
- Been thanked: 17 times
Re: Problem with the interrupt Pic32mx150F128b
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
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
-
- 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
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
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
-
- 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
Hi SpeedPIC32
Can you check if your PIC32MZ is MIPS32 ?
regards
Stefan
Change to MIPS32
Can you check if your PIC32MZ is MIPS32 ?
regards
Stefan
Change to MIPS32
-
- Posts: 256
- Joined: Thu Dec 10, 2020 2:35 pm
- Has thanked: 36 times
- Been thanked: 17 times
Re: Problem with the interrupt Pic32mx150F128b
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
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
-
- 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
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
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
-
- Posts: 256
- Joined: Thu Dec 10, 2020 2:35 pm
- Has thanked: 36 times
- Been thanked: 17 times
Re: Problem with the interrupt Pic32mx150F128b
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
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
-
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel