View previous topic :: View next topic |
Author |
Message |
achzoll
Joined: 18 Jun 2006 Posts: 1
|
Posted: Wed Jun 21, 2006 8:32 pm Post subject: serial <-> PC |
|
|
hallo zusammen
bin neu und denke darüber wurde schon geschrieben, aber ich brauche eine verbindung zum PC. mit print sende ich einen string aber mit input bleibt der mc stehen daher habe ich inkey benutz aber damit kann ich nur ein byte empfangen. ich würde gerne RI abfragen ob eine neue nachricht angekommen ist und dann diese lesen.
danke im vorraus
my problem is the serial port to the pc. i send a string with print but with input stand the mc. with inkey i can get one string but i want to get about RI the informatio for a new string from pc and then i want to read this string.
thanks for help
Achim |
|
Back to top |
|
|
Vilko
Joined: 25 May 2004 Posts: 190 Location: Ljubljana, Slovenia
|
Posted: Tue Sep 19, 2006 9:09 am Post subject: I use Serial Interrupt |
|
|
I use serial interrupt routine to accept info from Serial.
The serial interrupt routine gets control for each byte if info and puts into RAM, it might detect Newline charater and set a bit, when transmition is over, main program tests the bit and if set evaluate received information.
I am not very good at bascom, it might be a competent bascom statement to do the work instead. |
|
Back to top |
|
|
Funci
Joined: 03 Aug 2005 Posts: 58 Location: CRO
|
Posted: Tue Sep 19, 2006 4:35 pm Post subject: |
|
|
Hi achzoll,
I am thinking that you don't have problems, because commands that you were used working just like you said.
So, if you want to use Inkey statement you must write routine that will wait for strings that are comming and analyse them. |
|
Back to top |
|
|
Vilko
Joined: 25 May 2004 Posts: 190 Location: Ljubljana, Slovenia
|
Posted: Tue Sep 19, 2006 4:54 pm Post subject: bascom help says |
|
|
Bascom help says about Inkey:
Quote: | Action
Returns the ASCII value of the first character in the serial input buffer.
Syntax
var = INKEY()
var = INKEY(#channel)
Remarks
Var Byte, Integer, Word, Long or String variable.
Channel The channel number of device
If there is no character waiting, a zero will be returned. |
So, it says about character, not string. You must intercept each byte of a string separately.
(I my be wrong.) |
|
Back to top |
|
|
|