Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Can I use 89c51 gpio pin to receive data from a GPS receiver?

Status
Not open for further replies.

Livingston

Full Member level 2
Joined
Nov 26, 2007
Messages
129
Helped
3
Reputation
6
Reaction score
1
Trophy points
1,298
Location
Chennai-India
Activity points
2,104
Hai buddies,

I was forced to design a circuit using 89c51 microcontroller.

My circuit contains one gps recivier and one rf tranciver,where else rf tranciver need one rx and one tx, and for gps recivier i need atlest one rx from the controller. where else atmel 89c51 controller is having only one uart,

Can i able to use one gpio pin from the controller to recivie the data form gps recivier. ?

Note. Gps recivier has 4800 baurd rate, and rf trancivier has 9600 baurd rate.

How can i configure this please help me.[/b]
 

Re: Regarding : 89c51

I would use the hardware RX / TX for the transceivers and use a software interrupt driven ‘bit bang’ RX for the GPS.
 

Re: Regarding : 89c51

Hi ,

Here is document for how to make software UART
 

8051 Bit Bang serial routines

Adjust for your baud rate. This works good.


Code:
SER_RX	equ	p3.0	;Rx from Host
SER_TX	equ	p3.1	;Tx to Host
;-----------------------------------------------
; The serial baud rate is determined by the processor crystal, and
; this constant which is calculated as: 
;(((crystal/baud)/12) -5) / 2
;(((11059200/9600)/12) -5) / 2
BITTIM	equ	45	;9600 Baud
;adjust for your baud rate here
;-----------------------------------------------
; Receive a character from the PC RXD line and return in A
InChar:
	JB	SER_RX,$	      ;wait for start bit
	MOV	R2,#BITTIM/2	  ;1/2 bit-time
	DJNZ	R2,$			;To sample in middle
	JB	SER_RX,InChar	   ;Insure valid
	MOV	R3,#8		      ;Read 8 bits
InChar1:
	MOV	R2,#BITTIM	   ;full bit-time
	DJNZ	R2,$			;For DATA bit
	MOV	C,SER_RX	    ;Read bit
	RRC	A			  ;Shift it into ACC
	DJNZ	R3,InChar1	    ;read 8 bits
      CLR  	C			  ;
	RET				   ;go home
;-----------------------------------------------
;Transmit character in A via PC TXD line
OutChar:
	CLR	SER_TX		     ;Drop line for start bit
	MOV	R2,#BITTIM        ;full bit-time
	DJNZ	R2,$		       ;For START bit	
	MOV	R3,#8		      ;Send 8 bits
OutChar1:
	RRC	A			;Move next bit into carry
	MOV	SER_TX,C	  ;Write next bit
	MOV	R2,#BITTIM	 ;full bit-time
	DJNZ	R2,$		      ;For DATA bit
	DJNZ	R3,OutChar1	 ;write 8 bits
	SETB	SER_TX		   ;Set line high
	RRC	A		        ;Restore ACC contents
	MOV	R2,#BITTIM	 ;full bit-time
	DJNZ	R2,$		      ;For STOP bit
	RET				 ;
;-----------------------------------------------

Good Luck
 

Re: Regarding : 89c51

Please some body help me for configuring any two gpio(General purpose input output) pin as RX, TX in 89c51 controller. (keil compiler)
 

Re: Regarding : 89c51

Livingston said:
Hai buddies,

I was forced to design a circuit using 89c51 microcontroller.

My circuit contains one gps recivier and one rf tranciver,where else rf tranciver need one rx and one tx, and for gps recivier i need atlest one rx from the controller. where else atmel 89c51 controller is having only one uart,

Can i able to use one gpio pin from the controller to recivie the data form gps recivier. ?

Note. Gps recivier has 4800 baurd rate, and rf trancivier has 9600 baurd rate.

How can i configure this please help me.[/b]

please check if this can help you...

www.freewebs.com/maheshwankhede

Regards,

Simran..
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top