Older Necto Studio version or older MikroSDK version

Cross-platform IDE for the rapid development of applications for the embedded world, available on Windows, Linux, and macOS.
Post Reply
Author
Message
bjlli
Posts: 1
Joined: 03 Feb 2023 14:04

Older Necto Studio version or older MikroSDK version

#1 Post by bjlli » 23 Feb 2023 17:29

Hey there, I bought a Clicker 2 for PIC18FK, a 4-20mA Receiver Clicker and a RS485 6 Clicker. And I'm not able to use none of these boards with MikroSDK and Necto Studio.

I tried a lot of examples and the only libraries that work are the gpio related. I tried the Hal Pwm library and that's the code that it's suggested in the headers:

/**
* @file main.c
* @brief Main function for pwm-teste application.
*/
#include "board.h"
#include "hal_pwm.h"

int main(void)
{
hal_pwm_t hal_pwm;
hal_pwm_config_t hal_pwm_cfg;
hal_pwm_configure_default( &hal_pwm_cfg );
hal_pwm_cfg.pin = MIKROBUS_1_PWM;
hal_pwm_cfg.freq_hz = 5000;

hal_pwm_open( &hal_pwm->handle, true );

hal_pwm_set_freq( &hal_pwm->handle, hal_pwm_cfg.freq_hz );

hal_pwm_start( &hal_pwm->handle );

hal_pwm_set_duty( &hal_pwm->handle, 0.5 );
/* Replace with your application code */
while (1)
{
}

return 0;
}

Because of the &hal_pwm->handle, i get the error:

Operator '.' is not applicable to these operands '?fake$'
And due to the function hal_pwm_set_freq i get the warning:

Implicit conversion of int to ptr

This warning happens because the second parameter of the hal_pwm_set_freq it's *hal_pwm_config_t not an integer.

I corrected it, but it still doesn't work because of the error above.

This error is common in Hal UART and HAL Spi, I already tested them. I tried to pass the parameters as &str.handle and I tried to use an auxiliary variable, but nothing works. The drivers libraries are called by the Hal ones, so they don't work either as expected.

Is there a way to downgrade MikroSDK version or the Necto Studio for testing? I bought two modules: 4-20mA Receiver and the RS485 6 that I can't even test them because the SPI and UART libraries don't work properly.

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

Re: Older Necto Studio version or older MikroSDK version

#2 Post by IvanJeremic » 27 Feb 2023 14:30

Hi,

Try using our example code from Necto Studio, you can find the example code in the Packages section.
Untitled.png
Untitled.png (4.81 KiB) Viewed 561 times
Untitled1.png
Untitled1.png (33.58 KiB) Viewed 561 times
As for the RS485 6 click, it is not in Necto Studio at the moment, but you can access the example by downloading it from the link below and then converting it from Memake to Cmake:
https://github.com/MikroElektronika/mik ... cks/rs4856

You can see how to convert the example in the link below:
viewtopic.php?f=237&t=79414

Regards,

Ivan.

Post Reply

Return to “IDE”