Gpio ? Trisio ?


Closed Thread
Results 1 to 6 of 6

Thread: Gpio ? Trisio ?

  1. #1
    Join Date
    Apr 2006
    Location
    GearSweaterMountain, The Netherlands
    Posts
    52

    Unhappy Gpio ? Trisio ?

    Hi there,

    I'm kind of stuck on this. A few weeks ago i made a RC5 IR to 10F202 receiver. All
    worked fine. I decided that i need to store some counter values in eeprom, since the
    10F does not have that, i decided to go with the 12F519.

    I was used to set the IO functionality for the 10F trough the GPIO and TRISIO registers:
    Code:
    TRISIO = %00001000          'GPIO.3 = input only
    GPIO    = %00000000          'All low
    In the 12F519 datasheet is says the tri-state register is called TRISGPIO and the GPIO register is called GPIO.

    When i use TRISGPIO i get an syntax error, using TRIS or TRISIO also.
    When i set a pin like: SDA VAR GPIO.1 i get an error : undefined symbol 'GPIO'

    What am i missing ?

  2. #2
    Join Date
    Apr 2006
    Location
    GearSweaterMountain, The Netherlands
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    I think i figured it out, but i'm still confused ...

    When i compile :
    Code:
    TRISB   = %00111100                                      'Set TRIS register input's & output's
    PORTB   = %00000000                                      'Set all digital low
    
    SDA     var PORTB.0                                      'I2C DATA pin
    SCL     var PORTB.1                                      'I2C CLOCK pin
    It compiles, without any errors !
    How ?

  3. #3
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Change your PIC type to 12F519 in the menu above the program.

    ______________________
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  4. #4
    Join Date
    Apr 2006
    Location
    GearSweaterMountain, The Netherlands
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    Thought of that, checked just yet it is 12F519 ... So that's not it ....

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Wink The truth ...

    Hi,

    The truth is always Here :

    Code:
    '****************************************************************
    '*  12F519.BAS                                                  *
    '*                                                              *
    '*  By        : Leonard Zerman, Jeff Schmoyer                   *
    '*  Notice    : Copyright (c) 2007 microEngineering Labs, Inc.  *
    '*              All Rights Reserved                             *
    '*  Date      : 06/26/07                                        *
    '*  Version   : 2.50                                            *
    '*  Notes     :                                                 *
    '****************************************************************
    
    BANK0   $0007, $001F
    BANK1   $0030, $003F
    EEPROM  $0400, $043F
    LIBRARY "PBPPIC12"
    DEFINE  CODE_SIZE 400h
    
            include "PIC12EXT.BAS"
    
    TRISB	VAR	BYTE BANK0 SYSTEM	' TRISB shadow register
    
    PORTL   VAR     PORTB
    PORTH   VAR     PORTB
    TRISL   VAR     TRISB
    TRISH   VAR     TRISB
    
            include "PBPPIC12.RAM"
    
    '*----------------------* EOF 12F519.BAS *----------------------*

    Have a look to the "1xYzzz".bas file in your PBP Directory. ( 1xYzzz = 12F519, here )

    You can modify it or add Other Aliases ... at your own risks !

    for 10F :

    Code:
    '****************************************************************
    '*  10F206.BAS                                                  *
    '*                                                              *
    '*  By        : Leonard Zerman, Jeff Schmoyer                   *
    '*  Notice    : Copyright (c) 2004 microEngineering Labs, Inc.  *
    '*              All Rights Reserved                             *
    '*  Date      : 06/04/04                                        *
    '*  Version   : 2.46                                            *
    '*  Notes     :                                                 *
    '****************************************************************
    
    BANK0   $0008, $001F
    LIBRARY "PBPPIC12"
    DEFINE  CODE_SIZE 200h
    
            include "PIC12EXT.BAS"
    
    TRISIO	VAR	BYTE BANK0 SYSTEM	' TRISIO shadow register
    
    PORTL   VAR     GPIO
    PORTH   VAR     GPIO
    TRISL   VAR     TRISIO
    TRISH   VAR     TRISIO
    
            include "PBPPIC12.RAM"
    
    '*----------------------* EOF 10F206.BAS *----------------------*
    Alain
    Last edited by Acetronics2; - 15th October 2008 at 14:20.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  6. #6
    Join Date
    Apr 2006
    Location
    GearSweaterMountain, The Netherlands
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    You're so right !

    Thanks, all clear now !

Similar Threads

  1. Random output upon TRISIO setup on '683
    By picster in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 6th July 2009, 13:34
  2. 12F675 A/D and GPIO sleep interrupt
    By macinug in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 8th September 2008, 14:39
  3. Pic12f683, Trisio, High Z, A2d
    By jmbanales21485 in forum Schematics
    Replies: 9
    Last Post: - 5th July 2007, 19:34
  4. can't even flash an LED
    By bruno333 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 28th April 2005, 13:27
  5. 12c508 Gpio
    By oki_one in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 26th August 2003, 07:51

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