16f88 problems


Closed Thread
Results 1 to 18 of 18

Thread: 16f88 problems

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    So from the code and your statement it looks like either the first "if startbutton = 1 then goto checkvalues" is reading incorrectly; or perhaps the first "flashingled = 0" is not being executed.

    Your initial settings look fine. You can remove the ADCON1 as this chip does not have this. I would perhaps have the order different (i.e. @device first), but I do not think it should make a difference.

    How is the "startbutton" input connected? Is it sharing anything with the solenoid?

    How is the "flashingled" connected?

    If you disconnect the solenoid output, does the code runs as expected?

  2. #2
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Code:
    'declare inputs and outputs appropriately
    PortA = 0
    PortB = 0
    TRISA = %00111100 ' a.5 is INPUT only
    TRISB = %11100100
    Try to set portA and B to zero before Tris
    What value is your pulldown resistor?

    Al.
    All progress began with an idea

  3. #3
    Join Date
    Nov 2007
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by aratti View Post
    Code:
    'declare inputs and outputs appropriately
    PortA = 0
    PortB = 0
    TRISA = %00111100 ' a.5 is INPUT only
    TRISB = %11100100
    Try to set portA and B to zero before Tris
    What value is your pulldown resistor?

    Al.
    the pulldown resistor is 1000 ohms.

    I won't have the opportunity to try new code for a while, but I will try that when I get a chance.

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mikey11 View Post
    the pulldown resistor is 1000 ohms.

    I won't have the opportunity to try new code for a while, but I will try that when I get a chance.
    I agree with Al, set port latches low before the tris register and make sure RBPU is disabled OPTION_REG.7 = 1
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  5. #5
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    The following may correct any R-W-M mismatch condition, but it is a little risky to write to the output latch (even if not an output) when it maybe directly connected to +5V (through the SW):
    Code:
    PortA = 0
    PortB = 0
    Would an initial read to the port, before the actual loop, do the same?

    The RBPU should be disabled by default (unless PBP assigns it behind the scenes).

    For these reasons I would have the port connected to +5V through a 10k resistor; and the switch would connect the port to GND (may be through 1k for protection).

    The following post may give some ideas (not identical, but helps illustrate): http://www.picbasic.co.uk/forum/show...t=weak+pull-up
    Last edited by languer; - 26th August 2009 at 09:00. Reason: update with link to post

  6. #6
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    Forgot to say that should you do this:
    For these reasons I would have the port connected to +5V through a 10k resistor; and the switch would connect the port to GND (may be through 1k for protection).
    You would change your code to read, "if startbutton = 0".

  7. #7
    Join Date
    Nov 2007
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by languer View Post
    So from the code and your statement it looks like either the first "if startbutton = 1 then goto checkvalues" is reading incorrectly; or perhaps the first "flashingled = 0" is not being executed.

    Your initial settings look fine. You can remove the ADCON1 as this chip does not have this. I would perhaps have the order different (i.e. @device first), but I do not think it should make a difference.

    How is the "startbutton" input connected? Is it sharing anything with the solenoid?

    How is the "flashingled" connected?

    the button is such that a wire leads from +5v to the switch, then from the switch to the pin and to a resistor to ground.

    The LED's are outputs from the pic that have a current limiting resistor of 1000 ohms.

    If you disconnect the solenoid output, does the code runs as expected?
    I have disconnected the solenoid output with no resolution of the problem.

Similar Threads

  1. Code works on 16F84A but not on 16F88?
    By pharaohamps in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th November 2009, 18:29
  2. Can't get a 16F88 to do anything.
    By ccowley in forum General
    Replies: 14
    Last Post: - 25th August 2008, 23:42
  3. 16F88 RA6 and RA7 troubles
    By gandora in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 3rd August 2007, 02:57
  4. 16f88 help
    By ccsparky in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 3rd July 2004, 17:50
  5. 4 line LCD with 16F88
    By anj in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 7th February 2004, 09:06

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