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

first | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 last
Asa Muna
asa

posted on 2019/08/22 05:44:51 PM CEST

Click Boards

RTD Click to DAC Click

I am using PIC18F45k22, RTD Click and DAC Click. I managed to execute the example code successfully on EasyPIC7 board. Now my aim is to merge the two example code and pass the RTD value (0-250) to DAC click (0-4095), so that I can have RTD reading in terms of a Voltage output. PIC18F45k22 act as the master to relay this operation.
To begin with, I merged ADC click and DAC click and it worked well.

however, when when I merge RTD and DAC, RTD does not seem to give me correct temperature reading. Code below is the RTD Click example with DAC click header includes and also microbus2 definition under systemInit(). This prints wrong temperature readings (way off the expected values). once I remove the microbus2 definition, it works well.

Could you please help on this

#include "Click_RTD_types.h"
#include "Click_RTD_config.h"

#include "Click_DAC_types.h"
#include "Click_DAC_config.h"

void systemInit()
{
mikrobus_gpioInit( _MIKROBUS1, _MIKROBUS_CS_PIN, _GPIO_OUTPUT );
mikrobus_spiInit( _MIKROBUS1, &_RTD_SPI_CFG[0] );

mikrobus_gpioInit( _MIKROBUS2, _MIKROBUS_CS_PIN, _GPIO_OUTPUT );
mikrobus_spiInit( _MIKROBUS2, &_DAC_SPI_CFG[0] );

mikrobus_logInit( _LOG_USBUART, 9600 );

Delay_ms( 100 );
}

void applicationInit()
{
rtd_spiDriverInit( (T_RTD_P)&_MIKROBUS1_GPIO, (T_RTD_P)&_MIKROBUS1_SPI );
rtd_writeRegister(_RTD_CONFIGURATION, 0xD0);
}

void applicationTask()
{
uint16_t readValue;
float convertedValue;
char testTxt [20];
char testTxt1 [20];

readValue = rtd_readTemperature();
convertedValue = rtd_convertTemperature(readValue, _RTD_REF_RESISTANCE_470);

floatToStr(readValue, testTxt1);
floatToStr(convertedValue, testTxt);
mikrobus_logWrite("Current temperature: ", _LOG_TEXT );
mikrobus_logWrite(testTxt, _LOG_LINE );
mikrobus_logWrite("Voltage: ", _LOG_TEXT );
mikrobus_logWrite(testTxt1, _LOG_LINE );
delay_ms(800);
}

void main()
{
systemInit();
applicationInit();

while (1)
{
applicationTask();
}
}

siva raman
ramshiva

posted on 2019/08/16 04:58:31 PM CEST

Audio & Speech

PIC18F67K40 : FAT32 Example Code

I'm using Mikroc 7.5, In predefined FAT32 library there's a function,

FAT32_FindFirst(__DIR *pDE);

I don't know how to use this function, I need example code for this ???

Lutfur Rahman
babul

posted on 2019/08/01 12:49:32 PM CEST

Audio & Speech

i want to join elecnote.blogspote.com. please help me.

i want to join elecnote.blogspote.com. please help me.

Lutfur Rahman
babul

posted on 2019/07/31 11:45:15 PM CEST

Audio & Speech

I want to browse elecnote.blogspot.com

I want to browse elecnote.blogspot.com , what can i do ? please help me .

Lutfur Rahman
babul

posted on 2019/07/31 11:37:38 PM CEST

Audio & Speech

i want to brouse elecnote.com

i want to brouse elecnote.com , what can i do ?

first | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 last