Hello, i am using STM8L151C8T6 for learning purpose where i want to access the port of the MCU. I have initialize the port B and Port E of the controller high with the power on. (PB.0 and PE.0) and configure them with pull-up and in fast mode.
when i probed the pin of the respected port and view them on the MSO i found the delay between them.Port B was initialize first and port E later even though initialize the Port E first and Port B later. i don't want this delay between the port E and Port B as this delay is undesirable to circuit. why it this delay occurring, is there something called PORT INITIALIZATION delay? how can i get rid of this delay and make both port pin high on power ON..
please help me out on this issues.. i have attache the code and the result of the MSO .
thankyou
#include "stm8l15x.h"
#include "stm8l15x_flash.h"
#include "main.h"
void main(void)
{
/*************************************CLOCK INIT*******************************************************************/
/* Set System Clock divider to 1 */
CLK->CKDIVR = 0x00; // divide the internal clock of 16MHz by 1
CLK->PCKENR1 |= 0xFF; // provide clock to all the peripherals
CLK->PCKENR2 |= 0xFF; // provide clock to all the peripherals
CLK->PCKENR3 |= 0xFF; // provide clock to all the peripherals
/*************************************GPIO INIT*********************************************************************/
GPIOE->DDR = 0x1B;
GPIOE->CR1 = 0xDB; // Push-pull, pull ups
GPIOE->CR2 = 0x1B; // outputs in fast mode ,FLT_G input not as interrupt
GPIOE->ODR |= 0x01;
GPIOB->DDR = 0x2F;
GPIOB->CR1 = 0xEF; //input as pull up, output as pushpull
GPIOB->CR2 = 0x2F; //input without interrupt, output in fast mode
GPIOB->ODR |= 0x01; // without interrupt
}