USB UART log not working on Clicker 2 for PIC18FK

General discussion on mikroElektronika development boards.
Post Reply
Author
Message
jazkarate
Posts: 2
Joined: 07 Sep 2022 13:25

USB UART log not working on Clicker 2 for PIC18FK

#1 Post by jazkarate » 08 Feb 2024 08:55

Hi, Im new to all the Mikroe environment and to Necto studio and I am starting to play around with a Clicker 2 for PIC18FK. I have a Thermo 4 click and I am trying to visualize the temperature measured on the integrated UAS UART, but I am failing to get any messages on the serial terminal. I have folowed the example code on the API documentation and the code looks like is uploading correctly (I uploaded the same code enablind one of the LEDs and is working) but still no messages on the terminal.

The following code is what I am using.

Code: Select all

static log_t logger;
log_cfg_t log_cfg;

LOG_MAP_USB_UART(log_cfg);
log_init(&logger, &log_cfg);
log_info(&logger, "---- Application Init ----");
I also found that the LOG_MAP_USB_UART() function is not doing anything. If I follow to the definition of the function this is what I find.

Code: Select all

/*!
 * \brief LOG MAP to the USB UART configuration
 * \note Build compatibility only, not functional.
 */
#define LOG_MAP_USB_UART(cfg) cfg.level = LOG_LEVEL_DEBUG;
I would thank any clarification on what should I do to make it work.

User avatar
IvanJeremic
mikroElektronika team
Posts: 316
Joined: 05 Sep 2022 14:32

Re: USB UART log not working on Clicker 2 for PIC18FK

#2 Post by IvanJeremic » 24 Feb 2024 10:47

Hi,

Sorry for the delay.

Clicker 2 for PIC18FK does not have a USB-UART connector, so you need to add a USB-UART module to it.

I suggest any of the ones in the links below:
https://www.mikroe.com/usb-uart-3-click
https://www.mikroe.com/usb-uart-click
https://www.mikroe.com/usb-uart-iso-click

Also you will have to change the code example so it will send the data through the USB-UART click.

Change this line of code "LOG_MAP_USB_UART( log_cfg );" to this "LOG_MAP_MIKROBUS( log_cfg, MIKROBUS_2);", if you place the click on MikroBUS 1 then change "MIKROBUS_2" to "MIKROBUS_1".
Thermo 4 click.zip
(2.91 MiB) Downloaded 3 times
Regards,

Ivan.

Post Reply

Return to “Development Boards”