7.2.2 Port configuration register high (GPIOx_CRH) (x=A..G)
Address offset: 0x04
Reset value: 0x4444 4444
7.2.3 Port input data register (GPIOx_IDR) (x=A..G)
Address offset: 0x08h
Reset value: 0x0000 XXXX
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
CNF15[1:0] MODE15[1:0] CNF14[1:0] MODE14[1:0] CNF13[1:0] MODE13[1:0] CNF12[1:0] MODE12[1:0]
rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CNF11[1:0] MODE11[1:0] CNF10[1:0] MODE10[1:0] CNF9[1:0] MODE9[1:0] CNF8[1:0] MODE8[1:0]
rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw
Bits 31:30, 27:26,
23:22, 19:18, 15:14,
11:10, 7:6, 3:2
CNFy[1:0]: Port x configuration bits (y= 8 .. 15)
These bits are written by software to configure the corresponding I/O port.
Refer to Table 16: Port bit configuration table.
In input mode (MODE[1:0]=00):
00: Analog mode
01: Floating input (reset state)
10: Input with pull-up / pull-down
11: Reserved
In output mode (MODE[1:0] > 00):
00: General purpose output push-pull
01: General purpose output Open-drain
10: Alternate function output Push-pull
11: Alternate function output Open-drain
Bits 29:28, 25:24,
21:20, 17:16, 13:12,
9:8, 5:4, 1:0
MODEy[1:0]: Port x mode bits (y= 8 .. 15)
These bits are written by software to configure the corresponding I/O port.
Refer to Table 16: Port bit configuration table.
00: Input mode (reset state)
01: Output mode, max speed 10 MHz.
10: Output mode, max speed 2 MHz.
11: Output mode, max speed 50 MHz.
gpioc-crh=0b00110011 oldugunda c portunun 8. ve 9. pininin durumu ne oluyor.
Alıntı yapılan: bulutay - 06 Nisan 2017, 16:03:32
gpioc-crh=0b00110011 oldugunda c portunun 8. ve 9. pininin durumu ne oluyor.
GPIOC->CRH |= 0x00000033; // PC8,PC9 Output push-pull - Speed 50Mhz
GPIOC->CRH |= 0x000000BB; // PC8,PC9 AF push pull -Speed 50Mhz
GPIOC->CRH |= 0x00000088; // PC8,PC9 Input pull-up pull-down
oluyor.
MODE bitleri 11 olduğundan, 0 dan büyük seçeneği seçilir ve mode 11 de 50mhz ve cnfy bitleri de 00 olduğundan output pushpull seçilir.
Neden standard peripheral library kullanmak yerine registerlar'la boğuşuyorsun ?
Bir sorum olacak. 32f100 disco kitindeki swd aracılığıyla programlanabilir mi?. Bu işlemciyi içeren bir kart tasarlamayı düşünüyorum
Swdio swclk ve gnd pinlerini disco kitindeki ilgili yer ile baglayabildiigin surece program atabilirsin. AliExpress den klon stlink alirsan daha rahat edersin.
Anladım. Eyvallah