SERIN2/RFID code won't run ?


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1

    Question SERIN2/RFID code won't run ?

    I can't get my code to step passed SERIN2. The DEBUG and SEROUT2 commands work good to the MCS. The 18F4620 was used first and then back to the 16F877A. The results are the same. All the configs. are OK and I have moved the SERIN2 input to different pins ( TTL and ST inputs) on both chips. A scope check of the data taken at the input pin of the PIC shows it to be correct ( $0A and the first three digits of the tag number) The reader is the Parallax RFID unit and it will work on the BS2 platform. Data is 8N1. The PASS TAG NOW makes it to the screen and thats it. Here is the read part of the 877 code:

    'GENERAL DEFINES
    DEFINE OSC 4
    DEFINE SER2_BITS 8

    'DEBUG DEFINES
    Define DEBUG_REG PORTC
    DEFINE DEBUG_BIT 0
    DEFINE DEBUG_BAUD 2400
    DEFINE DEBUG_MODE 1
    DEFINE DEBUG_PACING 100

    'VARIABLES
    BUF var BYTE(10)
    IDX VAR BYTE
    RX VAR PORTA.2

    'INITIALIZATION
    HIGH PORTA.1 'READER OFF
    PAUSE 3000 'INITIALIZATION TIMING

    'PROGRAM CODE
    MAIN:
    LOW PORTA.1 'READER ON (RED LED ON)
    PAUSE 1000
    DEBUG "PASS TAG NOW",13,10
    SERIN2 RX, 396, [WAIT($0A), STR BUF\10] 'DATA FROM RFID TO PIC
    PAUSE 100
    HIGH PORTA.1 'READER OFF (GREEN LED ON)
    PAUSE 250
    DEBUG "TAG IDENTIFICATION NUMBER IS:",13,10 'SEND THIS HEADER
    FOR IDX = 0 TO 9
    DEBUG BUF(IDX) 'DEBUG TAG NUMBER
    NEXT
    PAUSE 3000
    GOTO MAIN:

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Port A on a 16F877A...
    What's special about Port A?
    What is it about Port A and it's pins and it's functions that makes it different than most other pins on the PIC16F877A or the PIC18F4620?
    What is it?
    Maybe that's it's got Analog capabilities that some other pins don't have?
    I don't know...could be...might not be...

  3. #3


    Did you find this post helpful? Yes | No

    Default

    CCP2CON=00000000 'COMPARATORS OFF
    TRISA=0000100 'PORTA = OUTPUTS EXCEPT RA2 IS AN INPUT
    TRISB=00000000 'PORTB = OUTPUTS
    TRISD=00000000 'PORTD = OUTPUTS
    TRISC=00000000 'PORTC = OUTPUTS

    More SETUP included

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


    Did you find this post helpful? Yes | No

    Default

    Tip: ADCON1... CMCON
    Steve

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

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Added lines no help same results.

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Moved to RB0 and everything is running great. I thought I had the AD's and Compars off, may be not.? Senior brain pause? Spring? anything but stupid.Thanks.

Similar Threads

  1. ASM code
    By Bill Legge in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 1st March 2010, 23:55
  2. Problem runing my code
    By Mus.me in forum mel PIC BASIC Pro
    Replies: 33
    Last Post: - 1st December 2009, 20:36
  3. Simple LCD code not working!...WHY?
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 29th November 2009, 19:48
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. Timer PIC16F57
    By leonel in forum mel PIC BASIC Pro
    Replies: 25
    Last Post: - 1st July 2005, 08:14

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