Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
abcminiuser
PostPosted: Apr 18, 2012 - 08:33 PM
Moderator


Joined: Jan 23, 2004
Posts: 9832
Location: Trondheim, Norway

Wowza, I have a dedicated mailing list for LUFA if you have lots of questions to ask:

www.lufa-lib.org/support


In any case, your questions:

Quote:

but , the rate of transmit data in above routin is very bad! for example , i must wait to eof check always so when i don't enter a character the routin don't implement so pc lose my charcter !

can tell me a metode to solve this problem?


It's better to try to read a character and then process it if one was received, without blocking. Sending data should be buffered and you should send it in chunks to make sure as many bytes as possible are packed into each USB packet, otherwise the throughput will be very poor.

Quote:

i don't understand that what is notification endpoint!?


That's part of the CDC (Virtual Serial) USB class - it is used by the class driver to give notifications to the host about changes to the virtual serial port control lines, such as CTS and DCD. You don't interact with the notification endpoint in your code directly, it is used in the CDC driver when you call the various API functions.

Quote:

in this part of you'r web tutorial saied, the USB_Init function have two input as blow:
Code:


void USB_Init (const uint8_t Mode, const uint8_t Options)



but, in VirtualSerial demo ,used this function without any input,as this blow routin :


As the documentation says, you can use various compile time tokens in your makefile or LUFAConfig.h header to reduce the size of the compiled LUFA code, by removing unused portions of the stack and/or fixing certain options as constants at compile time. See this page of the documentation:

http://fourwalledcubicle.com/files/LUFA ... mmary.html

In this case, USB_DEVICE_ONLY and USE_STATIC_OPTIONS are used in the project makefile to set the USB driver mode and options statically.

Quote:

do we have to use this function in main routin or when we want send or recive data Through usb, for corecte opration ?


You will need to drain received bytes at some point if the host is trying to send your application data (or the host will become locked up if it has blocking waits for send completion) but you don't need to do it all the time.

- Dean Twisted Evil

_________________
Atmel Studio 6.1 is now released, grab it here.
Report AS6/ASF bugs here.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
mojtaba_led
PostPosted: Apr 19, 2012 - 10:41 AM
Wannabe


Joined: Jun 25, 2011
Posts: 55
Location: IRAN

hi dean
thank you very much for answers.

now,i want to use external 3.3v configuration , i know form data sheet that Set REGDIS bit in REGCR register but how to do this act in lufa ?

thanks.
 
 View user's profile Send private message  
Reply with quote Back to top
abcminiuser
PostPosted: Apr 19, 2012 - 11:20 AM
Moderator


Joined: Jan 23, 2004
Posts: 9832
Location: Trondheim, Norway

Use USB_OPT_REG_DISABLED:

http://www.fourwalledcubicle.com/files/ ... 25a661336c

- Dean Twisted Evil

_________________
Atmel Studio 6.1 is now released, grab it here.
Report AS6/ASF bugs here.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
clawson
PostPosted: Apr 19, 2012 - 11:32 AM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62371
Location: (using avr-gcc in) Finchingfield, Essex, England

Quote:

Wowza, I have a dedicated mailing list for LUFA if you have lots of questions to ask:

I know it'll be convenient for you but this is a shame as I learnt pretty much all I know about LUFA by reading your replies to LUFA questions here on Freaks. I'm not sure I'll be stopping by to read another forum though Sad

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
mojtaba_led
PostPosted: Apr 19, 2012 - 11:56 AM
Wannabe


Joined: Jun 25, 2011
Posts: 55
Location: IRAN

Quote:

Use USB_OPT_REG_DISABLED:


i write this code:
Code:

USB_Init(USB_CurrentMode,USB_OPT_REG_DISABLED);


but compiler give this error :
Code:

VirtualSerial.c:186: error: too many arguments to function 'USB_Init'
 
 View user's profile Send private message  
Reply with quote Back to top
mojtaba_led
PostPosted: Apr 19, 2012 - 12:24 PM
Wannabe


Joined: Jun 25, 2011
Posts: 55
Location: IRAN

oh, excuse me .

i understand you'r intent,now!

is it correct in make file for my request:
Code:

 LUFA library compile-time options and predefined tokens
LUFA_OPTS  = -D USB_DEVICE_ONLY
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_DISABLED | USB_OPT_AUTO_PLL)"
 
 View user's profile Send private message  
Reply with quote Back to top
abcminiuser
PostPosted: Apr 19, 2012 - 04:08 PM
Moderator


Joined: Jan 23, 2004
Posts: 9832
Location: Trondheim, Norway

Yes, that's correct. If you remove the USE_STATIC_OPTIONS=... line in your makefile you can pass those options to the USB_Init() function directly, but the resulting compiled library size will be bigger.

Quote:

I know it'll be convenient for you but this is a shame as I learnt pretty much all I know about LUFA by reading your replies to LUFA questions here on Freaks. I'm not sure I'll be stopping by to read another forum though


It's a matter of keeping a dedicated, focused, searchable resource center for all things LUFA, and to keep the noise off here (or everyone else will get grumpy). It's both a mailing list and an online forum (you can choose either format, same content) so you can get updates emailed to you if you don't want to read over the web version.

- Dean Twisted Evil

_________________
Atmel Studio 6.1 is now released, grab it here.
Report AS6/ASF bugs here.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits