HSERIN / SERIN Problem with 16f690


Closed Thread
Results 1 to 25 of 25

Hybrid View

  1. #1
    Join Date
    Oct 2008
    Posts
    10

    Default

    Skimask,
    Okay, I put in your program. The light blinks once (when I release from reset - I don't touch anything), no character is displayed and that's it. I tried putting a HSEROUT before your main loop and it does send out a character. Any thoughts about turning off the built in analog stuff?


    Rob

  2. #2
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by rborsuk View Post
    Skimask,
    Okay, I put in your program. The light blinks once (when I release from reset - I don't touch anything), no character is displayed and that's it. I tried putting a HSEROUT before your main loop and it does send out a character. Any thoughts about turning off the built in analog stuff?
    My bad...yes, turn off all of the analog ports...everything over to digital.
    Code:
    Include "modedefs.bas"
    DEFINE OSC 3
    DEFINE HSER_RCSTA 90h
    DEFINE HSER_TXSTA 24h
    DEFINE HSER_SPBRG  92
    DEFINE HSER_CLROERR 1
    cm1con0 = 0 : cm2con0 = 0 : ansel = 0 : anselh = 0
    Char VAR BYTE : led var portb.6 : output led : input portb.5 : output portb.7
    led=1 : pause 500 : led=0 : pause 500 : led=1 : pause 500 : led=0 : pause 500
    Main: HSERIN [Char] : led = 1 : HSEROUT [Char] : pause 10 : led = 0 : GOTO Main
    END
    Last edited by skimask; - 28th October 2008 at 16:11.

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    Are you sure the PIC is running? Try a quick "blinky" without any serial stuff.
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Oct 2008
    Posts
    10

    Default

    Mackrackit,
    Yep, it's running. Follow the rest of my reply.
    Skimask,
    Sorry for the delay. I wanted to try some additional things. I'll explain in a bit. I tried the new code. It produces two long flashes on the LED and one very quick one. It then does nothing. No characters are displayed on the terminal and I can't enter anything. Thinking that it might be something else, I traded out the Max232 with a Max233 (eliminated the caps and such). Same results. I then tried a new 16F690 (thinking that the other one might have been damaged), same results. Anything we're missing here?

    Rob

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

    Default

    Floating MCLR?
    LVP is OFF?
    Noisy PSU?
    Poor contact, low battery, are some other great tests..

    You could also begin your program with something like...
    Code:
    START:
            HSEROUT ["1,2,1,2 TESTING....",13,10]
            FOR MyVAR=0 TO 250
                    HSEROUT ["MyVAR=",#MyVAR,13,10]
                    NEXT
            GOTO START
    Last edited by mister_e; - 30th October 2008 at 02:06.
    Steve

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

  6. #6
    skimask's Avatar
    skimask Guest

    Default

    Does the F690 run from the external crystal by default?
    Try removing DEFINE OSC 3 and see what happens.

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

    Default

    default config line is...
    Code:
     device  pic16F690, intrc_osc_noclkout, wdt_on, mclr_on, protect_off
    We don't see any config fuse setting here, so this would make some sense...
    Steve

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

  8. #8
    Join Date
    Oct 2008
    Posts
    10

    Default

    This is my config line

    Code:
     __config _XT_OSC & _WDT_ON & _MCLRE_ON & _CP_OFF

    Rob

Similar Threads

  1. HSERIN problem
    By eggman in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 6th October 2007, 21:31
  2. Serin Problem 16f819
    By jjohannson in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd March 2007, 22:50
  3. SERIN AND SEROUT PROBELM USING 16f690 PIC
    By Charles in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 18th January 2007, 03:59
  4. Problem with PBP interrupt and Serin, please help
    By rgregor in forum mel PIC BASIC
    Replies: 0
    Last Post: - 22nd August 2006, 19:02
  5. HSERIN problem
    By s_syafiq81 in forum Serial
    Replies: 2
    Last Post: - 1st January 2006, 11:05

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