I don't understand this program


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Jan 2006
    Location
    New Hampshire, USA
    Posts
    107


    Did you find this post helpful? Yes | No

    Default

    Oh, thanks. I am glad you can't see my red face!

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


    Did you find this post helpful? Yes | No

    Default

    Russ,

    Try an experiment with the delay timing.

    1) HIGH PORTB.6
    2) PAUSE 1000
    3) HIGH PORTB.7
    4) PAUSE 1000

    5) LOW PORTB.7
    6) LOW PORTB.6
    7) pause 1000
    8) GOTO LOOP

    I've not tested this, but logic states that PORTB.6 goes high, waits a second, then PORTB.7 will go high, waits a second then both PORTB.6 & 7 goes low, waits a second then loops round.

    It will prove the the program is actually turning on and off the ports, and then you can play with the timing to get the desired effect you're after. As Paul stated, unless you have really keen eyesight, 1ms is very hard to see. Blink and you'll miss it

  3. #3
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Default

    What is connected to PortB.6 ?
    Maybe you struggled into the read-modify-write-trouble...
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

  4. #4
    Join Date
    Jan 2006
    Location
    New Hampshire, USA
    Posts
    107


    Did you find this post helpful? Yes | No

    Default

    Portb.6 connects to a 1K resistor and NPN base. My original post was a logical error, the basic problem that I was trying to solve, was that portb.6 was not producing an output sometimes. It turned out that the 5 volt supply was sagging after 4 seconds causing brownout reset. I was confused by the program running so long before failing.

Similar Threads

  1. Presetting Configuration Fuses (PIC Defines) into your Program
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 82
    Last Post: - 15th December 2013, 09:54
  2. Replies: 1
    Last Post: - 23rd May 2009, 09:22
  3. Compile and Program help using PICKit2
    By ozarkshermit in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 10th March 2009, 14:51
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. PIC16F684 Program question
    By Nicholas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th December 2006, 14:30

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