2012-07-03 10:59 AM
i want to transmit using the stm8l152 on the stm8l discovery board. For that i have used sys config registers to remap the clk and the tx pin to the Port A. I use stvd and raisonance compiler. i cannot understand why i cannot write to any usart register even though i can write in the other registers.
eg. if i write into the CR1 register of the USART of the stm8 USART1->CR1 = 0x10 ;After this when i check the value of the peripheral register CR1 of the usart using stvd the value is always 0x00Even when using any other functions like usart init , usart clock init etc. the value of the usart registers does not change. Is there something files or initializations i should specifically do. ? should the gpio pins be initialized to a certain state or should some remapping of registers be done? any help will be appreciated. thanks #uart-clock-enable2012-07-06 01:43 AM
On the STM8L parts the clock to the peripherals is OFF by default. You need to enable the uart clock before it will work.
CLK_PeripheralClockConfig(CLK_Peripheral_USART1,ENABLE);2014-01-19 12:03 PM