The Godfather talking
You can run, but you can't hide.
Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 29, 2024, 05:32:55 17:32


Login with username, password and session length


Pages: [1]
Print
Author Topic: cant communicate pc to pic  (Read 3241 times)
0 Members and 1 Guest are viewing this topic.
hsny
Guest
« on: August 11, 2007, 05:33:38 17:33 »

this serin doesnt work.I use max232 and get the characters on hyperterminal but cant on led.
please help.


T2400 con 0
serindata var byte

SerOut PORTB.0 , T2400 , ["1-PORTA.0 Yuksek Yap ",13,10]
SerOut PORTB.0 , T2400 , ["2-PORTA.0 Dusuk Yap",13,10]
SerOut PORTB.0 , T2400 , ["3-Program Sonu",13,10]

loop:
 SerIn PORTB.1 , T2400 , [serindata]
    select case serindata
       case "1"
       high PORTA.0
       case "2"
       low PORTA.0
       case "3"
       serout PORTB.0 , T2400 , ["Program sonlandi.",13,10]
       end
   end select
GoTo loop
Logged
3d_man
Newbie
*
 Muted
Offline Offline

Posts: 16

Thank You
-Given: 22
-Receive: 3


« Reply #1 on: August 16, 2007, 09:56:42 09:56 »

first verify from your hardware connection and correct COM# then write simple code to show hardware good


TRISC = %00000000
serout portc.6 , T2400 , ["HELLO "]

 Wink
Logged
Ikaros
Junior Member
**
Offline Offline

Posts: 83

Thank You
-Given: 422
-Receive: 48


« Reply #2 on: August 31, 2007, 10:27:36 10:27 »

The program just wait one character and then ends. May be is better to make a loop to continually read the Serial Input?

Also are you sure about your hardware connections?
Logged
Ret12_12
Junior Member
**
Offline Offline

Posts: 75

Thank You
-Given: 104
-Receive: 32


« Reply #3 on: August 31, 2007, 07:43:59 19:43 »

If you try case 1 instead of "1" also proton you said  DEC serindata .....

You can have RS232 com. without have the MAX232
SerOut PORTB.0 , 16780 , ["1-PORTA.0 Yuksek Yap ",13,10]  ' transmite to 2400 with a serious res 1k to pin 2 in pc side (9 pin)
Logged
mcr
Junior Member
**
 Muted
Offline Offline

Posts: 90

Thank You
-Given: 217
-Receive: 23


« Reply #4 on: August 31, 2007, 09:34:22 21:34 »

this serin doesnt work.I use max232 and get the characters on hyperterminal but cant on led.
please help.


T2400 con 0
serindata var byte

SerOut PORTB.0 , T2400 , ["1-PORTA.0 Yuksek Yap ",13,10]
SerOut PORTB.0 , T2400 , ["2-PORTA.0 Dusuk Yap",13,10]
SerOut PORTB.0 , T2400 , ["3-Program Sonu",13,10]

loop:
 SerIn PORTB.1 , T2400 , [serindata]
    select case serindata
       case "1"
       high PORTA.0
       case "2"
       low PORTA.0
       case "3"
       serout PORTB.0 , T2400 , ["Program sonlandi.",13,10]
       end
   end select
GoTo loop



Remove the END there, that might help.
Logged
Rahos
Junior Member
**
Offline Offline

Posts: 41

Thank You
-Given: 36
-Receive: 32


« Reply #5 on: September 01, 2007, 05:45:27 05:45 »

Use Serout2/Serin2 and direct connection to pic ( not with MAX232)


« Last Edit: September 01, 2007, 05:47:04 05:47 by Rahos » Logged
mcr
Junior Member
**
 Muted
Offline Offline

Posts: 90

Thank You
-Given: 217
-Receive: 23


« Reply #6 on: September 01, 2007, 05:08:06 17:08 »

Use Serout2/Serin2 and direct connection to pic ( not with MAX232)


Forgot about that  Embarrassed

But still, If you use a MAX232 the information should be displayed, does not matter if it's correct or not.
Logged
Rego
Senior Member
****
Offline Offline

Posts: 498

Thank You
-Given: 0
-Receive: 320


The power is back


« Reply #7 on: September 01, 2007, 05:12:02 17:12 »

yea ,i think the error is from that (end)
Logged

Smiley ....THE POWER IS BACK.... Smiley

....REGO....
hsny
Guest
« Reply #8 on: September 03, 2007, 03:52:14 15:52 »

Thank you for all.
I change
T2400 con 0 with include "modedefs.bas"
serin portb.1,T2400,[serindata] with serin portb.1,T2400,serindata

I use 16f84,max232
pic pin7 - max232 pin 9  -  max232 pin8 -  dbp pin 3
pic pin6 - max232 pin 10 - max232 pin7  - db9 pin 2
pic pin17-led

I coludnt high or low led on hyperterminal.I get characters on pc side however.So I used a program named terminal.
Then its ok.
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC