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  [ 1 post ] 
Author Message
 Post subject: Strategy for GPIO and peripheral multiplexing
PostPosted: Wed Feb 08, 2012 7:22 pm 
Offline
User avatar

Joined: Mon Jul 19, 2010 8:47 pm
Posts: 59
Hi all,

I'm working on a board that uses Python as its primary programming language. I have a GPIO working through sysfs under Linux, and I can also access all the hardware peripherals that I want (serial, A/D, SPI, and I2C).

I'm trying to figure out a reasonable strategy for switching between peripherals and GPIO during operation (not at boot time).

I think the right approach is to initialize all the pins as GPIO inputs. When any peripheral is needed, the Python code turns on the peripheral (perhaps by calling a C function that modifies hardware registers), does whatever it needs to do, and then makes it an input again. I'm not sure how this would work for reading data, e.g. bytes from a serial port. (Will a serial port receive bytes while the pins are GPIO inputs?)

Does this seem like a good approach? Have you seen it handled differently? Better?

Thanks,
Brandon

_________________
Brandon Stafford
Rascal Micro


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

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: