HSERIN advice


Closed Thread
Results 1 to 11 of 11

Thread: HSERIN advice

Hybrid View

  1. #1
    Join Date
    Feb 2005
    Location
    GREECE
    Posts
    120

    Default HSERIN advice

    Hello boys&girls,

    I am using a PIC16F627 with external XT 4Mhz,ST232.My communication to my PC is already working.
    I want to send from the hyperterminal 8 ASCII characters DOT1,DOT2...DOT8 using HSERIN.How can I do that?
    After that the characters will be sent using I2C protocol.

    I just want to know the way I will input the ASCII characters with HSERIN.

    I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE1, DIGIT0BOTHPLANESADDRESS, ["DOT1"]

    I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE1, DIGIT1BOTHPLANESADDRESS, ["DOT2"]

    I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE1, DIGIT2BOTHPLANESADDRESS, ["DOT3"]

    I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE1, DIGIT3BOTHPLANESADDRESS, ["DOT4"]


    I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE2, DIGIT0BOTHPLANESADDRESS, ["DOT5"]

    I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE2, DIGIT1BOTHPLANESADDRESS, ["DOT6"]

    I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE2, DIGIT2BOTHPLANESADDRESS, ["DOT7"]

    I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE2, DIGIT3BOTHPLANESADDRESS, ["DOT8"]

  2. #2
    Join Date
    Feb 2005
    Location
    GREECE
    Posts
    120


    Did you find this post helpful? Yes | No

    Default

    THAT IS MY CODE IHAVE ALREADY WRITTEN BUT IT IS NOT WORKING PROPERTLY.
    ANY IDEA?


    Main:
    SerData = 0
    HSERIN [SerData]
    IF SerData <> 0 THEN
    hserout ["You typed:", SerData,10,13]
    ELSE
    Goto Main
    ENDIF
    PAUSE 1000
    Goto OUT

    Pause 1000


    OUT:
    I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE1, DIGIT0BOTHPLANESADDRESS, ["SerData[1]"]

    I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE1, DIGIT1BOTHPLANESADDRESS, ["SerData[2]"]

    I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE1, DIGIT2BOTHPLANESADDRESS, ["SerData[3]"]

    I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE1, DIGIT3BOTHPLANESADDRESS, ["SerData[4]"]

  3. #3
    Join Date
    Feb 2005
    Location
    GREECE
    Posts
    120


    Did you find this post helpful? Yes | No

    Default

    That is a part of my program.Where is the wrong?The only thing I can see in hyperterminal is nikos.I can not put the 8 ASCII CHARACTERS.Hyperterminal does not allow me!!!
    Any idea?

    INCLUDE "MODEDEFS.BAS"

    DEFINE OSC 4

    DEFINE HSER_RCSTA 90h
    DEFINE HSER_TXSTA 24h
    DEFINE HSER_BAUD 9600
    DEFINE HSER_CLROERR 1

    CMCON = 7

    ..................
    SerData VAR BYTE [8]

    Hserout [10,13,"nikos",10,13]
    Pause 5000

    Main:
    HSerin 5000,Main,[ STR SerData\8]
    PAUSE 500
    HSEROUT ["You typed:", STR SerData\8,13,10]
    PAUSE 500
    Goto OUT

    OUT:
    I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE1, DIGIT0BOTHPLANESADDRESS, ["SerData[1]"]

    I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE1, DIGIT1BOTHPLANESADDRESS, ["SerData[2]"]

    I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE1, DIGIT2BOTHPLANESADDRESS, ["SerData[3]"]

    I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE1, DIGIT3BOTHPLANESADDRESS, ["SerData[4]"]


    I2CWRITE SDA0, SCL0, DISPLAYCONTROLBYTE2, DIGIT0BOTHPLANESADDRESS, ["SerData[5]"]

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Hyperterminal is the best piece of ^^%#^ that i've never ever work with. Did you try with another program like MicroCodeStudio , RealTerm or else???

    Also, don't forget that once you type something... your program will go to LaLaLand since you didn't tell to return to [main]. But probably it's an copy paste error too.

    Can you also remove the PAUSE 5000 at the begining???
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Feb 2005
    Location
    GREECE
    Posts
    120


    Did you find this post helpful? Yes | No

    Post

    I would like to say the truth,I am working with Tera Term pro,which has no problem.
    My program looks good or not?

    Please advice.

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    i tried by removing all the delay... no problems here. just smething must be 13,10 intead of 10,13
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. timeout of Hserin, goto, gosub or both?
    By flipper_md in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 28th October 2009, 18:43
  2. TMR0 interrupt and HSERIN
    By boban in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd September 2008, 11:48
  3. 16F877a Interupt driven Hserin
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 3rd November 2006, 00:38
  4. Hserin not working...
    By robert0 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 22nd August 2005, 12:25
  5. Hserin
    By egberttheone in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 27th November 2004, 15:42

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts