Tuesday, January 3, 2017

Staring at the display

After adding a conversion library and porting the LCD library from c18lib project, and adjusting the microseconds delay, I have a functional example. When you set the pins as outputs on the STM32CubeMX graphic configurator, you must rename them as follows: LCD_D7, LCD_D6, LCD_D5, LCD_D4, LCD_E, LCD_RS. Otherwise, the library will set her own default configuration.

Yep, I used this board for her peripherals. On board, the peripherals are connected only to power lines. with available connectors for arbitrary connections - be it on board, or external. The board was powered at 5Vcc from the Nucleo board. The default configuration and connection to the Arduino socket is as follows:

LCD_D7 to Arduino D7
LCD_D6 to Arduino D6
LCD_D5 to Arduino D5
LCD_D4 to Arduino D4
LCD_E to Arduino D3
LCD_RS to Arduino D2

Note: all the pins from the default configuration are 5V tolerant (not that it really matter as are set as outputs). The LCD was powered at 5Vcc.

Sunday, January 1, 2017

One char after another...

I started the work to onewire library, to test the DS18B20 temperature sensor but realized that I don't know yet how to work with the serial transmission :(. So, I opened the STM32CubeMX for the configuration of a new project that will use the main serial port of the Arduino socket (on my Nucleo board, of course). And, after generating the configuration, you have to look for the HAL API documentation to realize which transmit function you can use.

Of course it didn't worked for the first try, because instead of UART function, I used USART function. It didn't worked until I changed to:

HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, uint8_t *pData,
                        uint16_t Size, uint32_t Timeout)

But now is ok. See the code in repository. In future, I will try the interrupt based functions as I need them for a more advanced program.