Posted on September 26, 2016 at 03:02The original post was too long to process during our migration. Please click on the attachment to read the original post.
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.
Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Posted on November 09, 2016 at 06:33Dear Sir,Dont you think, if your 7segment need to be glow for few milicond, buzzer should be get pwm afterwords some time, SPI+DMA activated for transfer dada, GPIO and push switches need to SET/RESET, these whole story can be done only in a main C file? Dont you think, for particular operation state machine is required?
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 this
Posted on November 09, 2016 at 09:58Dear Sir,What a nice code you have suggested! Thank you that you are helping me a lot.You have nicely read those raw data, but if we add something for unit, doses it work ?double max31855_readCelsius() { uint32_t v = 0; GPIO_ResetBits(SPI_GPIO_PORT,SPI_CS_PIN); v = (uint32_t)max31855_ReadData() << 16 | max31855_ReadData(); // �?¿ GPIO_SetBits(SPI_GPIO_PORT,SPI_CS_PIN); float internal = (v >> 4) & 0x7FF; internal *= 0.0625; if ((v >> 4) & 0x800) internal *= -1; if (v & 0x7) { return -333; // } if (v & 0x80000000) { v = 0xFFFFC000 | ((v >> 18) & 0x00003FFFF); } else { v >>= 18; } double centigrade = v; centigrade *= 0.25; return centigrade;Give your comment sir!