UART2 is not working on STM8S Discovery board?
Hi Technical team,
UART2 is always sending garbage value rather required(correct) value.
Hardware used : STM8S discovery with 5V
IDE used : IAR
The below shows the code ,
// STM8S105 discovery
#include "stdio.h"
#include "string.h"
#include "stm8s.h"
#include "hyperterminal.h"
#define _UART2 1
void main(void)
{
/*High speed internal clock prescaler: 1 i.e. Fmaster = 16MHz*/
CLK_HSIPrescalerConfig(CLK_PRESCALER_HSIDIV1);
UART2_DeInit();
UART2_Init((u32)9600, UART2_WORDLENGTH_8D, UART2_STOPBITS_1, UART2_PARITY_NO, UART2_SYNCMODE_CLOCK_DISABLE, UART2_MODE_TXRX_ENABLE);
/*Main loop*/
while (1){
SerialPutString("\r\n STM8S-Discovery r\n");
}
}
Please suggest your thought to solve this problem
or please give me proper link
