serin Bug on PIC16f688?


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    May 2006
    Posts
    19

    Unhappy serin Bug on PIC16f688?

    I still have a problem receiving data with my my pic16f688. I can send data (serout or serout2) but i can't receive it (serin or serin2) . does anyone else have this problem OR know how to solve it? (sorry for reposting it but i just need this to be solved, i've been patient enough but time is running out)

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Yes, I use serin on the 16f688, and it seems to work. What pin is your serin input? Do you have a pullup resistor on that pin or have you activated the pic's internal pullup? What goes wrong when you try serin?

  3. #3
    Join Date
    May 2006
    Posts
    19


    Did you find this post helpful? Yes | No

    Default

    i use PORTC.0 (pin10) or PORTC.1 (pin 9) (I tried both).I don't use pullups (YET ). What does that pullup resistor do and how do i activate internal pullup?

  4. #4
    Join Date
    May 2006
    Posts
    19


    Did you find this post helpful? Yes | No

    Post

    I connected my data wire with a 10k resistor to the ground (thats pulling down right?) and tried to use any combination of boudrates but i never see my pic blinking (so no data transmission yet...)
    @stamp:
    Code:
     
    DO
    FOR dat = 16000 TO 20000 STEP 1
    DEBUG DEC5 dat,CR
    SEROUT 10,dat, ["kk"]
    NEXT
    @pic
    Code:
    serIn2 S_in ,16780,[wait("k"),dat]
    gosub blink
    my pic and stamp both use the same power source so that can't be the problem either. and my stamp CAN transmit to my stamp so timing must be right...

    can anyone provide me a working code to make two pic16f688 communicate trough portc.1 so i can test my pics with that code.

    here is my full code again:
    stamp:
    Code:
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    ' {$PORT COM1}
    
    dat VAR Word
    
    DO
    FOR dat = 16000 TO 20000 STEP 1
    DEBUG DEC5 dat,CR
    SEROUT 10,dat, ["kk"]
    NEXT
    
    LOOP
    pic:
    Code:
    define OSC 20
    
    
    S_in    var PORTC.1
    S_Out   var PORTC.1
    Led     var PORTC.3
    dat     var byte
    
    init:
        gosub Startblink
        high led
        low led
        pause 500
        gosub blink
        
    Main:
           
    	SerIn2 S_in ,16780,[wait("k"),dat]
    	gosub blink
        pause 50
    goto main
    
    
    Blink:
        high led
        pause 10
        low led
    return
    
    Startblink:
        for dat = 1 to 16
        high led
        pause 10 * (16-dat)
        low  led
        pause 10 * (16-dat)
        next 
    return
    please help me...
    Attached Files Attached Files

  5. #5
    Join Date
    May 2006
    Posts
    19


    Did you find this post helpful? Yes | No

    Angry

    I'm getting a little pissed now! Why is nobody helping me? i asked a question (what are pullups and how do i enable internal pullups) that most of the people here can answer BUT NOBODY DOES. AND WHY IS ONE OF THE MOST BASIC FUNCTIONS (SERIN) NOT WORKING????? i know it must be a simple answer BUT I CAN'T figure it out alone... (i never had any lessons in electronics or uC programming becouse i'm still at highschool)

    does it have anything to do with ANSEL or TRISC?
    can anyone post or send me a WORKING code for a 16f688 that uses SERIN(2)

  6. #6
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Thumbs down

    OK, you are pissed ?????

    1.
    Use your brain !

    2.
    The sender works to fast! He sends maybe the lowbyte of the word "dat" followed by "kk".
    The receiver waits for one "k" and receives another byte. wrong order ?
    Then the LED is 10ms on.

    3.
    Using software-UART paused by blinking and waiting needs a very slow sender with pauses between the characters.

    4.
    Use Hardware-UART inside a Interrupt-routine.
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

Similar Threads

  1. PIC16f877 code crosses boundary @800h
    By inventosrl in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th April 2009, 22:03
  2. serin question?
    By sachymo in forum General
    Replies: 5
    Last Post: - 27th July 2008, 10:04
  3. BUG IN PBP 2.50 & 2.50A pic16F688 ??
    By FRANCISCOGIM in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 12th June 2008, 02:42
  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. SerIn and SerOut
    By Dwayne in forum FAQ - Frequently Asked Questions
    Replies: 0
    Last Post: - 21st July 2004, 15:54

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