12f609


Closed Thread
Results 1 to 6 of 6

Thread: 12f609

  1. #1

    Question 12f609

    Does anyone have a picbasic template for 12F609?
    I want to use the device with MCLR as input, not as MCLR. Also 8Mhz internal oscillator and set all remaining ports to outputs. I have tried a bunch of things and none worked. I am using the latest and greatest compiler. So I scrapped it all and want to see if anyone has used this chip body?

    Any help is very much appreciated.

    Nick

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


    Did you find this post helpful? Yes | No

    Default

    If you meant a template for the configs ...
    There is a "template" for every chip, located in the PBP folder.

    For a 12F609, open the 12F609.inc file and you should see this ...
    If you are using the default PM assembler, they are the blue ones.
    If using MPASM, they are the green ones.
    Code:
    ;****************************************************************
    ;*  12F609.INC                                                  *
    ;*                                                              *
    ;*  By        : Leonard Zerman, Jeff Schmoyer                   *
    ;*  Notice    : Copyright (c) 2007 microEngineering Labs, Inc.  *
    ;*              All Rights Reserved                             *
    ;*  Date      : 04/30/07                                        *
    ;*  Version   : 2.50                                            *
    ;*  Notes     :                                                 *
    ;****************************************************************
            NOLIST
        ifdef PM_USED
            LIST
            include 'M12F609.INC'	; PM header
            device  pic12F609, intrc_osc_noclkout, wdt_on, mclr_on, ioscfs_4mhz, protect_off
            XALL
            NOLIST
        else
            LIST
            LIST p = 12F609, r = dec, w = -302
            INCLUDE "P12F609.INC"	; MPASM  Header
            __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_ON & _IOSCFS_4MHZ & _CP_OFF
            NOLIST
        endif
            LIST
    For more info, see this thread ...

    Presetting Configuration Fuses (PIC Defines) into your Program
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    <br>
    DT

  3. #3


    Did you find this post helpful? Yes | No

    Question HELP! Debugin does not work

    I am seeing strange behavior with the 12F609. I have a start up port toggle to let me know it is going through the code. When it gets to the debugin I can't seem to make the ports work.



    INCLUDE "Modedefs.Bas"
    @ DEVICE PIC12F609, MCLR_OFF, IOSCFS_8MHZ, INTRC_OSC_NOCLKOUT,protect_off



    GPIO = 0
    TRISIO = %001100

    'TRISIO.0 ' Output
    'TRISIO.1 ' Output
    'TRISIO.2 ' Input IR module input
    'TRISIO.3 ' Input turn off MCLR
    'TRISIO.4 ' Output
    'TRISIO.5 ' Output



    DEFINE DEBUGIN_REG GPIO ' Set as software RX in
    DEFINE DEBUG_BAUD 1200 ' Set bit rate
    DEFINE DEBUGIN_BIT 2 ' Set GPIO bit 2
    DEFINE DEBUGIN_MODE 1 ' Set Debugin mode: 0 = true, 1 = inverted


    ; VARIABLES
    Payload VAR byte
    pause 100 ' pause holds up startup initialization for programming


    pause 1000
    GPIO = %010001

    pause 1000
    GPIO = %000000

    pause 1000
    GPIO = %010001

    pause 1000
    GPIO = %000000



    main:

    debugin [wait (255), payload]
    select case Payload
    case 0 'All stop
    GPIO = %000000

    CASE 10 'Right spin
    GPIO = %100000

    CASE 50 'Left spin
    GPIO = %000001

    case 100 'Straight
    GPIO = %010001

    END SELECT
    goto main

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


    Did you find this post helpful? Yes | No

    Default

    Analog pins ...
    Code:
    ANSEL = 0
    DT

  5. #5
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Insert DEFINE OSC 8 when using IOSCFS_8MHZ
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  6. #6


    Did you find this post helpful? Yes | No

    Wink nailed it

    Bruce nailed it. The ANSEL is superceded by the TRISIO according to the datasheet on all outputs, except for inputs where ANSEL is needed. I guess PBP was having timing issues since the define osc 8 was not declared.

    Shouldn't that result in an error though? I can't see where you would want to let the compiler have opposing declarations.

    Thanks guys!!!!

    Nick

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