HOW TO READ UART FROM PZEM 004T
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-12-13 6:03 PM
I need help with using pzem 004t in stm32f405 with uart communication. i have check this source willyvamp/STM32F103C8T6-PZEM004T-DHT11: HAL STM32 (github.com) but still dont get the data form uart. please help
Solved! Go to Solution.
- Labels:
-
Github
-
STM32F1 Series
-
STM32F4 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-12-16 2:24 AM
thank you for your response sir, i solved it by using manual function in this reference (363) PZEM-004T + STM32/Cortex измерение �?нергии + в�?�?кое - YouTube
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-12-13 9:13 PM
Your code is going to be different, using a different board and different pins.
Perhaps provide that and how you're wiring this all up so some conclusion about why it is not working can be drawn.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-12-13 9:24 PM
thankyou for your quickc response.
yes i do, i change the uart handle and some other but still dont work. it makes me confused what is the problems
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-12-14 12:15 AM
provide that and how you're wiring this all up
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-12-14 12:17 AM
are you trying to programm a stm32f405 with code compiled for stm32f103?
Edit: i read the datasheet and it doesnt say anything about what Uart configurations are needed.
But looking at the github progect you shared , they are using huart2 to interface this sensor.
And these are the uart configurations you need:
static void MX_USART2_UART_Init(void)
{
/* USER CODE BEGIN USART2_Init 0 */
/* USER CODE END USART2_Init 0 */
/* USER CODE BEGIN USART2_Init 1 */
/* USER CODE END USART2_Init 1 */
huart2.Instance = USART2;
huart2.Init.BaudRate = 9600;
huart2.Init.WordLength = UART_WORDLENGTH_8B;
huart2.Init.StopBits = UART_STOPBITS_1;
huart2.Init.Parity = UART_PARITY_NONE;
huart2.Init.Mode = UART_MODE_TX_RX;
huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE;
huart2.Init.OverSampling = UART_OVERSAMPLING_16;
if (HAL_UART_Init(&huart2) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN USART2_Init 2 */
/* USER CODE END USART2_Init 2 */
}
just take any tutorial and staert from there
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-12-16 2:24 AM
thank you for your response sir, i solved it by using manual function in this reference (363) PZEM-004T + STM32/Cortex измерение �?нергии + в�?�?кое - YouTube
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-12-16 3:18 AM
tick yourself as best answer then
