16F819 serin


Closed Thread
Results 1 to 4 of 4

Thread: 16F819 serin

  1. #1
    Join Date
    Jun 2005
    Posts
    53

    Default 16F819 serin

    I am attempting to communicate between 2 pics. I can send data OK
    but cannot seem to receive the serial data in to the pic. I can read the data
    with a serial input lcd. I have only attempted to send a single byte 128 to 255. Have any suggestions?

    INCLUDE "modedefs.bas"
    DEFINE OSC 8
    DEFINE CHAR_PACING 500
    OSCcon = $70 ' config 8mhz
    SO CON 6 ' Define serial output pin.
    SI CON 1 ' Define serial input pin.
    F VAR BYTE

    Output PORTB.0 'FDOT Out
    Input PORTB.1 'Serial In
    Output PORTB.2 'C1 Relay
    Output PORTB.3 'PWM Output
    Input PORTB.4 'status LED
    Output PORTB.5 'H Relay
    Output PORTB.6 'Serial Out
    Output PORTB.7 'C2 Relay

    PB = $ff
    'TRISA = %11111111
    'TRISB = %00000011
    'Poke PORTB, %00000000 ' Initialize PortB
    'Poke PORTA, %00000000 ' Initialize PortA

    Pause 2000
    loop:

    SerIn SI,t9600,F ' input character
    SerOut SO,t9600,[I,148,#F]
    Pause 500
    GoTo loop

  2. #2
    electronicsuk's Avatar
    electronicsuk Guest


    Did you find this post helpful? Yes | No

    Default

    Have you tried serin N9600 instead of T9600? When you receive directly from a computers serial port you need to use inverted (N), and a PC serial port sends out true, so I believe the same should be true for communication between two micros. You need to send in true and receive in inverted.
    Last edited by electronicsuk; - 21st June 2005 at 16:54.

  3. #3
    Join Date
    Jun 2005
    Posts
    53


    Did you find this post helpful? Yes | No

    Unhappy

    I have tried T9600, N9600, OT9600, ON9600.

    I tested the B1 input energizing a digital output and that works.
    I tried serin on B4 and it doesn't seem to work either.

    I'm stuck

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


    Did you find this post helpful? Yes | No

    Default

    looks like a faulty one since RB4 is multiplexed with the MSSP and it's disable at start-up...

    On wich pin the other PIC send the data???

    RA.4??? If so is there any pull-up resistor attach to??

    any on PORTA??? if so, is all analog stuff are disable???
    Steve

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

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. Serin Problem 16f819
    By jjohannson in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd March 2007, 22:50
  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 : 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