GPIOx_moder register direct access cannot be Updated

mikroC, mikroBasic and mikroPascal for PRO ARM® MCUs, supporting STM32, Tiva, Kinetis, & CEC devices
Post Reply
Author
Message
dyjt03
Posts: 11
Joined: 15 Dec 2015 06:28

GPIOx_moder register direct access cannot be Updated

#1 Post by dyjt03 » 24 Jan 2020 06:15

hi,

Does anyone know why Gpiox_Moder register cannot be updated?.

I am currently using Clicker 2 for STM32f407VG program using CodeGrip debugger.

Attach here are the code:

sbit Led1 at GPIOE_ODR.B12; //Set Led1 as Output bit12 GPIOE register
sbit Led2 at GPIOE_ODR.B15; //Set Led2 as Output bit15 GPIOE register
sbit PB1 at GPIOE_IDR.B0; //Set Pushbutton1 as Input bit0 GPIOE register
sbit PB2 at GPIOA_IDR.B10; //Set Pushbutton2 as Input bit10 GPIOA register


//Main
void main() {
//Initialized Pin
GPIOA_MODER |= 0x00000000; //Set all GPIOA to Input
GPIOE_MODER = 0x41000000; //Set GPIOE <15:12> to Output & GPIOE <0> to Input


Led1 = 0; //Set GPIOE12 to LOW
Led2 = 0; //Set GPIOE15 to LOW

while(1){ //loop

if (PB1 == 0){
Delay_ms(100); //Debounce for 100msec
Led1 = 1; //Set GPIOE12 TO HIGH
Delay_ms(250); //Delay for 250msec
Led1 = ~led1; //toggle GPIOE
}

if (PB2 == 0){
Delay_ms(100); //Debounce for 100msec
Led2 = 1; //Set GPIOE15 to HIGH
Delay_ms(250); //Delay for 250msec
Led2 = ~led2; //toggle GPIOE
}

}


Running Debugger simulation does Update or changes the GPIOE_Moder register.

However using Debugger Hardware shown no changes from reset state! :?

Using bulit-In GPIO library has no problem though.

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: GPIOx_moder register direct access cannot be Updated

#2 Post by filip » 12 Mar 2020 11:34

Hello,

Have you been able to solve this issue ?

Regards,
Filip.

dyjt03
Posts: 11
Joined: 15 Dec 2015 06:28

Re: GPIOx_moder register direct access cannot be Updated

#3 Post by dyjt03 » 01 Aug 2020 04:41

Yes I was able to resolve the issues thanks for replying.

Post Reply

Return to “ARM PRO Compilers”