PIC24FJ256GA702 UART problem (SOLVED)

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
Sasi
Posts: 44
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 12:11 pm
Has thanked: 10 times
Been thanked: 7 times

PIC24FJ256GA702 UART problem (SOLVED)

Post by Sasi »

Hello,

I'd like to ask for a little help.
I'm using a PIC24FJ256GA702 MCU I couldn't manage to make the UART peripheral work with the component macro.
(I'm using this MCU for the first time, I have no experience with it.)
What I've done so far:
1. I installed Flowcode 9.3 and all the updates.

2. I recompiled the project file, but the UART still didn't work.
PIC24FJ256GA702_UART_TEST_with_Component_Macro.fcfx
(10.59 KiB) Downloaded 49 times

3. While running the program in the MPLAB-X development environment I checked the status of the SFRs related to the operation of the UART.
(Debug mode with ICD3) The values of the UART registers seem to be right.

4. As described in the MCU datasheet, I created a simple UART management project using C code.
PIC24FJ256GA702_UART_TEST_C.fcfx
(10.41 KiB) Downloaded 58 times

(Meanwhile, it was revealed that the PI24FJ256GA702.h file used by Flowcode is corrupted. I have updated the files with .gld .h .inc extensions in the compiler's directory used by Flowcode, from the XC16 verson 2.00)
With this solution the UART is working and it can receive and send data.

I don't know why it doesn't work with Component Macro.
Could someone please fix it?

Best regards,
Sasi
Last edited by Sasi on Sun Aug 28, 2022 1:17 pm, edited 1 time in total.

Sasi
Posts: 44
Joined: Wed Dec 02, 2020 12:11 pm
Has thanked: 10 times
Been thanked: 7 times

Re: PIC24FJ256GA702 UART problem(SOLVED)

Post by Sasi »

Hi,

I found the cause of the error.
In the configuration bits setting, the second oscillator input wasn't defined as a digital input (SOSCSEL bit).
I use this pin as the input to the receive side of the UART.


I think the function description of this bit is not clear in the Configure block of the Project Options menu.

FOSC_FC9.jpg
FOSC_FC9.jpg (44.65 KiB) Viewed 752 times
The description of the function assigned to the MBLABX "SOSCSEL" bit is clearer.

FOSC_MPLABX.jpg
FOSC_MPLABX.jpg (49.13 KiB) Viewed 752 times
Regards,
Sasi

Post Reply