Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

Sort By

USER REQUESTS

<< previous | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 last
Rainer Hantsch
rainer

posted on 2022/12/18 08:49:49 AM CET

Communication

Library for decrypting energy meter's data

Hello. I am looking for a library to decrypt my electric energy meter's data. I found some code for Arduino, but it uses/includes AESh and GCM.h. In addition, I am using only Microchip PIC controllers + mikroPascal PRO for PIC, so what I found is almost useless to me.

I foind a "Crypto library", but this poor package manager is not installing it properly, nor do I know if this library is correctly working at all (the author doesn't respond and his last login here was 10 years ago).

If somebody could help, please?

The Energy Meter is LANDIS & GYR E450, It sends out one data block every 5 seconds through its User interface (M-BUS). I already built an electric interface module (converter to TTL serial level), but I stuck with decryption.

Thank you.

Pasko Zouti
deewex

posted on 2022/11/24 03:54:30 PM CET

Communication > CAN / LIN / RS485

CAN for PIC32MX530F128L

Hey,

I'm programming a MCU PIC32MX530F128L with CAN library provided in MikroC. But it doesn't work and I don't know why.
After reset, the ship stops when it reaches the function CAN1Initialize().

Is this library has been tested with this chip ?

Than you for your help.

Pasko

Sudeepthi Napa
sudeepthi

posted on 2022/08/07 12:22:30 PM CEST

Communication > Ethernet

Unable to get server dns in STM32F407VGT6 with LAN8720A(Ethernet).

Unable to get server dns in STM32F407VGT6 with LAN8720A(Ethernet).
Always return 252.255.1.32.

code snippet:

void InitTimer2(){
RCC_APB1ENR.TIM2EN = 1;
TIM2_CR1.CEN = 0;
TIM2_PSC = 2999;
TIM2_ARR = 49999;
NVIC_IntEnable(IVT_INT_TIM2);
TIM2_DIER.UIE = 1;
}
void Timer2_interrupt() iv IVT_INT_TIM2 {//1sec
TIM2_SR.UIF = 0;
Net_Ethernet_Intern_userTimerSec++ ; // Increment ethernet library counter
//GPIOD_ODR = ~GPIOD_ODR;
b++;
}
GPIO_Alternate_Function_Enable(&_GPIO_MODULE_MCO1);
/*GPIO_Clk_Enable(&GPIOA_BASE);
GPIO_Config(&GPIOA_BASE, _GPIO_PINMASK_8, (_GPIO_CFG_MODE_ALT_FUNCTION | _GPIO_CFG_SPEED_50MHZ |_GPIO_CFG_OTYPE_PP));*/
InitTimer2();
//Internet Settings

//Net_Ethernet_Intern_stackInitTCP();
Net_Ethernet_Intern_Init(myMacAddr, myIpAddr, _ETHERNET_FULLDUPLEX, &_GPIO_MODULE_ETHERNET);
Net_Ethernet_Intern_confNetwork(ipMask, gwIpAddr, dnsIpAddr);
// Wait for active link
while(!(regValue & 0b100)) {
Net_Ethernet_Intern_PHY_Read(_PHY_BSR, &regValue);
}
TIM2_CR1.CEN = 1;
IntToStr(regValue, ssr);
TFT_Write_Text(ssr, 50, 200);

memcpy(temp_serverIP, Net_Ethernet_Intern_dnsResolve("weldvisor.com", 25), 4);

Also attached project configuration

<?xml version="1.0"?>
<MCU_DEVICE_FLAGS>
<DEVICE>
<DEVICE_NAME>STM32F407VG</DEVICE_NAME>
<DEVICE_CLOCK>150</DEVICE_CLOCK>
<SETTINGS>
<COUNT>22</COUNT>
<SETTING0>
<NAME>Internal high-speed clock enable</NAME>
<DESCRIPTION>HSI oscillator OFF</DESCRIPTION>
</SETTING0>
<SETTING1>
<NAME>External high-speed clock enable</NAME>
<DESCRIPTION>HSE oscillator ON</DESCRIPTION>
</SETTING1>
<SETTING2>
<NAME>External high-speed clock bypass</NAME>
<DESCRIPTION>HSE oscillator not bypassed</DESCRIPTION>
</SETTING2>
<SETTING3>
<NAME>Clock security system enable</NAME>
<DESCRIPTION>Clock detector OFF</DESCRIPTION>
</SETTING3>
<SETTING4>
<NAME>Main PLL (PLL) enable</NAME>
<DESCRIPTION>PLL ON</DESCRIPTION>
</SETTING4>
<SETTING5>
<NAME>PLLI2S enable</NAME>
<DESCRIPTION>PLLI2S OFF</DESCRIPTION>
</SETTING5>
<SETTING6>
<NAME>Division factor for the main PLL (PLL) and audio PLL (PLLI2S) input clock</NAME>
<DESCRIPTION>PLLM = 25</DESCRIPTION>
</SETTING6>
<SETTING7>
<NAME>Main PLL (PLL) multiplication factor for VCO</NAME>
<DESCRIPTION>PLLN = 336</DESCRIPTION>
</SETTING7>
<SETTING8>
<NAME>Main PLL (PLL) division factor for main system clock</NAME>
<DESCRIPTION>PLLP = 2</DESCRIPTION>
</SETTING8>
<SETTING9>
<NAME>Main PLL(PLL) and audio PLL (PLLI2S) entry clock source</NAME>
<DESCRIPTION>HSE oscillator clock selected as PLL and PLLI2S clock entry </DESCRIPTION>
</SETTING9>
<SETTING10>
<NAME>Main PLL (PLL) division factor for USB OTG FS, SDIO and random number generator clocks</NAME>
<DESCRIPTION>PLLQ = 6 </DESCRIPTION>
</SETTING10>
<SETTING11>
<NAME>System clock switch</NAME>
<DESCRIPTION>PLL selected as system clock</DESCRIPTION>
</SETTING11>
<SETTING12>
<NAME>Set and cleared by software to control the division factor of the AHB clock</NAME>
<DESCRIPTION>SYSCLK not divided</DESCRIPTION>
</SETTING12>
<SETTING13>
<NAME>APB low-speed prescaler (APB1)</NAME>
<DESCRIPTION>HCLK divided by 4 </DESCRIPTION>
</SETTING13>
<SETTING14>
<NAME>APB high-speed prescaler (APB2)</NAME>
<DESCRIPTION>HCLK divided by 2 </DESCRIPTION>
</SETTING14>
<SETTING15>
<NAME>HSE division factor for RTC clock</NAME>
<DESCRIPTION>no clock</DESCRIPTION>
</SETTING15>
<SETTING16>
<NAME>Microcontroller clock output 1</NAME>
<DESCRIPTION>PLL clock selected </DESCRIPTION>
</SETTING16>
<SETTING17>
<NAME>I2S clock selection</NAME>
<DESCRIPTION>PLLI2S clock used as I2S clock source </DESCRIPTION>
</SETTING17>
<SETTING18>
<NAME>MCO1 prescaler</NAME>
<DESCRIPTION>division by 3 </DESCRIPTION>
</SETTING18>
<SETTING19>
<NAME>MCO2PRE</NAME>
<DESCRIPTION>division by 5 </DESCRIPTION>
</SETTING19>
<SETTING20>
<NAME>Microcontroller clock output 2</NAME>
<DESCRIPTION>PLL clock selected </DESCRIPTION>
</SETTING20>
<SETTING21>
<NAME>Voltage range</NAME>
<DESCRIPTION>Voltage range = 2.7 to 3.6 V</DESCRIPTION>
</SETTING21>
</SETTINGS>
</DEVICE>
</MCU_DEVICE_FLAGS>

Alex Kadow
Alex2661

posted on 2022/07/17 07:23:30 AM CEST

Communication > Ethernet

Bridge/Transfer all data packets from one ETH port to another (or wifi click to another)

Hi All,

I need to establish a bridge that will sit between a router and a PC which will log the IP addresses of all traffic that pass between (including TCP and UDP). It should also restrict some IP addresses, acting like a very basic firewall.

The speed at which it does this is not important as the PC only runs dedicated software.

The connection can either be wired (via 2x ethernet ports) or wireless (one wireless device connects to the router's wifi whilst a second provides a network for the PC to connect with). Ideally the solution could accommodate both.

I am developing using the Fusion v7 and PIC32MX795F512L and have 2x ethernet clicks with 2x wifi clicks on order.

I have explored:
- using the Mikroe libraries to speak to both (1) the internal ethernet port and (2) an ethernet click port but cannot figure out how to bridge the traffic using Mikroe libraries. I am told that the libraries accommodate one port max so using both the internal and an external port seems like a possible solution.
- Github/other forums to seek example code that may help to speak to the ENC28J60 (IC on the ethernet click) directly but refs seems incompatible with MicroC.
- Review of some libraries available here that deal with the wifi click. Assuming the libraries are unable to accommodate more than one wifi click like the ethernet click libraries, this seems like an unlikely solution.
- Mikroe support.

I wonder if anyone has achieved a basic bridge like this for a firewall, range-extender or another similar application and if anyone can provide any example projects or code.

We have achieved this using the raspberry pi but wish to establish a professional solution using PIC and Mikroe.

Any help or advice would be appreciated.

Thanks for your time and all the best.

Alex

Vaidyanathan Balakrishnan
vaidi

posted on 2022/06/05 07:50:45 PM CEST

Communication > Ethernet

Drivers for EasyPic Fusion 7 for PIC32 MZ and LAN8720A

I am looking for an Ethernet driver to work with PIC32MZ on the EasyFusion board with a LAN8720A PHY device.
Development platform is MPLAB-X IDE with XC32 compiler - standard example from Microchip for their MZ Starter kit does not work with the Fusion board.

<< previous | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 last