Its not always the code that is wrong !!!!


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2003
    Posts
    432

    Default Its not always the code that is wrong !!!!

    Hi All,

    Just thought I would post a reminder of something to check!

    Last night I had typed a new thread pleading for help with getting RA4 to be a digital out on a 16F88.

    The pin is designated RA4/AN4/TOCKI/C2OUT

    I had included ANSEL=0 to get rid of AN4

    I had included CMCON=7 to disable the comparators

    My TRISA bits were set correctly and I was sure that the registers for TMR0 were OK but no matter what I tried I couldnt get RA4 to function as a digital out.

    Following Melanie's Law I read the datasheet time and time again and the only bit that I wasnt sure about was 13.5 which says....

    "The comparator outputs may also be directly output to the RA3 and RA4 I/O pins. When enabled, multiplexors in the output path of the RA3 and RA4 pins will switch and the output of each pin will be the unsynchronized output of the comparator."

    ... but I couldnt see anything that explicity enabled the multiplexors.

    I tried using RA3 as a digital output and that worked so I was pretty sure that my code was OK but it just wouldnt work

    I was just about to hit the "Submit New Thread" button when I decided to try another 16F88. SUCCESS

    I had spent the best part of two evenings trying to get a circuit working without checking that the chip was OK. I dont know how I had killed it but it had definately gone to that great breadboard in the sky.

    Sometimes you just get so focused on the code you are writing that you assume that is where the problem lies but it can be a lot more basic than that!!!

    DOH !!!!
    Keith

    www.diyha.co.uk
    www.kat5.tv

  2. #2


    Did you find this post helpful? Yes | No

    Lightbulb Stay Grounded!

    Hi,

    I'll bet hardly anyone in this forum does this when working at their bench (including me), but you should really use a ground strap when working with PICs. This is especially important in the manufacturing stage. Static discharges are scary because they can weaken a trace inside a chip without actually breaking it. Everything appears to run fine until the trace, which was "almost" destroyed during that initial static discharge, decides to suddenly break.

    Believe me, it happens, and customers "love" it.
    You think it's a pain when you're developing a product on the bench? Wait until you have several units in the field and the tech support calls start coming in.

    Stay grounded!



    Regards,
    ---> picnaut

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    ... and all along I thought we chained our assembly workers to the bench in order to reduce unnescessary coffee and toilet breaks...

Similar Threads

  1. Nokia COLOR LCD PicBasicPro 2.50a example code
    By skimask in forum Code Examples
    Replies: 49
    Last Post: - 28th September 2011, 01:43
  2. PIC BASIC TLC5940 code
    By eletrokat in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 8th May 2010, 21:01
  3. Manchester coding/decoding Code help
    By financecatalyst in forum Code Examples
    Replies: 0
    Last Post: - 25th August 2009, 19:05
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. Re-Writing IF-THEN-AND-ENDIF code?
    By jessey in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th August 2006, 17:23

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