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.

Interfacing RS-232 and a PIC

Status
Not open for further replies.

AGUERE

Junior Member level 1
Joined
Jan 17, 2003
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
117
RS 232 and PIC

Hello,I am Programming a pic for the control my antennas, but I have a problem when I want to comunicated with my pc. I am using HSERIN, but I don´t know what I receive a string 6 digit from my computer.Please help me. Thank you very much.

aguere@mail.com
 

RS 232 and PIC

Thank you very much for your help, now I see the files, but I don´t programming in asembler, only in basic, and my question was instruction for Basic. I used pic basic 242, and microcode studio, is very good for me. I made device interesting with this software. In this moment I have a problem between pic and pc. I send from pc data ex. 23456 and only read in my pic the first number, I probe all and I don´t Know what happen. I need for ex. from pc ( az 234, el 45 ) for move my antennas, az=azimut 234º and el=elevation 45º ) Thank you very much

aguere@mail.com
 

what are the arguments of the hserin command you use ?
please give part of the listing of your code if you want some help !
I think you'd better get one char at a time with this command...
 

rs232 and pic

OK, I need have the caracter from pc, I send from pc az 234 and send too el 34 for example. I want in my pic, when read az 234, put the vaiable az in 234, and when read el 34 put the variable in 34 into the pic. For example. The antenna horizontal are in az 100º and send from my pc az 258º, in this moment the pic may move the antenna at az 258º ok. The problem is I don´t know 5 or 6 caracters from pc.
my program part.
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 20h
DEFINE HSER_BAUD 2400
DEFINE HSER_SPBRG 25

DEFINE LOADER_USED 1
DEFINE LCD_DREG PORTC
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTC
DEFINE LCD_RSBIT 4
DEFINE LCD_EREG PORTC
DEFINE LCD_EBIT 5
DEFINE LCD_BITS 4
...
....
MAIN:
LCDOUT $FE,1
LCDOUT I,$85,"TRACKING"
LCDOUT I,LINEA2," AZIMUT ELEVACION"
LCDOUT I,$99,734,I,$A3,734
INICIO:

Hserin 1,INICIO1,[cad] HERE NEED READ 5 OR 6 CARACTERS


INICIO1:
GOSUB LEEANALOGICAS
LCDOUT I,LINEA4,cad," # ",#cad,"Hex ",hex cad

IF cad= 1 THEN GOSUB MENU
IF cad= 2 THEN GOSUB park
IF cad= 3 THEN GOSUB COMUNICACION
.....
-.....
...

tHANK YOU VERY MUCH

aguere@mail.com
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top