BF52x學習

BF527:

處理器主頻最高600MHz,外設頻率最高133MHz,RISC處理器,

片上內存132K byte,支持SDRAM和異步8 或16 bit控制器,

啓動選擇靈活,可從外部FLASH,SPI,TWI 或者主機設備的SPI,TWI,UART.

使用一次性可編程內存保護代碼安全,

內存管理單元提供內存保護功能,

支持USB2.0並集成802.3標準以太網控制器。

並行外設接口PPI,支持ITU-R 656 視頻數據格式

2個雙通道全雙工SPORTS接口,支持立體聲I2S通道

一個主機DMA接口,12外設DMA通道,包含2個以太網DMA通道,2個內存到內存DMA通道,

1個SPI接口,2個UART接口支持IRDA,一個2線接口(TWI)控制器

8個32位定時器/計數器支持PWM;48個GPIO,一個NFC NAND FLASH 控制器接口,jtag

片上PLL

關於GPIO

共48個GPIO,但大部分有複用功能,默認情況下,PF,PG,PH,處於GPIO模式,PJ不提供GPIO功能,在GPIO模式中,該引腳可配置爲數據輸入,數據輸出和中斷輸入,複用功能必須先設置PORTF_FER, PORTG_FER,  PORTH_FER寄存器。然後設置複用控制寄存器PORTF_MUX, PORTG_MUX, PORTH_MUX。

PF結構

PORT F複用功能如下圖所示,PF功能受PORTF_FER,PORTF_MUX寄存器控制。

     PORTF_MUX 寄存器的Bit 12 位是Port J 的 PPICLK/TMRCLK 引腳的輸入使能控制位,置1 使能,置0 禁止, PORTF_MUX 寄存器的Bit 13-15 位保留。

 PORT G結構

PORT G複用功能如下圖所示,PG功能受PORTG_FER,PORTG_MUX寄存器控制。

          When TMR6 is an output, SPORT0 ignores the external TSCLK0   signal on PG14.Special attention is required for the use of the timers with PPI enabled.Timer 0 and Timer 1 are typically used for PPI frame sync generation.

     Any GPIO can be enabled individually and overrides the peripheral function if the respective bit in the PORTG_FER is cleared.
     Bits 14-15 in the PORTG_MUX register are reserved.

PH結構

PORT H複用功能如下圖所示,PH功能受PORTH_FER,PORTH_MUX寄存器控制。

     Any GPIO can be enabled individually and overrides the peripheral function if the respective bit in the PORTH_FER is cleared.Bits 6-15 in the PORTH_MUX register are reserved.

PORT J結構

     PJ不提供GPIO功能,但提供對TWI信號的支持,

       The PPICLK/TMRCLK pin is enabled by setting bit 12 in the PORTF_MUX register.

Input Tap Considerations

     When input taps (as well as GPIO based taps) are used with other functionality enabled on the GPIO pins, the signals seen by the input tap modules might be different from what is seen on the pins. This is because different pin functions have different signal requirements with respect to when the signal is latched, if at all. Because of this, input taps multiplexed on certain pins may behave differently than those on other pins, depending on which pin function is selected. The input taps will see different signals than at the pins in the following cases:


* All GPIO inputs except  PG0, PG1, PG2, PG9, PG10, PG11, PG12, PG13, PG14, PH3, PH4, PH5, PH7, PH9, PH11, PH13, PH15 when GPIO is tapped with PORTx_FER set to 1.

*TACLK0 if PORTF_FER[4] = 1 and PORTF_MUX[1:0] = b#00 or b#01

*TACLK1 if PORTF_FER[5] = 1 and PORTF_MUX[1:0] = b#00

*TACI0 if PORTF_FER[6] = 1 and PORTF_MUX[1:0] = b#00 or b#01

*TACI1 if PORTF_FER[7] = 1 and PORTF_MUX[1:0] = b#00 or b#01

* CZM if PORTF_FER[11] = 1 and PORTF_MUX[7:6] = b#00 or b#01

* CDG if PORTF_FER[12]= 1 and PORTF_MUX[9:8] = b#00 or b#01

*CUD if PORTF_FER[13] = 1 and PORTF_MUX[9:8] = b#00

*TACI3 if PORTF_FER[15] = 1 and PORTF_MUX[11:10] = b#00 or b#01

* TACI4 if PORTG_FER[8] = 1 and PORTG_MUX[5:4] = b#01

*TACLK2 if PORTH_FER[8] = 1 and PORTH_MUX[3:2] = b#01

 PF,PG,PH,PJ使用系統時鐘工作,當配置這48個GPIO爲輸出時,傳輸數據時鐘應該是系統時鐘的分頻,

當配置爲輸入的時候,設計系統應考慮核心時鐘與系統時鐘之間潛在的等待時間,改變port 引腳狀態時,處理器核心在3個

系統時鐘週期後 才能覺察到。當配置爲中斷輸入時(通過電平的高低進行判斷中斷的存在)When configured for level-sensitive interrupt  generation, there is a minimum latency of 4 SCLK cycles between the time the signal is asserted on the pin and the time that program flow is interrupted. When configured for edge-sensitive interrupt generation, an additional SCLK cycle of latency is introduced, giving a total latency of 5 SCLK cycles between the time the edge is asserted and the time that the core program flow is interrupted.

通過設置外設使能寄存器PORTx_PER控制GPIO的功能,當控制位清除時,處於GPIO模式,若設置GPIO的輸出模式,需設置相應的方向位(在PORTxIO_DIR寄存器中),配置引腳處於數據輸入或中斷輸入時,需使能相應的PORTxIO_INEN寄存器位。

         默認情況下,復位後所有的外設引腳被配置爲輸入,PF、PG、PH的引腳處於GPIO模式,但GPIO模式的輸入功能被禁止,需要上拉電阻。

        當在寄存器PORTx_PER中的控制位被置位,該引腳處於外設功能模式,不在受GPIO模式的控制,但GPIO模塊仍然可以察覺引腳狀態的變化,當使用特定外設接口時,有關該外設使用的引腳必須全部使能,保證清除不必要的控制位。

GPIO模式

          在共48個GPIO中,使用GPIO方向寄存器PORTxIO_DIR,每個GPIO可以被獨立的配置爲輸入或者輸出,當配置爲輸出時,可直接寫GPIO數據寄存器 (PORTFIO, PORTGIO, PORTHIO)來指定該GPIO的狀態。

          GPIO的方向寄存器是可讀寫寄存器,每位對應一個GPIO,邏輯1配置GPIO爲輸出,邏輯0配置GPIO爲輸入,當配置爲輸出時,通過在GPIO數據寄存器中的值驅動該GPIO(假定沒有使能外設使能寄存器)。

         注意的是,當使用GPIO作爲輸入時,需要設置相應的GPIO輸入使能寄存器(PORTxIO_INEN)位,否則處理器不承認GPIO引腳狀態的改變。

        GPIO輸入使能寄存器 (PORTFIO_INEN, PORTGIO_INEN,PORTHIO_INEN) 被用來使能每個GPIO引腳的輸入緩衝區,當系統中不需要PFx, PGx, PHx引腳時,禁止GPIO輸入緩衝區就不需要上拉或下拉電阻了。默認情況下輸入緩衝區禁止,

        注意一旦一個GPIO被設置爲輸入,該GPIO不允許以輸出方式操作,永遠不要使能PORTxIO_INEN的某一位同時設置PORTxIO_DIR的相應位,

      一個對GPIO數據寄存器 (PORTFIO, PORTGIO, PORTHIO)的寫操作會對所有屬於該端口的被配置爲輸出的GPIO設值,所有屬於該端口的被配置爲輸入的GPIO忽略該值,一個對GPIO數據寄存器的讀操作返回所有屬於該端口被配置爲輸出的狀態和被配置爲輸入的狀態。輸入狀態取決於極性和抽樣設置,Table 9-6 helps to interpret read values in GPIO mode, based on the settings of the
PORTxIO_POLAR, PORTxIO_EDGE, and PORTxIO_BOTH registers.

For GPIOs configured as edge-sensitive, a readback of 1 from one of these registers is sticky. That is, once it is set it remains set until cleared by user code. For level-sensitive GPIOs, the pin state is checked every cycle, so the readback value will change when the original level on the pin changes.
       The state of the output is reflected on the associated pin only if the function enable bit in the PORTx_FER register is cleared.


      







發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章