Hserin


Closed Thread
Results 1 to 4 of 4

Thread: Hserin

  1. #1
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425

    Default Hserin

    Hi,

    I have a known working program and breadboard for a 16F688, 16F870, 16F876.... which works well. I have tried to import the same program on a 18F4550 and I have not had ANY luck. I verified the serial data is getting to the 18F4550 but I can't get it to do anything. I do have another program that I am using with the 18F4550 and it works good but it does not deal with the Hserin or Hserout. Do anyone have any suggestions as to what I can check?

    Thanks,

    Chris

  2. #2
    Join Date
    Mar 2003
    Posts
    41


    Did you find this post helpful? Yes | No

    Default HSERIN/OUT are not self contained instructions

    HSERIN/OUT require you to manually manage over-run errors and suchlike in the USART. This is hinted at in the paper manual but not mentioned at all in the on-line help that comes up in MicroCode Studio.

    Unless you manually fiddle with the USART registers you will have a very unreliable Tx/Rx system. I spent days farting around with this before I dumped HSERxx and went back to SEROUTx that works every time on any pin.

  3. #3
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Default

    So my question is, am I wasting time by using the Hserin/Hserout? Are there any major benefits to using these or should I just use serin/serout?

  4. #4
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    You're not wasting your time with HSERIN/HSEROUT. I use the onboard USART whenever possible. The reason being the onboard USART has a built in buffer.

    This means PICBasic can do other things and not miss any incoming data. In addition if you enable interrupts you serial string will be received without polling.

    The error handling isn't an issue for me because I automatically clear them as they occur with the following:
    DEFINE HSER_CLROERR 1 ' Clear all USART errors as they happen

    If I had to determine a cause I would have to say it is a setting that is missed on the new chip. Make sure all the defines and fuses are set correctly. Also make sure wiring is correct.

    Don't give up yet, its with the little amount of work.

Similar Threads

  1. HSERIN and XOUT command
    By aratti in forum General
    Replies: 20
    Last Post: - 12th May 2009, 11:58
  2. Instant Interrupts and HSERIN
    By Rob in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 31st January 2009, 05:13
  3. TMR0 interrupt and HSERIN
    By boban in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd September 2008, 11:48
  4. 16F877a Interupt driven Hserin
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 3rd November 2006, 00:38
  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 : 1

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