LPC1768 Landtiger board USB configuration

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC1768 Landtiger board USB configuration

832件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andy_man on Sun Apr 03 08:04:18 MST 2016
Hi all,

I am trying to use the PLL0 clock to drive the USB clock at 48 MHz, which I accomplished. Now I am trying to configure the USB peripheral. In my program so far I setup the PLL0 clock. Then I successfully enabled PCUSB. But when I try and turn on the DEV_CLK_ON bit and the AHB_CLK_ON bit the LPC_USB->USBClkSt register does not show that the bits have been enabled in simulation. My goal is to initialize and configure the USB peripheral on my own so I get a good understanding of how it functions.

//my code to setup the USB
void usb_setup(void){

LPC_SC -> PCONP |= 0x80000000; //enable PCUSB
LPC_USB->USBClkCtrl = 0x1A; //turn on DEV_CLK_ON and AHB_CLK_ON

while((LPC_USB->USBClkSt & 0x1A) != 0x1A); //wait until the USBClkSt register recognizes the changes in USBClkCtrl

return;
}
ラベル(1)
0 件の賞賛
返信
3 返答(返信)

744件の閲覧回数
lpcware
NXP Employee
NXP Employee
bump
0 件の賞賛
返信

744件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andy_man on Mon Apr 04 09:48:32 MST 2016
Tanks for the suggestion, I will take a look at the OTG chapter and see what effect enabling all clocks has.
0 件の賞賛
返信

744件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MikeSimmonds on Mon Apr 04 09:24:16 MST 2016
Look at the OTG clock control register.

I am doing host mode (non OTG) and thought to leave the device and I2C clock bits unset.
But to allow peripheral view in the dubugger I had to enable ALL clocks (i.e OTGCLOCK = 0x1F rather than 0x19)
Note the description is in the OTG chapter but it (and the function select register) apply also to device and host modes.

HTH, Mike.
0 件の賞賛
返信