CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Why USB driver uses 74% of RAM ?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
DiegoGarcia



Joined: 01 Mar 2008
Posts: 48

View user's profile Send private message

Why USB driver uses 74% of RAM ?
PostPosted: Sat Mar 08, 2008 12:29 pm     Reply with quote

Anyone of you guys knows why this usb driver uses all that much of ram ?

I think it is because the interrupt but don't know if I'm sure.

Regards,
Diego Garcia
Ttelmah
Guest







PostPosted: Sat Mar 08, 2008 3:50 pm     Reply with quote

It is a very large and complex driver. There is a lot to USB....
However it'd help massively, if you said 'what chip', using what USB implementation, etc. etc..

Best Wishes
DiegoGarcia



Joined: 01 Mar 2008
Posts: 48

View user's profile Send private message

PostPosted: Sat Mar 08, 2008 8:02 pm     Reply with quote

Oh sorry for that Smile
I'm using PIC18F67J50 and usb_desc_hid ...
using one endpoint with 2 reports one input and one output.

I think that is all ;)

Regards,
Diego Garcia
Ttelmah
Guest







PostPosted: Sun Mar 09, 2008 4:09 am     Reply with quote

OK.
You can't use the 'descriptor', without a lot of other files. In your case, you are presumably using ex_usb_hid.c, or something similar of your own?. This will load the pic18_usb.h file, which provides the actual hardware driver, and configures the _buffering_ needed by USB. Now the default on the 18J chips, for the USB buffer, is to use the available RAM, -0x500. This uses 68% of the available RAM. Add the variables used, and 3/4 of your memory has gone. You can protentially reduce the buffer size, and limit the maximum number of endpoints allowed (the default is for all 16 to be enabled), with careful configuration of the USB device, but a significant 'slice' of this RAM, is _required_ by the USB hardware. This is why the 'available RAM' figure on these chips, has a big warning '*' against it, pointing out that this includes RAM used by the USB hardware...

Best Wshes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group