Hi,
Currently i am working on a project where i need to measure temperature on 4 different places. I am using PIC18 on EasyPIC dev board with 2 mikroBUS sockets,
so i tought of using a shuttle click with 4 RTD clicks. My question is, is it possible to use 4 RTD clicks at the same time since they are using the same SPI, and how to do it? And if not, is there any possible solution for this problem (maybe using clicks for thermocouples, or something similar)?
Kind regards,
Luka
Temperature measuring
Re: Temperature measuring
Hi,
Yes, it is possible to use multiple RTD clicks in one project.
For example, for the EasyPIC7 you have two mikroBUS sockets, so you should define CS pins as output :
Then you should successively initialize the desired RTD click in applicationInit function before reading its value :
or
Regards,
Filip.
Yes, it is possible to use multiple RTD clicks in one project.
For example, for the EasyPIC7 you have two mikroBUS sockets, so you should define CS pins as output :
Code: Select all
void systemInit()
{
mikrobus_gpioInit( _MIKROBUS1, _MIKROBUS_CS_PIN, _GPIO_OUTPUT ); // set CS on mikroBUS1 as output
mikrobus_gpioInit( _MIKROBUS2, _MIKROBUS_CS_PIN, _GPIO_OUTPUT ); // set CS on mikroBUS2 as output
mikrobus_spiInit( _MIKROBUS1, &_RTD_SPI_CFG[0] );
mikrobus_logInit( _LOG_USBUART, 9600 );
Delay_ms( 100 );
}
Code: Select all
rtd_spiDriverInit( (T_RTD_P)&_MIKROBUS1_GPIO, (T_RTD_P)&_MIKROBUS1_SPI );
Code: Select all
rtd_spiDriverInit( (T_RTD_P)&_MIKROBUS2_GPIO, (T_RTD_P)&_MIKROBUS2_SPI );
Filip.
Re: Temperature measuring
Hi,
Filip, thak you very much on your answer!
I am new to this and i would like to ask another question, since i googled it but i could not find an answer.
The thing is: is it possible to use multiple SPI devices on the same mikroBUS socket (with Shuttle click) and if it is possible how to do it?
I know that for I2C communication there is a I2C MUX 2 click which makes possible to use four I2C devices on same mikroBUS socket, but is there a way to do it with devices that use SPI? I am asking this because i need to use 4 RTD clicks and 4-20mA R click and they all use SPI communication. So, a Shuttle click would expand one mikroBUS socket to four sockets plus the second mikroBUS socket would make five sockets, which is perfect for this project
Thanks in advance,
Luka
Filip, thak you very much on your answer!
I am new to this and i would like to ask another question, since i googled it but i could not find an answer.
The thing is: is it possible to use multiple SPI devices on the same mikroBUS socket (with Shuttle click) and if it is possible how to do it?
I know that for I2C communication there is a I2C MUX 2 click which makes possible to use four I2C devices on same mikroBUS socket, but is there a way to do it with devices that use SPI? I am asking this because i need to use 4 RTD clicks and 4-20mA R click and they all use SPI communication. So, a Shuttle click would expand one mikroBUS socket to four sockets plus the second mikroBUS socket would make five sockets, which is perfect for this project
Thanks in advance,
Luka
Re: Temperature measuring
Hi,
Yes, you can use multiple click board with Shuttle click, but in the case of SPI oriented click boards you will need a separate CS line for each one.
If the click boards use the same CS line there will be collision on SPI bus, as all of them will communicate at the same time (the Chip Select line should select a single sensor at a time).
Regards,
Filip.
Yes, you can use multiple click board with Shuttle click, but in the case of SPI oriented click boards you will need a separate CS line for each one.
If the click boards use the same CS line there will be collision on SPI bus, as all of them will communicate at the same time (the Chip Select line should select a single sensor at a time).
Regards,
Filip.
Re: Temperature measuring
Filip, thank you very much! I will try to implement this