Discussion in "ARM Development" started by    Vito    May 14, 2009.
Thu May 14 2009, 04:34 pm
Hi All, i am a newcomer (and newbie).
I will already explain my question.

I am working on a Host driver for Max3421 on a Lpc2148 based card.
I am using the Maxim usb laboratory source.
My problem is that when the source issues the reset_host() function that should reset the USB Host, happens the following:

1. It reset the lpc2148 too.
Once the microprocessor restarts:
2. the second time it does reset_host it doesn't reset the LPC2148 but it locks in a while controlling when the PLL will become stable, and never exits from there....

any idea why this could be happening ?
i was thinking that the problem could be the SPI reading... but i am not sure...
i'm too noob to know.
Thanks in advance.


Thu May 14 2009, 05:20 pm
can u post the code in zip, I have not seen the Maxim codes yet.

are you using polling based SPI or what?
Thu May 14 2009, 05:51 pm
Ok that is the source in the zip...
But i discovered another thing.... Is just the USB process that restarts microcontroller... and not Host_restart()...
but the point 2) is still valid: it blocks in that while after the restart....
Thu May 14 2009, 05:52 pm

I ask my apologies for the source is in a very messed manner....
but you know... it's a consequence of a 'fast modify job'
thank you
Thu May 14 2009, 05:54 pm

Ops.... apologies again.... the first row of Reset_Host() is commented... but that was a guess....
in the official code... it's enabled.... nothing changes for me btw...
Thu May 14 2009, 06:50 pm
i downloaded USB code from Maxim site too.. as per shown in block diagram, it should only reset the Host controller not the micro itself. well i need to take a close look on the code. are you trying to monitor it somehow?
Thu May 14 2009, 07:09 pm
well i'm just doing some debugging stuff with text of uart0puts();

i tried to comment the Reset_Host()... i guess if that call is necessary... and that way it goes on...
but... i discovered that it's not that Reset_Host() that resets the microcontroller...
i putted a wait_ms(300) to the beginning of the vUsbTask() function... and now it does not resets anymore the microcontroller...!!
it blocks the same in the while() in the Host_Reset();
i got to come until he prints "waiting for a device".... but obviously nothing happens....

now i have 2 guess... ::
1) i'm not communicating well by the SPI
2) i'm not doing well with IRQs that the Host needs to read via the SPI

i'd like to have a your opinion..

thanks alot

[ Edited Thu May 14 2009, 07:11 pm ]
Thu May 14 2009, 07:10 pm
i wonder if that reset_host() is necessary......

[ Edited Thu May 14 2009, 07:12 pm ]
Thu May 14 2009, 07:18 pm
well according to USB documentation in USB2.0
only first reset is necessary which is just after u plugin the device.

after host send the GET_DESCRIPTOR command to slave, it is not required to send reset after that. but its generally recommended to do that.

after that host sets address of the slave connected.
Thu May 14 2009, 07:23 pm
uhm.... so... the first call to the reset_host should be there.....i guess..

the truth is that the critical block in that function is just this:

while(!(Host_SPI_Read(rUSBIRQ) & bmOSCOKIRQ)) {};

from that locked while i was doubting that i'm not doing well the stuff with SPI or IRQs.....
or twice the things

[ Edited Thu May 14 2009, 07:27 pm ]

Get Social


Powered by e107 Forum System



Sun May 19 2024, 07:39 am
Sat May 18 2024, 07:28 am
Fri May 17 2024, 06:14 pm
Fri May 17 2024, 10:28 am
Fri May 17 2024, 10:19 am
Fri May 17 2024, 09:53 am
Fri May 17 2024, 09:46 am
Thu May 16 2024, 07:31 pm