Interrupts not working

For general Flowcode discussion that does not belong in the other sections.
Post Reply
jollybv
Posts: 125
http://meble-kuchenne.info.pl
Joined: Mon Mar 08, 2021 11:25 am
Location: Cape Town South Africa
Has thanked: 40 times
Been thanked: 11 times

Interrupts not working

Post by jollybv »

Hi Guys

I Have recently updated my boards processor from the PIC18LF46K80 to the PIC18L47K40 the pins are identical but i cannot get the RXINTO & RXINTO1 to work also I'm using Timer4 to flash and LED witch is also not flashing. I thought maybe the chip was faulty so I have replaced it Twice with no luck. Maybe I'm missing something with this chip as to why it will not working correctly or could there be a bug in the chip software?
Any help will be greatly appreciated as Iv'e been trying to sort this out for 4 days now :?
GSM_U6_V1.5.61_with FRX_09_12_23.fcfx
(122.7 KiB) Downloaded 91 times

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: Interrupts not working

Post by medelec35 »

Hello.
The first thing to do if your project is not working as expected is to do a 1 sec flasher test.

Just create the loop at the top of main.
The reason I suggest that is when a target is changed you have to go through all the configuration settings and things can easily get missed.
For example, in your case, the watchdog timer is enabled, so your hardware will keep resetting, hence not getting anywhere.
One the flasher is working as expected, continue with your project.

It might be the case you need the watchdog timer enabled, so you will be best running the flasher test to make sure the watchdog is being cleared correctly.

What I do if I suspect watchdog timeout, is before the main loop at the start, is set a port pin high, then after a delay set the pin to low.
With a led attached to the pin, it should only light up once.
If it keeps lighting up, you know your hardware keeps resetting.

If hardware does not keep resetting, then more investigating is required.
Martin

jollybv
Posts: 125
Joined: Mon Mar 08, 2021 11:25 am
Location: Cape Town South Africa
Has thanked: 40 times
Been thanked: 11 times

Re: Interrupts not working

Post by jollybv »

Hi Martin
Thanks for the reply I did do the one second flasher and it works also i can send data in the RS232 and I can read it so clock speed is right. I also did as you said and connect a led to a pin and see if it flashes only once and that is right so watchdog timer not resetting.
I have been at this for a week and can seem to get the RX1 to send on TX2 and get RX2 to send on TX1 i can send to the GSM module it responds with a OK but can reed it as I'm assuming the RXINTO & RXINTO1 are not working. I'm not sure if it also might be something in the circular buffer as I'm not a experienced programmer. Any help will be greatly appreciated as I'm in a bit of a pickle. In my country they are doing away wit the 2G & 3G networks and as my product was built on 2G technology so they will all stop working shortly and I need this 4G upgrade board to work the only thing holding me back is coms problem. Could there be a problem on the RX interrupt component?

I have now changed it to read the buffer every 10s I get nothing out of the buffer so it really seems as if the RXINTO & RXINTO1 are not working I'm not sure is there a setting in the configure that I'm missing that will cause this? :evil:
RXD_Int_Test.fcfx
(50.02 KiB) Downloaded 49 times

jollybv
Posts: 125
Joined: Mon Mar 08, 2021 11:25 am
Location: Cape Town South Africa
Has thanked: 40 times
Been thanked: 11 times

Re: Interrupts not working

Post by jollybv »

Hi Guys

This is really giving me gray hairs I cannot get RXINT1 to trigger at all and wondering if it is a bug with flowcode in the PIC18F47K40 chip. If i send a signal to pin 5 RX1 it triggers and sends it out on TX1 pin 44, but if i send a signal to RX2 pin 7 it dose not send it out to TX1 pin 1. Both uarts are working as the sending data out as you can see in the picture. I have changed the chips many times as well but no luck Please some help will be much appreciated.
RX_TX.GIF
RX_TX.GIF (6.45 KiB) Viewed 2702 times
RXD_Int_Test1.fcfx
(24.73 KiB) Downloaded 18 times

chipfryer27
Valued Contributor
Posts: 1146
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: Interrupts not working

Post by chipfryer27 »

Hi

I don't have that chip to test with so I'm kind of limited in my help.

The RS232's pins on that chip can be remapped so to try and narrow things down, can you swap ch1 for ch2 so see if the problem follows? You know ch1 works on pins 5/44 and ch2 not on 7/1 so put ch1 on 7/1 and ch2 on 5/44 and see if the problem follows etc

Regards

chipfryer27
Valued Contributor
Posts: 1146
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: Interrupts not working

Post by chipfryer27 »

Hi

Maybe a bit of confusion. As I've been in the pub this afternoon there's a good chance of it :)

You are using a 44-pin version (as you mention using pin 44). Correct?

Your chart when opened has:
UART Ch1 on ports C6 (Tx) and C7 ( Rx) which are pins 44 and 1 on a 44-pin device
UART Ch2 on ports D6 (Tx) and D7 ( Rx) which are pins 4 and 5 on a 44-pin device

I know from other posts that sometimes when Flowcode opens a project some pins can default or change, so just to be clear, which pins are you assigning to Ch1 Tx/Rx and to Ch2 Tx/Rx ? Default Rx pins appear to be Ch1= C7 (pin 1) and Ch2=B7 (pin 17). I think you can only remap Ch1 to Port B or C, and Ch2 to Port B or D. If the datasheet would stop spinning around most likely I could see it better :)

However now I get confused.

If you open your chart and then click View > Target Device a 40-pin chip is displayed and these have differing Port/Pin allocations. Could that be related to your problem? For example on a 44-pin device D7 (Ch2 Rx on pin 5) is now on a 40-pin device pin 30 (pin 30 on a 44-pin device is either RA7 or VSS).

viewtopic.php?f=5&t=2128&p=12785&hilit= ... ces#p12785

Maybe I've overlooked or forgotten something silly and I'm talking nonsense?? In case I have forgotten something I best go back to pub and look :lol:

Regards

Post Reply