Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: AT91SAM7S256 HID Transfer
PostPosted: Sat May 08, 2010 10:46 am 
Offline

Joined: Sat May 08, 2010 10:25 am
Posts: 3
Hello,

After months read, research, testing... i finally stay without solution.
I need some help about provided sample source (HID-Transfer one), i tryed to make communication between interface (made by olimex SAM7-P256) and an application i making on Delphi7.

i trying to make serial communication using HID protocol, and i have some lost packet on board side, and on application side i cannot control it it, i tryed synchronous and asynchronous mode, and with both result is same.

about board i put report size to 64,128,253 bytes and polling rates at 1ms.

i have some question about some functions from HID tranfer source :

HIDDTransferDriver_Read();
Does this one read really USB port or only check buffer every 1ms ?

HIDDtransfer_DataReceived();
Why this functions exist but never used ?

and main question :
Is it possible to make serial communication trough HID ?

my goal is to have a device with serial communication without Driver, i tested also MSD but looks to be complicate to work with. :s

Regards,


Top
 Profile  
 
 Post subject: Re: AT91SAM7S256 HID Transfer
PostPosted: Sun May 09, 2010 9:58 pm 
Offline

Joined: Thu Feb 04, 2010 3:44 pm
Posts: 9
zergosfr wrote:
Is it possible to make serial communication trough HID ?


You mean something slow like RS232? If that's your final goal you'd better look for some FT232 instead.
If not, I'll try to guess: you have a stream of data and you want to transfer it using USB, specifically using the HID class cause this one is well-supported and fairly easy to use on host-side. If so, I'd say yes, it is possible, but no, it doesn't seem like a good idea, and I'll try to make my point clear to you.
HID doesn't mean it must interface with a human in order to be classified so, but you know, while using such a class of devices you're supposed not to transfer big amounts of data, it uses interrupt transfers, which are not the ideal way to transfer such a load of data (you spoke about MBytes, that's way more than a lot for a report).
Furthermore HID-compliant devices are usually classified so because they fall into something meant in the Hid Usage Tables, this gives the device a fair grade of portability. IMHO transferring serial data trough HID reports is just an exploit that defeats the purpose of the HID class itself.


PS: I can't help with ATMEL's USB stack because I've never used it, but I do have some working HID firmware implemented on my own. It quite sucks and I won't put it into a product that has to get on the marked, but it could be good if you need something to get some inspiration from... lemme know if you need it.


Top
 Profile  
 
 Post subject: Re: AT91SAM7S256 HID Transfer
PostPosted: Sun May 09, 2010 10:17 pm 
Offline

Joined: Sat May 08, 2010 10:25 am
Posts: 3
Hello,

thanks for your post,

So cut some Mbytes to 128bytes packet, and send some thousands report will not be stable ?

idea is to send to device, keep needed amount of bytes in ram and then send when data amount is complete.

until now i used FT232 chipset, but idea is to skip drivers for install device and looks MSD and HID is the key for this.

about HID in my case something is missing but still didnt found what,

can you tell me how can i check final result of sent data (report), here i sent report, but i dont know how to check if is really safe arrived to device,

exaple with writefile i have true result on this function, but looks data are somethimes lost or not handeled.

Regards,


Top
 Profile  
 
 Post subject: Re: AT91SAM7S256 HID Transfer
PostPosted: Mon May 10, 2010 2:06 pm 
Offline

Joined: Thu Feb 04, 2010 3:44 pm
Posts: 9
zergosfr wrote:
So cut some Mbytes to 128bytes packet, and send some thousands report will not be stable ?

Well, I'm not saying it wouldn't be stable, I'm just saying that for such a big load of data you should look for some other ways to transfer rather than using interrupt transfers with the HID class.


zergosfr wrote:
until now i used FT232 chipset, but idea is to skip drivers for install device and looks MSD and HID is the key for this.

MSD sounds just like a good idea. I can't help with this one, but you could look for some good books about it.

zergosfr wrote:
can you tell me how can i check final result of sent data (report), here i sent report, but i dont know how to check if is really safe arrived to device,

I'm not 100% sure of what I'm about to say, these are suppositions based on the tests I've done so far: WriteFile() returns TRUE only if the payload of data you called it for had been successfully sent to the device. This means the device has acknowledged every transaction of that transfer. As long as WriteFile() says TRUE you know that data has been sent. Anyway this doesn't mean the device's firmware acknowledged the data you sent, it may as well got lost, it just means that data has been received by the UDP peripheral of your device. WriteFile() can't know whether that data has been either stored or trashed by your firmware.
If you need something like this you could go ahead implementing your own protocol of communication, something like an IN report which behaves like an acknowledge after the OUT report has completed.


Top
 Profile  
 
 Post subject: Re: AT91SAM7S256 HID Transfer
PostPosted: Mon May 10, 2010 4:49 pm 
Offline

Joined: Sat May 08, 2010 10:25 am
Posts: 3
Hello,

I tryed to use MSD, but i give up, its more complicate than HID.

today i will try something on software side, because looks problem is there, i think i badlly handle data loop.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: chasmopolitan and 2 guests


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 post attachments in this forum

Search for:
Jump to: