Pin 13 I\o


Closed Thread
Results 1 to 2 of 2

Thread: Pin 13 I\o

Hybrid View

  1. #1
    ron6699's Avatar
    ron6699 Guest

    Question Pin 13 I\o

    Hello!

    Can You help me?

    i want to write 16byte in internel eeprom,
    then read the 16 byte an send it on pin 13 out.

    My programm:


    SO CON 0
    N2400 CON 4
    B0 = VAR BYTE
    B1 = VAR BYTE
    B1 = "X"
    A = VAR BYTE
    OUTPUT 13
    HIGH 4
    FOR A=0 TO 15
    WRITE A,B1
    NEXT A
    FOR A=0 TO 15
    READ A,BO
    SEROUT SO,N2400,[#B0," "]
    NEXT A

    I will programm it on a goldcard and put it in a chipdrive!

    Why doesnt it works?

    Thank's
    RON

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hi Ron,

    A few things going on here.

    You've set SO as a constant of 0, then later used SO as the SEROUT pin. That will put the Serial Output on PORTB.0. I'm not sure which PIC you're using, but it's probably not pin 13.

    Variable declarations...
    B0 = VAR BYTE
    B1 = VAR BYTE
    should not have equal signs in them.
    B0 VAR BYTE
    B1 VAR BYTE

    I'm not sure what these two lines are for...
    OUTPUT 13
    HIGH 4
    but they have no bearing on your program.

    Try it like this
    Code:
    SO    VAR  PORTB.0   ' Or whichever pin you like
    N2400 CON 4 
    B0    VAR  BYTE
    B1    VAR  BYTE
    A     VAR  BYTE
    
    B1 = "X"
    FOR A=0 TO 15
        WRITE A,B1
    NEXT A
    
    FOR A=0 TO 15
        READ A,BO
        SEROUT SO,N2400,[#B0," "]
    NEXT A
    HTH,
        Darrel

Similar Threads

  1. Is this a K Type sensor?
    By jessey in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 21st November 2009, 13:55
  2. DS1820 with 16f688
    By jessey in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 23rd May 2009, 05:07
  3. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  4. Another RTC, DS1287
    By DavidK in forum Code Examples
    Replies: 0
    Last Post: - 12th December 2006, 17:07
  5. Pin High for 13 seconds while....
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 16th June 2005, 00:36

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