Re: MX31 GPIO
- From: ChrisQuayle <nospam@xxxxxxxxxxxx>
- Date: Wed, 04 Apr 2007 16:48:34 GMT
Dread_Locks wrote:
Hello,
I'm new to linux and I have MX31ADS board from freescale. I need to
read and write to some GPIO ports and I was wondering how to do it.
I dont even know which pins on the MX31 chip are available to use, how
to set the port direction, or read and write to the ports from a
linux C program.
Does any body know where I can get some information on how to do it?
maybe some sample source code in C would be wonderful.
Thanks
Dread_Locks
If you are to do this right, then you need to become fully familiar with the internal architecture of the beast. You need a copy of the cpu programming manual, which you should have somewhere amongst all the accompanying docs / software. Look up the chapter on ports and find out how to set or clear a bit, then find the main cpu device header file, which defines all the hardware addresses, system registers and various bits symbolically. Find out from the hardware schematic and existing port usage which port pins are available. When you have all this info, you may be ready to write a driver for the port, if one doesn't already exist. The important thing to stress is that it really isn't a 5 minute task. You need to have a full understanding because (for example) device pins are often shared between peripherals and may interact in non obvious ways. In summary, expect to spend a couple of weeks at least getting up to speed.
One of the best ways to become familiar with any new processor is to write a set of drivers / bsp (board support package) for all the major on board peripherals. It can seem like a lot of work, but is a good investment as it only needs to be done once. You then have the knowledge and driver code for every project where you use the cpu...
Chris
--
----------------------
Greenfield Designs Ltd
Electronic and Embedded System Design
Oxford, England
(44) 1865 750 681
.
- References:
- MX31 GPIO
- From: Dread_Locks
- MX31 GPIO
- Prev by Date: Re: How does DO-178 treat OEM modules (with software)?
- Next by Date: Re: How to manipulate a receiving buffer
- Previous by thread: MX31 GPIO
- Next by thread: Re: MX31 GPIO
- Index(es):
Relevant Pages
|