cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Sbhen.1488
Associate II

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
}

0690X00000Arxy1QAB.png

5 REPLIES 5
Willunen
Associate III

Are you by any chance measuring that delayed signal on an input port? If so what happens when you add an external pull-up resistor of 1 k to it? I'm guessing that the (high) resistance of the internal pull-up resistor and the capacitance on the pin (+probe) are responsible for the delay.

Sbhen.1488
Associate II

11

no i measuring the signal at the output side of the controller.. signal through the controller pass through the buffer,which is enable by the controller, we have an external pull-up resistor for this pins as well of 4.7k ohms.. not able to decode by this delay occurs one of the circuit while there is not delay when im measuring in the other same circuit

The code you showed is the initialization of the ports. I used the same code on a STM8S103K3 running at 16 MHz and I got a delay of 500ns. We are talking about the initialization ONLY, right? Because I do not understand what you mean with "pass through the buffer". What buffer?

0690X00000As6lkQAB.jpg

i have connected the buffer at the controller end end (+external pull on the port) . Yes we are talking about the port initialization only. The port is pins are connected to a buffer and buffer enable signal (logic low) is controlled by another controller pin(PB,1)..

i finally decode the issues.. Actually the buffer only needed to be externally pulled up with power on which was not done, that cause the delay

thank you or the support