Temporary central repository of Darrel Taylor's works (including Mr E's Multicalc)


Results 1 to 40 of 55

Threaded View

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


    Did you find this post helpful? Yes | No

    Default Temporary central repository of Darrel Taylor's works (including Mr E's Multicalc)

    ALLDIGITAL.pbp

    If you want to use all the pins on your PIC as general Input/Output, you must first enable the DIGITAL inputs that are multiplexed with the ADC and Comparator pins.

    MICROCHIP in their infinite(simal) wisdom has DISABLED the DIGITAL inputs on Power-Up. Leaving everyone to figure out which of the 10 different ways they need to use to turn them on for the chip they're programming at any given time.
    Sometimes it's ADCON1 and CMCON, other times it's ANSEL and CMCON0, and still others it might take ANSELA ANSELB ANSELC and ANSELD.

    This file is an attempt to rectify that situation.
    I've tested it on all the common chips we use with PBP, and it workes extremely well.
    <hr>

    Simply INCLUDE the file, and all PINs will have any DIGITAL inputs enabled. Whether it's from the A/D converter or the Comparator(s).
    A single line will remove that big thorn from your ...

    Code:
    INCLUDE "ALLDIGITAL.pbp"
    If you are using MPASM for the assembler, add the following line to your program and the registers that need to be set for the CPU you are compiling for will be shown in the "Results" window of MCS.
    Code:
    DEFINE  SHOWDIGITAL 1
    For example, with a 16F877A it would show ...
    Code:
     ... MESSAGE:(ADCON1 = 7)
     ... MESSAGE:(CMCON = 7)
    At that point, you can just add those lines to your program and delete the INCLUDE line.
    If it shows a 0x7F type number, change it to $7F.

    Or for better compatibility, you can leave the INCLUDE in your program, and it will work with whatever chip you are compiling for.

    Here's a simple example for blinking an LED on PORTA.0, without worrying about the analog registers.
    Code:
    INCLUDE "ALLDIGITAL.pbp"
    
    Main:
        TOGGLE PORTA.0
        PAUSE 500
    GOTO Main
    <hr>
    Current Version = 1.4 (7/19/2010)
    Version History:<table border=1 cellspacing=1 cellpadding=3><tr><td>Version</td><td>Reason</td><td align=center>Credit</td></tr><tr><td align=center>1.0</td><td>Initial release</td><td align=center>Darrel Taylor</td></tr><tr><td align=center>1.1</td><td>Added Shared address SFR support for 18F87J50 family</td><td align=center>mister_e/scalerobotics</td></tr><tr><td align=center>1.2</td><td>Removed MPASM specific opcode (variable), for PM.exe</td><td align=center>Tobias</td></tr><tr><td align=center>1.3</td><td>Added ANSELA,B,D and E for the 16F72x series</td><td align=center>Darrel Taylor</td></tr><tr><td align=center>1.4</td><td align=center>Added ANSEL0 and ANSEL1 for the 18F4431 series</td><td align=center>Darrel Taylor</td></tr><tr><td align=center>1.5</td><td align=center>unknown</td><td align=center>This could be you!</td></tr></table>
    The attached .zip has only one file, ALLDIGITAL.pbp extract it to your PBP folder (the one with PBPW.exe).
    <br>
    Attached Files Attached Files
    DT

Similar Threads

  1. Darrel Taylor Interrupts and MultiCalc
    By AvionicsMaster1 in forum General
    Replies: 6
    Last Post: - 14th February 2012, 06:18
  2. Question on Mister E's PIC MultiCalc.
    By Dick Ivers in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 9th December 2011, 13:37
  3. Darrel Taylor's SPWM code usage
    By Homerclese in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 28th July 2010, 14:13
  4. using darrel taylor's instant interrupts
    By Michael Wakileh in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 31st July 2007, 04:07
  5. Replies: 18
    Last Post: - 23rd May 2006, 05:57

Members who have read this thread : 7

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