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.

PIC18F4520 Serial communication

Status
Not open for further replies.

suwaii

Member level 4
Joined
Jan 21, 2006
Messages
68
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,830
pic18f452 serial

i try to send letters from pic18f452 to PC serial port
and i use IC-prog but i get error message "verified at adress.."
and this is the code....can any one tell me what is the
problem in this code:


list P=PIC18F452, F=INHX32, C=160, N=0, ST=OFF, MM=OFF, R=DEC, X=ON
#include "P18F452.inc"
__CONFIG _CONFIG1H, _HS_OSC_1H ;HS oscillator


org 0x00


movlw 0x00
movwf TRISC


movlw 0x19
movwf SPBRG

movlw b'00100100' ;
movwf TXSTA ;


movlw 'F'
movwf TXREG ;
WtHere1 btfss PIR1,TXIF ;
goto WtHere1


movlw 'G'
movwf TXREG ;
WtHere2 btfss PIR1,TXIF ;
goto WtHere2

movlw 'A'
movwf TXREG ;
WtHere3 btfss PIR1,TXIF ; goto WtHere3

END
 

pic18f serial

OK.....CAN ANY ONE TELL ME IS THIS CODE WILL MAKE PIC18F452 TO SEND "F"
TO PC SERIAL PORT THOUGH PIN#25(RC6/TX) :

movlw 'F'
movwf TXREG

AND DO WE NEED TO CONECT MAX232 BETWEEN PIC18F452 AND PC SERIAL PORT TO MAKE PC SERIAL PORT READ "F"....PLEASE HELP ME
 

exemplo serial pic18f452

You code should work provided you have enabled the TX peripheral. Also you should be checking the TXSTAT to make sure the TX buffer is empty before sending the character.

Re: MAX232 you do need a level converter to reliably recieve data on the PC, but you can do this without a MAX232, look at

**broken link removed**

it shows a transistor based level converter
 

Re: pic18f452 serial

the code is good , but:
tx btfss TXSTA, TMRT
goto tx
and you have need to conect Max 232 between Pic... and PC
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top