MCU User Forum
  USB-MSD-firmware interfacing

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   USB-MSD-firmware interfacing
Shyam
New Member
posted July 31, 2010 02:15 AM     Click Here to See the Profile for Shyam   Click Here to Email Shyam     Edit/Delete Message
Hi,
I am developing a C8051f340 based system which will act as a data logger in normal working mode and when connected with the PC via USB, it will act as a USB-MSD device.

I have used the code given in USB-MSD-reference design, in my code. The system works well. In working mode it stores some sensor data in a notepad file in a SD card, when connecting with the PC via USB cable we can get the notepad file to the PC.

Now I have to integrate a RF unit with the system. The code I developed for the RF section works well seperately. But when I integrate all the codes, I found the RF section does not wrok. Then later I found that one of the 'USB_MSD_SD card' initialising function 'Sect_Init()' causes the problem. If I comment this function call the RF section works. But USB-MSD function will not work obviously.
(The 'Sect_init()' will intrun calls the function 'MMC_FLASH_Init()').


I am using PORT2 and Port3.3 for RF section interfacing. I can't figure out any relation this two section ( RF & USB-SD card) of the code. Can anyone tell me what could be the problem?

thanks
Shyam

[This message has been edited by Shyam (edited July 31, 2010).]

[This message has been edited by Shyam (edited July 31, 2010).]

IP: Logged

Shyam
New Member
posted July 31, 2010 05:16 AM     Click Here to See the Profile for Shyam   Click Here to Email Shyam     Edit/Delete Message
Hi all,
I desperately need some suggestion for my above said problem. If anyone of need any clarifications to understand my problem please let me know.

If anyone of you give me a small clue it will be very helpful.

thanks
Shyam.

IP: Logged

Tsuneo
Member
posted July 31, 2010 09:18 PM     Click Here to See the Profile for Tsuneo   Click Here to Email Tsuneo     Edit/Delete Message
> I found that one of the 'USB_MSD_SD card' initialising function 'Sect_Init()' causes the problem...(The 'Sect_init()' will intrun calls the function 'MMC_FLASH_Init()').
> I am using PORT2 and Port3.3 for RF section interfacing.

F34x_MSD_MMC.c (in AN282SW.zip) touches to Port2 everywhere. MMC_FLASH_Init(), too.
It flashes LEDs on Port2 to show activity. If you would delete the LED code, there is no problem for MMC function.


sbit Led1 = P2^2;
sbit Led2 = P2^3;

#define MMC_Show_Activity() { if(Led1) { Led1=0;Led2=1;} else { Led1=1;Led2=0; } }

void MMC_FLASH_Init(void)
{
...
...
Led1=0;Led2=0;
}

unsigned int MMC_FLASH_Block_Read(unsigned long address, unsigned char *pchar)
{
...
Led1=1;
...
...
Led1=0;
return card_status;
}

unsigned char MMC_FLASH_Block_Write(unsigned long address,unsigned char *wdata)
{
...
Led2=1;
...
...
Led2=0;
return card_status;
}

Tsuneo

[This message has been edited by Tsuneo (edited July 31, 2010).]

IP: Logged

Shyam
New Member
posted August 10, 2010 12:51 AM     Click Here to See the Profile for Shyam   Click Here to Email Shyam     Edit/Delete Message
Hi Tsuneo,
I noticed your reply lately. Thank you.

Shyam.

IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | MCU User Forum

Have you seen our MCU Knowledge Base?


Ultimate Bulletin Board 5.47b