Page 1 of 1

How to read data fron GPIO pins

Posted: Wed Sep 08, 2010 3:11 am
by Mr. A
hiiiiiiiiiiii...

I am trying to get data from GPS on GPIO pins of AT91SAM7S256.But,i am facing problem in writing the code for read the GPIO data.
pl guide me to write the code to read data and then save it to buffer for further programming.

Re: How to read data fron GPIO pins

Posted: Wed Sep 08, 2010 11:04 pm
by stevech
GPS receivers often use UART serial with NMEA.
GPIO bits would be used for what sort of GPS receiver? A few have I2C or SPI rather than UART.

Re: How to read data fron GPIO pins

Posted: Thu Sep 09, 2010 1:40 am
by tecoist
For what it's worth, the part you mention is actually an ARM microcontroller, not an AVR part.

You don't mention which GPS module you're using, but most of them emit serial data. I'd suggest using one of the two USARTs on the AT91SAM7S256; the Atmel manual is available on line here. The part also supports TWI and SPI if your GPS speaks those rather than asynchronous serial.

Re: How to read data fron GPIO pins

Posted: Thu Sep 09, 2010 3:37 am
by Mr. A
Can i use GPIO pins as RX & TX of USART???????
If yes,then tell me that how can i read save the data of GPIO pins in a buffer?????????

Re: How to read data fron GPIO pins

Posted: Thu Sep 09, 2010 8:15 pm
by stevech
Mr. A wrote:Can i use GPIO pins as RX & TX of USART???????
If yes,then tell me that how can i read save the data of GPIO pins in a buffer?????????
No, you would use one of the built-in UARTs of the microprocessor, and config. that to the relevant pins of the chip/module. If you have no spare UART to use, you could try to do a software UART but that gets quite complex in terms of interrupts, etc.