This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

lpc1768 writing time to usb flash memory

hi
i am working with lpc1768 in usb host mode
Initially I was open seven text files by fopen command
Then write a string like "abcdefgh" by the fputs command within seven text files
Before writing command first turn on one led and after seven write comman turn off led
By measuring the time of high and low on led pin I realized that this time is the size of about two seconds.
I want to know is why?
Thanks for your help

Parents
  • i designed home made board with lpc1768 and writing code With the help keil example

    //--------------------------------------------------------------------------
    void UART2_IRQHandler(void)
    {

    uint32_t intsrc, tmp, i;

    uint8_t a;

    /* Determine the interrupt source */

    intsrc = UART_GetIntId(LPC_UART2);

    tmp = intsrc & UART_IIR_INTID_MASK;

    // Receive Data Available or Character time-out

    if (tmp == UART_IIR_INTID_RDA)

    {

    a = UART_ReceiveByte(LPC_UART2);

    if(a == 0)

    {

    f = fopen ("f.txt", "a");

    f1 = fopen ("f1.txt", "a");

    f2 = fopen ("f2.txt", "a");

    f3 = fopen ("f3.txt", "a");

    f4 = fopen ("f4.txt", "a");

    f5 = fopen ("f5.txt", "a");

    f6 = fopen ("f6.txt", "a");

    }

    else if(a == 255)

    {

    fclose (f);

    fclose (f1);

    fclose (f2);

    fclose (f3);

    fclose (f4);

    fclose (f5);

    fclose (f6);

    }

    else

    {

    strcpy (&in_line[0], "abcdefghijklmnopqrstuvwxyz\r\n");

    fputs (in_line, f);

    fputs (in_line, f1);

    fputs (in_line, f2);

    fputs (in_line, f3);

    fputs (in_line, f4);

    fputs (in_line, f5);

    fputs (in_line, f6);

    i = GPIO_ReadValue(1)&0x01000000;

    if(i == 0)

    {

    GPIO_SetValue(1, 0x01000000);//led on

    }

    else

    {

    GPIO_ClearValue(1, 0x01000000);//led pff

    }

    }

    }

    }

Reply
  • i designed home made board with lpc1768 and writing code With the help keil example

    //--------------------------------------------------------------------------
    void UART2_IRQHandler(void)
    {

    uint32_t intsrc, tmp, i;

    uint8_t a;

    /* Determine the interrupt source */

    intsrc = UART_GetIntId(LPC_UART2);

    tmp = intsrc & UART_IIR_INTID_MASK;

    // Receive Data Available or Character time-out

    if (tmp == UART_IIR_INTID_RDA)

    {

    a = UART_ReceiveByte(LPC_UART2);

    if(a == 0)

    {

    f = fopen ("f.txt", "a");

    f1 = fopen ("f1.txt", "a");

    f2 = fopen ("f2.txt", "a");

    f3 = fopen ("f3.txt", "a");

    f4 = fopen ("f4.txt", "a");

    f5 = fopen ("f5.txt", "a");

    f6 = fopen ("f6.txt", "a");

    }

    else if(a == 255)

    {

    fclose (f);

    fclose (f1);

    fclose (f2);

    fclose (f3);

    fclose (f4);

    fclose (f5);

    fclose (f6);

    }

    else

    {

    strcpy (&in_line[0], "abcdefghijklmnopqrstuvwxyz\r\n");

    fputs (in_line, f);

    fputs (in_line, f1);

    fputs (in_line, f2);

    fputs (in_line, f3);

    fputs (in_line, f4);

    fputs (in_line, f5);

    fputs (in_line, f6);

    i = GPIO_ReadValue(1)&0x01000000;

    if(i == 0)

    {

    GPIO_SetValue(1, 0x01000000);//led on

    }

    else

    {

    GPIO_ClearValue(1, 0x01000000);//led pff

    }

    }

    }

    }

Children
No data