soft serial

For general Flowcode discussion that does not belong in the other sections.
Post Reply
seokgi
Posts: 179
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 1:43 pm
Has thanked: 5 times
Been thanked: 7 times

Flowcode v10 soft serial

Post by seokgi »

I am working on a project using PIC18F45K40.
I need to use 4 UARTs. So two will use modbus and two will use soft serial.
A UART interrupt was created by referring to the data, but it does not compile.
Could you please help?
thank you.
Attachments
Soft_Serial-231218.fcfx
(29.91 KiB) Downloaded 26 times

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

Re: soft serial

Post by medelec35 »

Hello.
The issue is the registers are wrong within the custom interrupt code.
E.g. for COM_A you have for Enable code:

Code: Select all

INTCONbits.PEIE = 1; // Enable peripheral interrupts
INTCONbits.GIE = 1; // Enable global interrupts
PIE1bits.RC1IE = 1; // Enable USART receive interrupts
Whereas it should be:

Code: Select all

INTCONbits.PEIE = 1; // Enable peripheral interrupts
INTCONbits.GIE = 1; // Enable global interrupts
PIE3bits.RC1IE = 1; // Enable USART receive interrupts
For the handler code you have:

Code: Select all

if (PIR1 & (1 << RC1IF)) // Check to see if the interrupt flag is set

{
FCM_%n(); // Call Flowcode Macro
PIR1bits.RC1IF = 0; // Clear interrupt flag
}
Instead of:

Code: Select all

if (PIR1 & (1 << RC1IF)) // Check to see if the interrupt flag is set

{
FCM_%n(); // Call Flowcode Macro
PIR3bits.RC1IF = 0; // Clear interrupt flag
}
I hope that helps?
Martin

seokgi
Posts: 179
Joined: Thu Dec 03, 2020 1:43 pm
Has thanked: 5 times
Been thanked: 7 times

Re: soft serial

Post by seokgi »

Thank you for your help.
But I don't understand why the register values change.
So I searched for MCU and found that PIC18F57Q43 is suitable.
But FC10 doesn't support it.
It seems that other people also want support for the Q43 series.
If possible, can you support the Q43 series?

Post Reply