Hersin quick question


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    Join Date
    May 2012
    Location
    Merseyside, UK
    Posts
    237


    Did you find this post helpful? Yes | No

    Default Re: Hersin quick question

    Well

    Out of desperation.... Swapped to using Serin as opposed to Hserin.

    All is working as I thought... So pins are right and drivers etc etc

    Can only be Config ...(I Think)

    But what and where ?

    Andy

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,653


    Did you find this post helpful? Yes | No

    Default Re: Hersin quick question

    its not in the code you have posted
    this code as suggested by henrik works as expected

    Code:
    #CONFIG
      __config   _HS_OSC & _WDT_ON & _PWRTE_OFF & _MCLRE_ON & _BODEN_ON & _LVP_OFF & DATA_CP_OFF & _CP_OFF
    #ENDCONFIG
    
    
    DEFINE OSC 8
    DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
    DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0
    DEFINE HSER_SPBRG 12  ' 9600 Baud @ 8MHz, 0.16%
    DEFINE HSER_CLROERR 1 ' Clear overflow automatically
    TRISB=%11111111 'Make RB0 input
    char var byte
    
    CMCON=7
    
    
    Main:
      HSERIN 5000, Timeout, [char]
      IF (char="A") THEN
        GOSUB somewhere
      ENDIF
    Goto Main
    
    Somewhere:
       HSEROUT["I got an A", 13]
    RETURN
    
    Timeout:
       HSEROUT["Nothing for the last 5 seconds, I'll just restart and wait 5 more....",13]
    Goto Main
    Warning I'm not a teacher

  3. #3
    Join Date
    May 2012
    Location
    Merseyside, UK
    Posts
    237


    Did you find this post helpful? Yes | No

    Default Re: Hersin quick question

    Hi all

    Have opted for easy way out

    Using Serin no problems ....I still don't know what I was getting wrong

    Thank you for all the help

    Andy

Similar Threads

  1. quick question
    By peterdeco1 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 13th November 2016, 19:02
  2. A quick question.....
    By Megahertz in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th December 2010, 14:25
  3. Quick DS18B20 question
    By gti_uk in forum General
    Replies: 4
    Last Post: - 21st June 2009, 17:24
  4. quick question
    By Srigopal007 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd December 2004, 01:45

Members who have read this thread : 0

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

Tags for this Thread

Posting Permissions

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