Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - tha

#905
6.4.4 GPIO port pull-up/pull-down register (GPIOx_PUPDR) (x = A to K)

Address offset: 0x0C
Reset value: 0x6400 0000 (for port A)
Reset value: 0x0000 0100 (for port B)
Reset value: 0x0000 0000 (for other ports)



Bits 31:0 PUPDR[15:0][1:0]: Port x configuration I/O pin y (y = 15 to 0)
     บิตเหล่านี้ถูกเขียนโดย software เพื่อกำหนดค่า the I/O pull-up or pull-down
     00: No pull-up, pull-down
     01: Pull-up
     10: Pull-down
     11: Reserved
#906
6.4.3 GPIO port output speed register (GPIOx_OSPEEDR) (x = A to K)

Address offset: 0x08
Reset value: 0x0C00 0000 (for port A)
Reset value: 0x0000 00C0 (for port B)
Reset value: 0x0000 0000 (for other ports)



Bits 31:0 OSPEEDR[15:0][1:0]: Port x configuration I/O pin y (y = 15 to 0)
     บิตเหล่านี้ถูกเขียนโดย software เพื่อกำหนดค่า the I/O output speed.
     00: Low speed
     01: Medium speed
     10: High speed
     11: Very high speed
  Note: ดูที่ the product datasheets สำหรับค่าของ OSPEEDRy bits เทียบกับ VDD range และ external load.
#907
6.4.2 GPIO port output type register (GPIOx_OTYPER) (x = A to K)

Address offset: 0x04
Reset value: 0x0000 0000



Bits 31:16 Reserved, must be kept at reset value.

Bits 15:0 OT[15:0]: Port x configuration I/O pin y (y = 15 to 0)
     บิตเหล่านี้ถูกเขียนโดย software เพื่อกำหนดค่า the I/O output type.
     0: Output push-pull (reset state)
     1: Output open-drain
#908
6.4 GPIO registers

section นี้ให้ a detailed description ของ the GPIO registers.
สำหรับข้อมูลสรุปของ register bits, register address offsets and reset values, ดูที่ Table 23.
The peripheral registers สามารถถูกเขียนใน word, half word or byte mode.

6.4.1 GPIO port mode register (GPIOx_MODER) (x =A to K)

Address offset:0x00
Reset value:
•   0xA800 0000 for port A
•   0x0000 0280 for port B
•   0x0000 0000 for other ports



Bits 31:0 MODER[15:0][1:0]: Port x configuration I/O pin y (y = 15 to 0)
     บิตเหล่านี้ถูกเขียนโดย software เพื่อกำหนดค่า the I/O mode.
     00: Input mode (reset state)
     01: General purpose output mode
     10: Alternate function mode
     11: Analog mode
#909
6.3.14 Using the GPIO pins in the backup supply domain

The PC13/PC14/PC15/PI8 GPIO functionality จะสูญหายเมื่อ the core supply domain ถูก powered off (เมื่อ the device เข้าสู่ Standby mode). ในกรณีนี้, ถ้า GPIO configuration ของพวกมันไม่ถูกข้ามผ่านโดย the RTC configuration, pins เหล่านี้จะถูกเซ็ตใน an analog input mode.
#910
6.3.13 Using the HSE or LSE oscillator pins as GPIOs

เมื่อ the HSE or LSE oscillator ถูก switched OFF (สถานะเริ่มต้นหลังจาก reset), the related oscillator pins สามารถถูกใช้เป็น normal GPIOs.

เมื่อ the HSE or LSE oscillator ถูก switched ON (โดยการเซ็ต the HSEON or LSEON bit ใน the RCC_CSR register) the oscillator จะควบคุม pins ที่เกี่ยวข้องของมันและ the GPIO configuration ของ pins เหล่านี้จะไม่มีผลอะไร.

เมื่อ the oscillator ถูกกำหนดค่าใน a user external clock mode, เฉพาะ the OSC_IN หรือ OSC32_IN pin ถูกสงวนไว้สำหรับ clock input และ the OSC_OUT or OSC32_OUT pin ยังคงสามารถถูกใช้สำหรับ normal GPIO.
#911
6.3.12 Analog configuration

เมื่อ the I/O port ถูกโปรแกรมเป็น analog configuration:
•   The output buffer ถูกปิดใช้งาน
•   The Schmitt trigger input ถูกทำให้ไม่ทำงาน, จัดให้มี zero consumption สำหรับทุกๆ analog value ของ the I/O pin. The
     output ของ the Schmitt trigger ถูกบังคับให้เป็น a constant value (0).
•   The weak pull-up and pull-down resistors ถูกปิดใช้งานโดย hardware
•   Read เข้าถึงไปยัง the input data register จะได้ the value "0"

Figure 22 แสดง the high-impedance, analog-input configuration ของ the I/O port bits.

#912
6.3.11 Alternate function configuration

เมื่อ the I/O port ถูกโปรแกรมเป็น alternate function:
•   The output buffer สามารถถูกกำหนดค่าใน open-drain หรือ push-pull mode
•   The output buffer ถูกขับโดย the signals ที่มาจาก the peripheral (transmitter enable and data)
•   The Schmitt trigger input ถูกทำให้ทำงาน
•   The weak pull-up and pull-down resistors ถูกทำให้ทำงานหรือไม่ขึ้นอยู่กับ the value ใน the GPIOx_PUPDR register
•   The data ที่ปรากฎบน the I/O pin จะถูกสุ่มลงใน the input data register ทุกๆ AHB clock cycle
•   A read เข้าถึงไปยัง the input data register จะได้ the I/O state

Figure 21 แสดง the Alternate function configuration ของ the I/O port bit.