pic12F683 , gpio.5 not accessible...


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Jul 2007
    Posts
    65

    Default pic12F683 , gpio.5 not accessible...

    Hello all

    I've got my project quickly up n running thanks to Darrel's Instant Interrupts, but now I would like to use all pins on the 12F683 and my GPIO is just the most useless i've ever seen!!


    -I've try two different chip, same result
    -hack of options and settings, nothing, niet, nada

    ANSEL = %00000000 ' No Analog input, set all digital
    CMCON0 = %00000111 ' turn comparators off 07H
    TRISIO = %011100 ' inputs, outputs
    GPIO = %000000 ' outputs low << very important it seems!!
    OSCCON = %01110000 ' Internal 8MHz osc set speed


    I just want to use it as a button, or serial out, but no can do so far, it gives zEro volts, and react to nothing as a digital pin...unless I got a stupid mistake in my settings.

    others GPIO works fine (0to4), i get my serialLCD going no prob on GPIO.1


    thnx for help.


    So here is some more of the code, in case youd see the obvious bug:

    include "DT_INTS-14.bas" ;' DT Instant interrupt routines
    include "Elapsed_INT.bas" ;' Timer routines


    include "ReEnterPBP" ;' code is begin me to add this...

    Include "modedefs.bas" ' Serial port routines

    define OSC 8

    ; settings in INC file
    ' set in INC file => device pic12F683, intrc_osc_noclkout, wdt_off, mclr_off, protect_off ; FOR INSTANT INTERRUPT

    INTCON = 0 'Do not use PBP interrupts

    ANSEL = %00000000 ' No Analog input, set all digital
    CMCON0 = %00000111 ' turn comparators off 07H
    TRISIO = %011100 ' inputs, outputs
    GPIO = %100000 ' outputs low << very important it seems!!
    OSCCON = %01110000 ' Internal 8MHz osc set speed


    ' ******** Instant Interrupt setup ***************************
    ASM
    INT_LIST macro ; IntSource, Label, Type, ResetFlag?
    INT_Handler INT_INT, _DetectSendLaps, PBP, yes
    INT_Handler TMR1_INT, _ClockCount, PBP, yes
    endm
    INT_CREATE ; Creates the interrupt processor

    INT_ENABLE INT_INT ; enable external (INT) interrupts
    INT_ENABLE TMR1_INT ; Enable Timer 1 Interrupts
    ENDASM

    ; OPTION_REG = OPTION_REG & $80 | 1 ; Set TMR0 Prescaler to 256, leave RBPU alone, adjust for Xtal freqz

    LED1 VAR GPIO.0
    LCDport VAR GPIO.5 'LCD*communication port

    Output GPIO.0
    Output GPIO.1
    Input GPIO.2
    Input GPIO.3
    Input GPIO.4
    Output GPIO.5

    pause 1200 'let the LCD boot

    'Custom character for LCD
    'Empty heart
    serout LCDport, N9600, [18, 64, $0A, $15, $11, $0A, $04, $00, $00, $00 ]
    'Filled heart
    serout LCDport, N9600, [18, 72, $0A, $1F, $1F, $0E, $04, $00, $00, $00 ]

    serout LCDport, N9600, [ 12 ]
    serout LCDport, N9600, [ 12 ]

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    GPIO = %000000 ' outputs low << very important it seems!!

    I just want to use it as a button, or serial out, but no can do so far, it gives zEro volts, and react to nothing as a digital pin...unless I got a stupid mistake in my settings.
    Try setting as an input.

    GPIO = %000001
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jul 2007
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    well, I went aroudn trying pretty much every combination possible...

    TRISIO = %101100
    GPIO = %100001

    TRISIO = %101100
    GPIO = %000001

    TRISIO = %001100
    GPIO = %000001

    TRISIO = %101100
    GPIO = %000000

    there's just no way to turn on a LEd on that GPIO.5

    reading the spec sheet, it's a TLL cmos like all other ports... I can't see the missing link :<


    any working code that use that port as digital IO?


    tnx Dave for the quick reply

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    flipper_md
    >>well, I went around trying pretty much every combination possible...

    TRISIO = %101100 <font color=red>= Ports 2,3,5 AS INPUTS 0,1,4 as outputs</font color>
    GPIO = %100001 GPIO sets ports high or low if outputs, not if inputs. . . .

    TRISIO = %101100
    GPIO = %000001

    TRISIO = %001100 Here port.5 is an output, 2-3 as inputs
    GPIO = %000001 Port zero is output high

    TRISIO = %101100
    GPIO = %000000

    there's just no way to turn on a LEd on that GPIO.5

    reading the spec sheet, it's a TLL cmos like all other ports... I can't see the missing link :<


    any working code that use that port as digital IO?

    http://ww1.microchip.com/downloads/e...Doc/41211C.pdf
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by flipper_md
    ; settings in INC file
    ' set in INC file => device pic12F683, intrc_osc_noclkout, wdt_off, mclr_off, protect_off ; FOR INSTANT INTERRUPT
    If you're using Instant Interrupts, the program has to be assembled with MPASM.

    Look at the __CONFIG line in the 12F683.inc file, not the device line.
    <br>
    DT

  6. #6
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    If you're using Instant Interrupts, the program has to be assembled with MPASM.

    <br>
    Hi Darrel,
    I thought he was as he did not report any compiler errors, doesn't PM choke on DT_I.I.?
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. Programming Problem PIC12F683
    By StoneColdFuzzy in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 2nd June 2009, 21:39
  2. pic12f683 being picky about pins...
    By erice1984 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 26th March 2009, 23:16
  3. 12F683 and DT Instant Interrupts
    By jderson in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 22nd November 2008, 12:47
  4. LANC code 12F675
    By MikeDD in forum General
    Replies: 4
    Last Post: - 9th May 2008, 05:44
  5. PIC12F683 Pinouts?
    By cpayne in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 16th March 2006, 23:56

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