2015-03-06 12:32 AM
Hi, i am very new to STM32, just installed the IAR environment. Appreciate if anyone could advise.
Is there a UART example of String transfer using UART TX/RX of PA9 and PA10 in Polling mode for STM32L053 Discovery Kit (Between PC and Kit) ?Thanks2015-05-13 09:30 AM
You said in your first post in this thread:
> I have successfuly connected the stm32 pins PA9 and PA10 and with a FTDI Chip with a RS-232 Femal on my PC. > I test this connection with the HTERM. Now what is exactly your problem? You don't know how to store incoming bytes in an array? JW2015-05-13 09:35 AM
You'd accumulate the data one byte at a time and process it once you'd reach some specified limit, or some line termination (CR, LF, etc)
See the NMEA cites earlier.I'm not using L0 or Cube, but receiving bytes from a USART should be materially the same across all variants of Cube (this the selling point as I understand it), and quite similar for most all library and microprocessor combinations.2015-05-14 01:10 PM
Yes, I want to receive and store incomming bytes in an array and to display the content of the array on the e paper.
Thanks2015-05-14 01:58 PM
In pseudocode:
#include <stdint.h>
#define MAX_S_LEN 16
char
s[MAX_S_LEN + 1];
uint_least8_t sPos;
int
main(
void
) {
[initialization code]
sPos = 0;
while
(1) {
if
(uart_receiver_signals_byte_arrival()) {
uint8_t c;
c = uart_pick_byte();
if
(sPos < MAX_S_LEN) {
// prevent buffer overflow, throw away excess
s[sPos] = (
char
)c;
sPos++;
}
if
(c == 0x0D) {
// enter arrived
s[sPos] =
'\0'
;
print_to_epaper(s);
sPos = 0;
}
}
}
}
JW
2015-05-14 04:32 PM
Yes, I want to receive and store incoming bytes in an array and to display the content of the array on the e paper.
Ok, do you have some prior programming experience you can leverage here?2015-05-14 11:59 PM
Thanks for the pseude code.
int main(void) { HAL_Init(); /* Configure LED3 */ BSP_LED_Init(LED3); BSP_LED_Init(LED4); BSP_EPD_Init(); SystemClock_Config(); UartHandle.Instance = USARTx; UartHandle.Init.BaudRate = 9600; UartHandle.Init.WordLength = UART_WORDLENGTH_8B; UartHandle.Init.StopBits = UART_STOPBITS_1; UartHandle.Init.Parity = UART_PARITY_NONE; UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE; UartHandle.Init.Mode = UART_MODE_TX_RX; if(HAL_UART_Init(&UartHandle) != HAL_OK) { Error_Handler(); } BSP_EPD_DrawImage(0, 0, 72, 172, (uint8_t*) picture_2); BSP_EPD_RefreshDisplay(); HAL_Delay(500); This is what i have. Thanks a lot2015-05-18 01:31 AM
Can you help me?
2015-05-18 08:53 AM
Can you help me?
I need some help painting my fence and mowing my grass.I think the answer is no, I can suggest things you can do or review, but I'm not coding your project.2015-05-26 01:37 AM
Hi,
I have some question about the display size. In the paper of stm32l053 the display size is mentioned in 172x72. This size is for a sized picture with 172x72 pixel, but is it also valid for hex? When I send a hex to my display, how must the display be configured? My code of the display configuration: BSP_EPD_DrawImage(0,0,73,119, hextoreceive); BSP_EPD_RefreshDisplay(); BSP_EPD_Clear(EPD_COLOR_WHITE); HAL_Delay(10);2015-06-16 12:15 AM