blinking stops


Closed Thread
Results 1 to 10 of 10

Thread: blinking stops

  1. #1
    Join Date
    Sep 2006
    Posts
    747

    Default blinking stops

    hello,

    I just finish building the easyProgrammer. I am now
    doing test. I was able to program a few chip with a
    led blinking program.
    But it blinks for a few seconds only,10
    sec with a 16F648 and the same with a F88.
    i use the program in the picbasic compiler pro on page 6.
    Althought I see that there is setting of the clock anywhere

    ken

  2. #2
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Can you post your ENTIRE code so we can see if there are any errors in it.
    Keith

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

  3. #3
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    oK HERE IT IS:

    loop: High PORTB.0 ' Turn on LED connected to PORTB.0
    Pause 500 ' Delay for .5 seconds

    Low PORTB.0 ' Turn off LED connected to PORTB.0
    Pause 500 ' Delay for .5 seconds

    Goto loop ' Go back to loop and blink LED forever
    End


    aslo, I tried this code I found on google and it works fine:

    pragma target chip 16f628 -- no 16f818 support yet
    pragma target fuses 0x3F22
    pragma target clock 20_000_000
    pragma target osc hs

    include jpic
    include jlib

    var bit LED is pin_a0
    pin_a0_direction = output

    asm bsf status, 5
    var volatile byte ADCON1 at 0x9F = 0x06 -- disable port a analog functions
    asm bcf status, 5

    forever loop
    LED = low
    delay_10ms( 25 )
    LED = high
    delay_10ms( 25 )
    end loop

  4. #4
    Join Date
    Jul 2005
    Posts
    78


    Did you find this post helpful? Yes | No

    Default

    Hey, that's better then most programs do the first time thru!!!

    The code on page 6 doesn't have much to go wrong with it. 10 seconds sounds too long for something like the watchdog to fire, but I believe that will be on by default.

    What are you powering this with? Could the power be off after 10 secs?

  5. #5
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    there is a 12v battery to the breadboard, and a LM7805 regulating the circuit at 5.0 volt. 4 Mhz oscillator with 22pf cap.s

    Like i says it does work fine with the *.jal program I found at http://www.voti.nl/blink/code/b818-2.jal

    but my program do not work for more then 10- to 20 seconds

    ken

  6. #6
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    I have to add, if I unplug the power and wait like 5 minutes, then i get another series of 30 seconds blinking.
    If I just unhook the battery for a few seconds and put back the power, then it just barely flash and shut off.
    It seems some sort of memory is being unloaded and no power and filled up when it is activated.
    I has to do with the program , because it is working fine with the jal version


    k

  7. #7
    Join Date
    Jul 2005
    Posts
    78


    Did you find this post helpful? Yes | No

    Default

    Interesting problem. Same code 2 different compilers, 2 diffrent results.

    Here's something to look at: Fire up MPLAB, select the device type to match your PIC, then import the hex code for each version in turn.

    See if there are any differences in the config bits.

  8. #8
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    Actually the Jal version I used his hex file. it is programmed in jal. I am trying to programin basic and it do not work.
    Another interesting fact, I just used MikroC with this program:
    (I adjusted Mikroc to my pic chip and at 4 Mhz)

    void main() {
    PORTB = 0;
    TRISB = 0;

    while(1) {
    PORTB = ~PORTB;
    Delay_ms(500);
    }
    }

    it did work for a few minutes, i thought I had it, but after my diner it had stopped

    then I tried the jal version again and it did work for a long, after that I disconnected it
    http://www.voti.nl/blink/code/b818-2.jal

  9. #9


    Did you find this post helpful? Yes | No

    Default

    Do you have a 10k resistor connected to MLCr and + ?

    That drove my crazy the first time I played with pics.

    Regards,
    Daniel.

  10. #10
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    Yes.. that was what someone told me yesterday afternoon. It is now working. I spent like 10 hours on this yesterday, all i needed was a resistor...pffff unbelievable. I will have to read on that, MCLR

    ken

Similar Threads

  1. blinking problem with PIC16f887
    By larzazral in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th January 2010, 02:04
  2. blinking LED
    By kindows in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 31st July 2009, 16:08
  3. 7-segment display blinking problem?
    By serdar_ozcan in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th March 2006, 14:43
  4. Blinking LCD with using loop
    By Jųan in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 5th August 2005, 13:24
  5. Button stops when i use Serin
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th July 2005, 14:35

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