Discussion in "ARM Development" started by    Vito    May 14, 2009.
Thu May 14 2009, 07:33 pm
so this means... data is not coming from slave side..

are you sure that it's being stuck there only? i mean how to make sure that this is the problem.

also are you giving some kind of delay? after reset or during reset?
Thu May 14 2009, 08:18 pm
i'm doing delay at the beginning of the vUSBTask, and after some SPI Write... The source i gzipped and attached is how i modified the source of maxim: i didn't use its initialization -> init_PLL() and init_IO(), because i have that functions already working specifically for the microcontroller.
My most fear is that the code of the SPI isn't working, and i am not talking to the pin chip select of the usb that is the P1.20
Could you control that part in my source please ?
thank you
Thu May 14 2009, 08:47 pm
damn... i have to go now... i hope we can talk tomorrow...
thank you

Fri May 15 2009, 01:12 pm
i'd like to know if you think the SPI part is ok.
i know is a bad thing to ask.. but i don't have the necessary experience to know for sure about it.
thank you..
Fri May 15 2009, 01:43 pm
i have to go through your code, but today some problem with server.. i seems to be busy with it..
Fri May 15 2009, 02:57 pm
oh... np... don't worry about it... you just did a lot anyway
just for the update...
i discovered that the command that should issue the reset to the host by the SPI... well it doesn't work...
so .... i guess.. that my thought about the SPI is more and more toward truth
but i need to investigate more to be sure about that...
c u soon
Fri May 15 2009, 10:48 pm
What is the state of reset pin of MAX3421? You won't get OSCOKIRQ if device is being held in reset and that what I think is happening. To check if SPI is functioning, try to read REVISION register. You should get 0x12 if your MAX3421 is relatively fresh.
Mon May 18 2009, 05:23 pm
can you paste the terminal o/p of the following part of code:

printf("First 8 bytes of Device Descriptor ");
	HR = CTL_Read(Get_Descriptor_Device);  	// Get device descriptor into XfrData[]

	if(print_err(HR)) return;	// print_error() does nothing if HRSL=0, returns the 4-bit HRSL.

	printf("(%u/%u NAKS)\n\r",IN_nak_count,HS_nak_count);		// Show NAK count for data stage/status stage
	maxPacketSize = XfrData[7];
	for (ix=0; ix<last_transfer_size;ix++)
		printf("%02X ",(BYTE*)XfrData[ix]);
	printf("EP0 maxPacketSize is %02u bytes\n\r",maxPacketSize);

	// Issue another USB bus reset
	printf("Issuing USB bus reset\n\r");

coz after this your program gets halted right?
Tue May 19 2009, 12:56 pm
hi all..
i was back just today on this damn usb... well
Rickey it''s not that part that locks, i can't get to run the program until the part you're showing.... the reset locks just in its function call, that is firstly called in the main function:
void Reset_Host(void)
Hwreg(rUSBCTL,bmCHIPRES);  // chip reset This stops the oscillator
Hwreg(rUSBCTL,0x00);       // remove the reset
while(!(Hrreg(rUSBIRQ) & bmOSCOKIRQ)) ;  // hang until the PLL stabilizes

the critical while, then is this:
while(!(Hrreg(rUSBIRQ) & bmOSCOKIRQ)) ;  // hang until the PLL stabilizes

@felis: tnx man, i'll try to issue this command to see if the SPI works, the maxim i have are just fresh, 'coz i got them just two weeks ago.
thanks to all of you for your precious help
Tue May 19 2009, 01:23 pm
Ok Boys..... it is official.... i can't get the SPI working....

this is the source i use:
void  main_func(){



	unsigned char revision;
	char stringy[50];


	uart0Puts("setting full duplex etc etc....\n\r");
	Host_SPI_Write(rPINCTL,(bmFDUPSPI| bmHOST | bmPOSINT   )); // MAX3421E: Full duplex mode, INTLEVEL=0, POSINT=1 for pos edge interrupt pin


    uart0Puts("trying to read revision number:\n\r");

    revision = Host_SPI_Read(rRevision);

	sprintf(stringy,"Revision Number: %x\n\r",revision);

/**** the following function is where it locks..... but now we know that the SPI is not working ****/
    Reset_Host();	// Jan07_2008: Moved Reset_Host after MAX3421 is put in full duplex mode

	Host_SPI_Write(rIOPINS1,0x00);		// seven-segs off
	Host_SPI_Write(rIOPINS2,0x00);		// and Vbus OFF (in case something already plugged in)

	wait_ms(200);  // aspetta = waits


		wait_ms(200); 			// Some devices require this


that was my main function....
and this is what i get on the serial output trying to read the revision number:

init ARM interrupts.....Finita(done)
setting full duplex etc etc....
trying to read revision number:
Revision Number: 0
critical part....(Reset_Host())

and that's all...... now i can't get why the SPI won't work.....

Get Social


Powered by e107 Forum System



Tue May 21 2024, 02:06 am
Sun May 19 2024, 05:39 pm
Sun May 19 2024, 03:06 pm
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