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: driver operation
PostPosted: Mon Feb 22, 2010 11:01 pm 
Offline

Joined: Tue Jan 26, 2010 2:50 pm
Posts: 6
Hi Guys,
I have an AT91SAM9260 with linux on board and have found a PWM driver to implement. I have 3 files...
makefile
pwm.c
pwm.h

Firstly are there enough files?

Secondly could someone point out how to implement these files? Do i need to put the driver into another kernel build?

Hope someone can help

Tom


Top
 Profile  
 
 Post subject: Re: driver operation
PostPosted: Thu Feb 25, 2010 5:24 am 
Offline

Joined: Thu Apr 19, 2007 10:15 pm
Posts: 204
Location: USA
Hi there

"Implement" usually means design and/or write code. If you found some source code then you're just going to (cross) compile someone else's code.

Do you have a development system to perform cross compiles?

Do you have a cross compiler?

Regards


Top
 Profile  
 
 Post subject: Re: driver operation
PostPosted: Thu Feb 25, 2010 1:15 pm 
Offline

Joined: Tue Jan 26, 2010 2:50 pm
Posts: 6
blue_z wrote:
Hi there

"Implement" usually means design and/or write code. If you found some source code then you're just going to (cross) compile someone else's code.

Do you have a development system to perform cross compiles?

Do you have a cross compiler?

Regards


Hi, thanks for your reply. Implement was probably the wrong word to use. The files I have are source code I found and I have now cross compiled just the main c file and it works! not sure why the other files are needed though?

However my query now is that this code doesn't seem to be a driver, it just maps adc registers into userspace and so not knowing much about linux makes me unsure whether this will "hold up" the processor and not allow me to perform other tasks?

Ideally my finished system will receive info over a comms link, interpret this data as well info from an adc and then use this info to control a constantly changing PWM signal. Do you think this could be done in userspace or would I need to write drivers?


Top
 Profile  
 
 Post subject: Re: driver operation
PostPosted: Thu Feb 25, 2010 11:38 pm 
Offline

Joined: Thu Apr 19, 2007 10:15 pm
Posts: 204
Location: USA
Hi there

From that to-do list, you are going to have to design and write some code.

> Do you think this could be done in userspace or would I need to write drivers?

You really don't have a either/or choice. The correct answer is that you need to do both. Some functionality properly belongs in a kernel device drive, and other functionality should be done in an application program in userspace. There may be some weird implementations out there that (functionally) overload drivers, and have non-standard interaction between drivers. And there are systems that expose I/O ports to userspace. But the traditional (and secure) design is to perform I/O in the secure kernel mode and process the data in usermode.

One design issue you need to address is how fast does this system have to respond to changing inputs? Does the output have to respond in "realtime" (<100 microseconds), or will a "near-realtime" (10s of miliseconds) response be sufficient?

Regards


Top
 Profile  
 
 Post subject: Re: driver operation
PostPosted: Mon Mar 08, 2010 8:26 pm 
Offline

Joined: Tue Jan 26, 2010 2:50 pm
Posts: 6
hi, apologies for the late response. The system will need to operate in microsecond periods, but typically 1000 so 1 or 2 ms is ok, but 10s of milliseconds is too slow.


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: Google [Bot] and 3 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: