Topic : how to acceded to PC8 to PC15 with pointer

Forum : Ride IDE

Original Post
Post Information Post
November 24, 2015 - 11:29am
Sylvain LAURENT

Hi everybody,

Because it's too simple for my algorithm, I would like to access to GPIOC8 to 15 without using lot of mask.

I want to use pointer :
u8* GPIOC_H = 0x4001100D;
u8* GPIOC_L= 0x4001100C;

GPIOC_L = 0;
GPIOC_H = 0xFF;

The result is that GPIOC_H and GPIOC_L are the same and equal to 0xFF.
But I would like, GPIOC_L = 0 and GPIOC_H = 0xFF directely.

I think it's a problem of alignment ?? 
Which is your opinion ?

Replies
Post Information Post
+1
0
-1
November 24, 2015 - 11:59am
Sylvain LAURENT

Ok, I have an explanation.

"When a 16- or 8-bit access is performed on an APB register, the access is transformed into
a 32-bit access: the bridge duplicates the 16- or 8-bit data to feed the 32-bit vector."

+1
0
-1
December 7, 2015 - 4:37pm
Etienne Cassin

Great, Thank you for the explanation.