Pic10f206


Closed Thread
Results 1 to 8 of 8

Thread: Pic10f206

  1. #1
    Join Date
    Dec 2007
    Posts
    4

    Question Pic10f206

    I am trying to get the simple program below running.

    <code>
    PIN0 VAR GPIO.0

    start:
    HIGH PIN0
    PAUSE 500
    LOW PIN0
    PAUSE 500
    GOTO Start
    </code>

    I am using PBP v2.47 / vMCS 3.0.0.5 / MPASM v5.14
    This is the first time I have really used PBP. Although I have used ZBasic for years.

    I have the MELabs Serial Programmer and can compile and flash the code ok, but when power is applied to the proper pins the pic does nothing.

    Thanks,

    Mike

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


    Did you find this post helpful? Yes | No

    Default

    Hi and welcome on the forum,

    regardless to their size... they all have a datasheet, and few things have to be checked first. Here you want to use a specific I/O as a digital signal... but...

    This specific i/o have some analog stuff multiplexed on, so you MUST check if it's enable at POR.. unless... yes it will never ever dare to work... just to ruine your whole life and loose some hair at same time. So let's open the datasheet together
    http://ww1.microchip.com/downloads/e...Doc/41239D.pdf

    Page 3, table 1-1, it says it has 1 comparator, page 4, pin diagram show GP0/ICSPDAT/CIN+ the comparator input. Let's scroll to page 39, Register 8-1 CMCON0 register. At power up, it show comcon0=%11111111.. BIT3 CMPON.. when = 1 comparator is on.... you don't want it. clear everything

    CMCON0=0

    this should cure the problem.

    PS: default setting says that MCLRE is enabled, make sure you tie MCLR pin to vdd, or change the configuration fuse to disable the MCLR feature.

    more info
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    Last edited by mister_e; - 18th December 2007 at 04:09.
    Steve

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

  3. #3
    Join Date
    Dec 2007
    Posts
    4


    Did you find this post helpful? Yes | No

    Default

    Thanks for the help. I figured it was something silly like that. I got the fuses figured out and GP3 now functions as an input like I want it to. However the GP2 pin is set by several registers. We disabled CMCON0 so that takes care of COUT, but leaves T0CKI, FOSC4 is set to 0 in the OSCAL0 register so that should be ok. So if I am correct I need to get T0CS=0. Yes?

    Thanks again,

    Mike

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


    Did you find this post helpful? Yes | No

    Default

    Yes yes yes
    Steve

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

  5. #5
    Join Date
    Dec 2007
    Posts
    4


    Did you find this post helpful? Yes | No

    Default

    Here is what I am trying do really do with this device:


    <code>

    @ __config _MCLRE_OFF & _WDT_ON & _CP_OFF

    Include "modedefs.bas"

    CMCON0=0

    SI var GPIO.0 'Define serial in pin
    WakePin var GPIO.1 'Define Wake Pin
    B0 var byte

    start:
    low wakepin 'Set the WakePin low
    serin SI,N9600,10,start,b0 'Wait for an interval
    high wakepin 'Set the WakePin High, we got our interval
    B0 = B0 * 60 'Convert the interval to seconds
    sleep b0 'Sleep for the interval specified
    goto start 'Go to "Start"
    </code>

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


    Did you find this post helpful? Yes | No

    Default

    Bear in mind it's a real nifty PIC, i'll suggest you to use DEBUGIN instead of SERIN. At least @9600 baud with internal OSC, better the chances are to work with DEBUG than SERIN. There's a warning about that in the manual.

    I never tried DEBUGIN/SERIN with 10F though...
    Last edited by mister_e; - 18th December 2007 at 16:05.
    Steve

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

  7. #7
    Join Date
    Dec 2007
    Posts
    4


    Did you find this post helpful? Yes | No

    Default

    So I have been trying to get T0CS=0 in the OPTION register but PBP doesn't seem to under stand "OPTION" as a register name.

    Any ideas?

  8. #8
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Default

    try OPTION_REG instead of OPTION
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

Similar Threads

  1. PIC10F206 - What is the LOWEST Power @ Rest or Sleep
    By rixtalbert in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 18th March 2007, 14:42
  2. Problem with Picbasic Pro and PIC10F202, PIC10F206
    By mikaljan in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th May 2005, 21:02

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