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.
soft serial
-
- Posts: 179
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 03, 2020 1:43 pm
- Has thanked: 5 times
- Been thanked: 7 times
-
- Matrix Staff
- Posts: 1451
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 512 times
- Been thanked: 472 times
Re: soft serial
Hello.
The issue is the registers are wrong within the custom interrupt code.
E.g. for COM_A you have for Enable code:
Whereas it should be:
For the handler code you have:
Instead of:
I hope that helps?
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
Code: Select all
INTCONbits.PEIE = 1; // Enable peripheral interrupts
INTCONbits.GIE = 1; // Enable global interrupts
PIE3bits.RC1IE = 1; // Enable USART receive interrupts
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
}
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
}
Martin
Re: soft serial
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?
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?