free 8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
Forums

Rickey's World :: Discussion Forums :: Discuss and Learn :: 8051 Discussion Forum
 
<< Previous thread | Next thread >>
AT89C5131 project = How to change LENGTH OF REPORT Value (greater than 32 bytes)
Moderators: Ajay Bhargav, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph, ExperimenterUK, DavesGarage
Author Post
Aniolek
Thu Jul 02 2009, 10:00AM
 User Offline
Registered Member #19894
Joined: Thu Jul 02 2009, 09:46AM

Posts: 2
Thanked 0 times in 0 posts
Hello,

I'm working on the c5131_usb_generic file. I'm sending datas from my USB device to my PC.
The LENGHT OF REPORT is define as 0x20, I'd like to send 128 bytes, but when I change the value of the LENGHT OF REPORT to 0x80, the device isn't recognised by the PC! I can change the value only if it is lower than 0x20.
Does someone has managed to make a change of the LENGHT OF REPORT value to send mores than 32 bytes?
Maybe it's impossible to do this with this microcontroller.

Thanks :bye
Isabel



[ Edited Fri Jul 03 2009, 04:34AM ]
Back to top

Ajay Bhargav
Fri Jul 03 2009, 08:30AM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 06:56AM

Posts: 8991
Thanked 1578 times in 1487 posts
can you post the link to file or code?


www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top

Aniolek
Mon Jul 06 2009, 04:50AM
 User Offline
Registered Member #19894
Joined: Thu Jul 02 2009, 09:46AM

Posts: 2
Thanked 0 times in 0 posts
Of course, I've taken the code on atmel website :
http://www.atmel.com/dyn/resources/prod_documents/c5131-usb-generic-1_2_0.zip

I've modified the file user_application.c like this, more accurately:



CODE:
void user_application_task (void)
{
  int var = 0;
  int i,j=0;
  unsigned char* chaine;

  chaine = (char*) calloc (256,sizeof(unsigned char));
  chaine = "000110101101010010101010101011001101010101010101010
101010100101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101
010101010101101010010101011001010101100101101010101010100101
010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101
011010010110101010010101011001101001011010101010101010101010
101010010101100101100101101001101010010110101010010101010101
010101010110011001100101100110011001011000110101101010010101
010101011001101010101010101010101010100101010101010101010101
010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101010101010101101010010101011001
010101100101101010101010100101010101010101010101010101010101
010101010101010101010101010101010101010101010101010101010101
010101010101010101010101010101011010010110101010010101011001
101001011010101010101010101010101010010101100101100101101001
101010010110101010010101010101010101010110011001100101100110
0110010110111"
;


  if(Is_new_data_read())
    {
       usb_read_continuous(data_received);
           
   
           if((data_received[0]=='1')&&(data_received[1]=='1'))
           {
           j=0;  
                                                 for(i=0;i<29;i++)
                                {        
                                  data_to_send[i] = chaine[j];
                                  j++;
                                }
                                data_to_send[i] = '\0';
                                usb_write_continuous(data_to_send,30);
                }

           if((data_received[0]=='1')&&(data_received[1]=='2'))
           {
           j=29;  
                                                 for(i=0;i<29;i++)
                                {        
                                  data_to_send[i] = chaine[j];
                                  j++;
                                }
                                data_to_send[i] = '\0';
                                usb_write_continuous(data_to_send,30);
                }
       

     
    }


    if (INT0_button != last_INT0_button_state)   // INT0 button pressed
    {
       if (Is_write_data_ready())
       {
          data_to_send[0] = !INT0_button;
          last_INT0_button_state = INT0_button;
       }
    }


    if (reset_to_bootloader == TRUE)
    {
       Usb_detach();
       Led_all_off();
       Enable_ale();
       Configure_led(0,STANDARD_PORT);
       Configure_led(1,STANDARD_PORT);
       Configure_led(2,STANDARD_PORT);
       Configure_led(3,STANDARD_PORT);

       for (data_received[0]=0; data_received[0]<250; data_received[0]++);
       Usb_disable();
       Pll_stop();
       EA = 0;
       MAP_BOOT;
       __API_JMP_BOOTLOADER();
    }
}
 


[ Edited Mon Jul 06 2009, 04:57AM ]
Back to top

 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

© 2010 Rickey's World

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems