2016-09-25 06:02 PM
2016-09-25 06:29 PM
You need to wait for TXE assert before sending each character to the USART.
The first code uses the SPL, the SPI code uses the HAL, these two libraries are not inter-operable. Where there is one choice among many, use if-else-if or switch-case Test the code in small pieces, confirming each works as expected.2016-11-08 09:33 PM
2016-11-08 11:18 PM
I'm not looking to make design decisions in a project that isn't mine, and is not clearly defined. There are often many ways to solve a problem, but it is important to understand what hardware design is already committed, and what the goals and functionality are. I'm open to offers for my time and insight.
For the MAX31855, the extraction of the 14-bit temperature might look like thisuint32_t MAX31855_readData()
{
uint8_t pDataRx[4] = { };
MAX31855_chipSelect();
HAL_SPI_Receive(&hspi1, (uint8_t*) pDataRx, 4, 1000);
MAX31855_chipUnselect();
return (pDataRx[0] <<
24
) | (pDataRx[1] << 16) | (pDataRx[2] << 8) | pDataRx[3];
}
{
uint32_t raw, shifted;
float temp;
raw
=
MAX31855_readData
();
// Thermocouple Temperature, you might want to check other bits for validity
shifted
=
raw
>> 18; // Pull down 14-bit most significant bits
if (shifted & (1 << 13)) shifted |= 0xFFFFFFFF << 14; // sign extend
temp = (float)((int)shifted) * 0.25f; // scaled fractional, ie quarter degrees
}
2016-11-09 12:58 AM
2016-11-09 01:52 AM
http://forum.easyelectronics.ru/viewtopic.php?p=382118&#p382118
2016-11-09 08:23 PM
Dear Sir waclawek,
I appreciate your link and its same where I got the reference.But, if you can explain the issue narrated before will be reasonable !