RTC - code not working - Mel's example


Closed Thread
Results 1 to 19 of 19

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by malc-c View Post
    Well must be something with the configuration of port A.
    PORTA ... well, you have ...

    ADCON1 = $0F

    For a 16F877A it should be ...

    ADCON1 = 7

    Unless you want some analog channels.
    <br>
    DT

  2. #2
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    PORTA ... well, you have ...

    ADCON1 = $0F

    For a 16F877A it should be ...

    ADCON1 = 7

    Unless you want some analog channels.
    <br>
    I tried that well, ADCON1 = $0F but that didn't work... but then I'm currently using an 16f877a

  3. #3
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post

    For a 16F877A it should be ...

    ADCON1 = 7

    Unless you want some analog channels.
    <br>
    Uhmmm.. tried that and then changed the code to

    Code:
    	DecButton var PORTA.0	' Press to Decrement Button
    	SetButton var PORTA.1  'Press to Set/memorise Button
    	IncButton var PORTA.2	' Press to Increment Button
    but that still left the 12/24 hr set mode over-writing each other again !

  4. #4
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Try using DT's "AllDigital.inc"

    Quote Originally Posted by Darrel Taylor View Post

    Unless you want some analog channels.
    <br>
    Malc-C, since it doesn't appear you are using any analog channels in your application I recommend you use DT's "AllDigital.inc" routine as an INCLUDE in your program. It works great and takes care of all the register settings you are trying to figure out so that you don't have a conflict of your digital processing with ports that are set for analog input.

  5. #5
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Many thanks for the suggestion. At the moment I'm just verifying that the hardware works, and will (hopefully) be combining this code with some existing code for other functions, one of which has 4 pots on AN1, AN2, AN3 and AN4, so I'm really looking at setting up PORTA for a 50/50 split of analogue / digital when I come to migrating this all to a new PIC (18F4580) when my samples arrive

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