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  [ 2 posts ] 
Author Message
 Post subject: TWI using PDC on AT91SAM9G20 - "rotated" read-buffer
PostPosted: Fri Mar 11, 2011 1:48 pm 
Offline

Joined: Mon Feb 21, 2011 5:12 pm
Posts: 2
Hi,
i'm trying to implement TWI using PDC. Therefor I changed the linux i2c-at91 driver.
I got correct bussignals. But the buffer seems to be rotated. Ever the last read byte (n) is on position 0 and the other bytes (0 to n-1) are on position 1 to n.
Another problem is that the last read (Minicom_output with DMA time [ 1.290000]) returns 0x00 instead of 0x11.
I tried to solve the problem by changing the bytes to read and by changing the buffersize.
At least i also tried to use functions virt_to_phys() and virt_to_bus() without any affect.
I'm stumped.
Thanks and sorry for my english


Attachments:
i2c_pdc_at91sam9g20.zip [9.45 KiB]
Downloaded 26 times
Top
 Profile  
 
 Post subject: TWI using PDC on AT91SAM9G20 - "rotated" read-buffer [SOLVED
PostPosted: Wed Mar 16, 2011 8:39 am 
Offline

Joined: Mon Feb 21, 2011 5:12 pm
Posts: 2
Hello,
I solved the problem by by try and error. Now I use a temp buffer (sizeof(userbuffer) + 1) and reading 1 byte more. So the order is correct from pos 1 to n in tempBuf. After reading the bus I copy the tempBuf into the userbuffer. Not fine but it works.
Best regards.


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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: