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
koljafile
PostPosted: May 24, 2012 - 11:25 AM
Newbie


Joined: May 18, 2012
Posts: 2


At first I would like to thank you all, especially Dean, for the nice
work and I hope that you guys can help me with my problem. I am using
a atxmega128a3u on a costum board for my actual project and I use the
virtual com port functionality of the LUFA lib. Therefore, I
downloaded the VirtualSerialX demo and the current version of the
library. So far, I got the demo running and the board is recognized by
my windows 7 os. After creating my own board files, I was able to send
data to the PC and display it in a terminal program. But the problem
now is to receive data. I tried to just echo the received bytes but it
didn“t work.

Main loop:
Code:

receivedBytes =
CDC_Device_BytesReceived(&VirtualSerial_CDC_Interface);

if (receivedBytes)
{
    CDC_Device_SendByte(&VirtualSerial_CDC_Interface,
CDC_Device_ReceiveByte(&VirtualSerial_CDC_Inteface));

}

CDC_Device_USBTask(&VirtualSerial_CDC_Interface);
USB_USBTask();


The VirtualSerialX demo was used and I made only the changes above. It
seems that receivedBytes stays always 0. Hopefully you can help me.

Thanks and best regards,
Kolja.
 
 View user's profile Send private message  
Reply with quote Back to top
koljafile
PostPosted: May 25, 2012 - 04:31 PM
Newbie


Joined: May 18, 2012
Posts: 2


I know what you mean Graham. But I need only the very "simple"
application of a virtual com port and actually I got it to work now
with the following code:
Code:

Endpoint_SelectEndpoint(VirtualSerial_CDC_Interface.Config.DataOUTEndpoint.Address);

f(Endpoint_IsOUTReceived())
{
while(Endpoint_IsReadWriteAllowed())
{
   if (!(RingBuffer_IsFull(&USB_Buffer)))
   {
        endP_read = Endpoint_Read_8();
        RingBuffer_Insert(&USB_Buffer, endP_read);
   }
}

Endpoint_ClearOUT();

fprintf(&USBSerialStream,"endP_read \percent x \r\n", endP_read);

}

}

CDC_Device_USBTask(&VirtualSerial_CDC_Interface);
USB_USBTask();

I used the RingBuffer_t structure to store the incoming data and so
far it works fine. But now I encountered another problem. I have to
use also some SPI interfaces and the internal ADC for my project and
therefore I would like to use Atmels framework within AVRStudio 5.1.
So now I am trying to combine the LUFA with the ASF within a project.

Do you have some suggestions how to do that? Should I try it without
the makefile otherwise I would have to specify all the c-files and
include paths?
 
 View user's profile Send private message  
Reply with quote Back to top
abcminiuser
PostPosted: May 25, 2012 - 10:28 PM
Moderator


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

For those wondering about the "Graham" reference:

https://groups.google.com/d/msg/lufa-su ... z7GFvjQtgJ

- 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
abcminiuser
PostPosted: May 26, 2012 - 05:36 PM
Moderator


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

This issue has been fixed in this commit:

https://github.com/abcminiuser/lufa-lib ... 266409d847

As mentioned on the LUFA mailing list.

- 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