Surprising 16F628 / 20


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Default

    Hi, Jerson

    PORTB.0 = 1 : Led do not work

    HIGH PORTB.0 : Led works fine


    Hi, Ski

    I verified the ASM ... doesn't read anything at all ,here.

    Code:
    PORTB.0 =  BSF PORTB,0
    
    HIGH PORTB.0 =  BSF PORTB,0
                           BSF STATUS, 5
                           BCF PORTB,0
    
                        **Next ASM command** MOVLW 0xC8 ( Pause duration )
    
                           BCF STATUS, 5
    so, the only "surprising thing" is it writes PAUSE duration in W while addressing page 1 ... but I do not think it should cause any trouble ... I suppose it works like that not to toggle Page twice, if staying on page 1 !

    I'll try the program with XTAL clock ( it's the first time I use INTRC with this snippet ...) ever has worked well till yesterday ... just to see.

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Alain,

    My guess would also be read-modify-write. Try increasing the pause time from 200 to
    1000 in the first version you posted that isn't working. Does it work with the longer
    pause?
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    I had something similar.

    And even tough PORTB.0 = 1 or 0 did not work, interestingly PORTB.0 = PORTB.0 ^ 1 worked.


    ??
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  4. #4
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    another thought ...

    try removing the LEDs and watching the pins with a scope or DMM. If no load works then add more decoupler / filter caps.

    just my 1 cent
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  5. #5
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    966


    Did you find this post helpful? Yes | No

    Default

    Alain

    Just thinking aloud. I am assuming the 16f628 / 20 in the subject means you are thinking it runs at 20MHz or is it something else? The INTOSC for the 628 is 4MHz. Perhaps you have declared 20MHz for OSC like below. Is this a possible cause?

    define OSC 20

    I do remember having faced a problem like this once before, but unfortunately, I cannot recall what it was and in which project. It too had to do with an LED though. All I remember is that I had to write the port twice with a delay between the 2 writes to get it to behave.

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Default

    Hi, Jerson

    It's not a speed issue nor ... I intend to make them run @ 4Mhz !!! ( or so ... the RCINTOSC is somewhat aside the 4Mhz !!! )

    This Pic is just ... 10% under the 4 Mhz !!! ( 136 units for a true 1500 µs pulse ).

    I think we met the same issue ...


    Hi, Bruce

    The Pause time modifying do not change anything.

    Hi, Sayzer

    That's the strange thing ... just the ( let's say ) ASM command doesn't work. A signal rise and fall time issue inside the Pic ???

    Hi, Paul

    Signal is neat and right on the DMM ... only without the Led !


    So, ... I have to try another Pic Sample to confirm !!!



    BTW ... I discovered in MPLAB 8.10 programmer, If you ask for ALL Erase ... The EEPROM is NOT Erased, and you must explicitly ask for FF Writing ...

    same issue in the toolbar's "Erase Flash Device" ...

    to be verified for other processors ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  7. #7
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    >>If no load works then add more decoupler / filter caps.

    Sounds like it worked - do you have electrolytic decoupler and ceramic filter caps? Is your power clean? Have you reduced ground loops?

    Strange indeed to be sensitive to 12mA load switching ....

    Interested to know how it turns out
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

Similar Threads

  1. INT2 anomaly in DT_INTS-18??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 17th February 2010, 20:07
  2. capture/repeat data ?
    By Sam in forum Serial
    Replies: 44
    Last Post: - 27th November 2006, 03:19
  3. A little DTMF help
    By Travin77 in forum mel PIC BASIC Pro
    Replies: 48
    Last Post: - 30th May 2006, 01:31
  4. Code check -- button not working
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd March 2006, 22:43
  5. SERIN2 not working with 16F628
    By d1camero in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th May 2004, 20:37

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