Other Parts Discussed in Thread: AM1808
Hi,
I have a problem setting AM1808 Chip Configuration register2(CFGCHIP2).
I'm trying to set CFGCHIP2 to initialize USB2.0 Controller,
but when I check CCS register window after running the program,
the CFGCHIP2 value was not changed.
Do you need any settings other than KICK register before accessing CFGCHIP2?
Am I missing some settings?
By the way I refer to AM1808EVM BSL, and the code is like following:
*****************************************************************************
void usb0_init(void)
{
short i;
/*UNLOCK KICK0/1 register for setting CFGCHIP2 register*/
*( unsigned int*)KICK0R = 0x83E70B13;
*( unsigned int*)KICK1R = 0x95A4F1E0;
/*Reset USB2.0 Controller*/
*( unsigned int*)USB0_CTRLR |= 0x00000001;
/*Wait until USB2.0 Controller reset is completed*/
while((*( unsigned int*)USB0_CTRLR & 0x1) == 1);
/*Reset: Hold PHY in reset*/
*( unsigned int*)CFGCHIP2 |= 0x00008000;
/*Drive Reset for few clock cycles*/
for(i=0; i<50; i++);
/*RESET: Release PHY from reset*/
*( unsigned int*)CFGCHIP2 &= 0xFFFF7FFF;
/*Configure PHY with the Desired Operation*/
//OTGMODE
*( unsigned int*)CFGCHIP2 &= 0xFFFF9FFF; // 00=> Do Not Override PHY Values
//PHYPWDN
*( unsigned int*)CFGCHIP2 &= 0xFFFFFBFF; // 1/0=> PowerdDown/ NormalOperation
//OTGPWDN
*( unsigned int*)CFGCHIP2 &= 0xFFFFFDFF; // 1/0=> PowerdDown/ NormalOperation
//DATAPOL
*( unsigned int*)CFGCHIP2 |= 0x00000100; // 1/0=> Normal/ Reserved
//SESNDEN
*( unsigned int*)CFGCHIP2 |= 0x00000020; // 1/0=> NormalOperation/ SessionEnd
//VBDTCTEN
*( unsigned int*)CFGCHIP2 |= 0x00000010; // 1/0=> VBUS Comparator Enable/ Disable
/*Configure PHY PLL use and Select Source*/
//REF_FREQ[3:0]
*( unsigned int*)CFGCHIP2 |= 0x00000002; // 0010b=> 24MHz Input Source
//USB2PHYCLKMUX: Select External Source
*( unsigned int*)CFGCHIP2 &= 0xFFFFF7FF; // 1/0=> Internal/External(Pin)
//PHY_PLLON: On Simulation PHY PLL is OFF
*( unsigned int*)CFGCHIP2 |= 0x00000040; // 1/0=> On/Off
/*Wait until PHY Clock is Good*/
while((*( unsigned int*)CFGCHIP2 & 0x00020000) == 0); //wait until phy clock is good
}
********************************************************************************
best regards,
g.f.