Problem with 16Ff648a


Closed Thread
Results 1 to 19 of 19

Hybrid View

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


    Did you find this post helpful? Yes | No

    Question

    HI

    Just cut and paste ...

    replace LOOP for LOOP1 for PBP 2.60

    ...

    Success 84 Words used
    So, this is not a chip problem ( I often use both chips ... no difference @ use )

    BINGO ...
    You should verify your Arrays declarations ... " illegal syntax " ...

    Alain
    Last edited by Acetronics2; - 10th November 2009 at 16:30. Reason: Bingo ...
    ************************************************** ***********************
    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


    Did you find this post helpful? Yes | No

    Default

    I knew about the LOOP variable and had changed its name for 2.60, and the result is the same, yes 84 words used, but it crashes, compiled with 2.43 or 2.6.

    The configuration bits are the same for 628A and 648A, the only difference in these 2 chips is the extra memory size.

    CLEAR is definately the problem, as if it is removed the program works, put it back and it does not. As far as I know CLEAR only writes zeros into all the declared memory locations and does nothing else


    Perhaps someone at Melabs could give me the reason why removing CLEAR makes the program work.

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Stupid question...
    But are you changing this line as needed?
    @ device PIC16F648A,HS_OSC,BOD_ON,MCLR_ON

    And selecting the correct PIC at compile time?
    Dave
    Always wear safety glasses while programming.

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Stupid question...
    But are you changing this line as needed?
    @ device PIC16F648A,HS_OSC,BOD_ON,MCLR_ON

    And selecting the correct PIC at compile time?
    Yes.
    PIC data sheet DS40044F, Page 1 says

    pic 628a program words 2048, sram 224 bytes, eeprom 128 bytes,

    pic 648a program words 4096, sram 256 bytes, eeprom 256 bytes,


    As I said the ONLY difference between the 628A and 648A is the extra memory size, program, and EEprom, you can, as I have proved, put the hex file of the 628A into the 648A and it works. The compiled size for 628A is 77 bytes with PB2.43. Compile for the 648A and size is 84 words. ( extra words presumably to account for the bit extra memory)

    I have now reduced the program to its simplest form for 648A, and before anyone else raises the configuration bits on programming, they are standard, HS,watchdog, power up timer, brownout, master clear reset are all selected, code protection off,and the correct pic.

    *************PROGRAM 1 compiles to 51 words pb2.43 and pb2.6
    DEFINE OSC 20
    CHECKVARIABLE VAR BYTE

    TEST:
    LOW PORTB.7
    PAUSE 250
    HIGH PORTB.7
    PAUSE 250
    GOTO TEST

    the above WORKS !

    *********PROGRAM 2 with the CLEAR ADDED compiles to 73 words pb2.43 and pb2.6

    DEFINE OSC 20
    CHECKVARIABLE VAR BYTE
    CLEAR
    TEST:
    LOW PORTB.7
    PAUSE 250
    HIGH PORTB.7
    PAUSE 250
    GOTO TEST

    The above does NOT WORK.

    you can even remove my CHECKVARIABLE and the results are the same.
    eg
    DEFINE OSC 20
    CLEAR
    TEST:
    LOW PORTB.7
    PAUSE 250
    HIGH PORTB.7
    PAUSE 250
    GOTO TEST
    does not work

    So it still looks as though the CLEAR is causing the problem, CLEAR only writes zeros to all the ram memory space, so it does not matter whether you have variables declared or not.
    Last edited by aerostar; - 11th November 2009 at 08:55.

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,651


    Did you find this post helpful? Yes | No

    Talking The ghost bug ....

    Hi,

    At the moment ...

    I have my personnal 18 pins test board in front of me, Pic is a 16F648a, loaded with your program ( no mod ... )

    you know what ??? ...

    Led @ PortB.7 BLINKS !!!

    Picture required ???

    soooo ... try another '648 ... after checking your board and solders ...

    Alain
    Last edited by Acetronics2; - 11th November 2009 at 10:13.
    ************************************************** ***********************
    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 " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Wink

    A '628 programmed with the '648 Hex file also works fine ...

    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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi,

    At the moment ...

    I have my personnal 18 pins test board in front of me, Pic is a 16F648a, loaded with your program ( no mod ... )

    you know what ??? ...

    Led @ PortB.7 BLINKS !!!

    Picture required ???

    soooo ... try another '648 ... after checking your board and solders ...

    Alain
    Hi Alain, thanks for the info, can you just confirm that you tried the 648A with the CLEAR.

    The PCB is a commercially made board, currently in use, and just has the pic changed. I have tested 2 PCBs known working, with same result.

    If yours does work, then I think there can only be 2 suspects left.

    Suspect 1
    The pics, I have tried 3 brand new ones, and all show the same problem, I have more but they are all the same batch, I will have to see if I can get a different batch.


    Suspect 2
    The programmer is not programming correctly, I use the Melabs EPIC programmer connected to LPT2, correct PSU and correct programming volts (re-checked this morning).

    The EPIC programmer software is 2.46beta, latest for this from Melabs site. I have tried the Melabs programmer 4.32beta, but that does not work, it does not read the chip ID.

    I will have to take the hex file to a friend tomorrow and get him to program the pic, at least that would rule out the programmer one way or another.

    OH...... yes there is a final suspect.......................Me !!

    Thanks all for your help.

  8. #8
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,651


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Yes, was with the CLEAR command enabled ( I verified it was also in the Asm listing ...)

    but, I begin to think your programmer doesn't set the config word correctly ... ( most common reason for such behaviour ... )

    could you read back the config word of one of your PICs w/ the programmer ???



    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 " !!!
    *****************************************

  9. #9
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by aerostar View Post
    ... The EPIC programmer software is 2.46beta, latest for this from Melabs site.
    That's the latest for epicwin, but it's not the latest for the epic programmer.

    Try using meProg, which works with all the programmers ... epic, serial, U2 and Field programmers.
    http://www.melabs.com/support/progsoft.htm
    <br>
    DT

  10. #10


    Did you find this post helpful? Yes | No

    Default

    Thanks Darrel, but I did say in my post at 15:51


    Quote Originally Posted by aerostar View Post
    The EPIC programmer software is 2.46beta, latest for this from Melabs site. I have tried the Melabs programmer 4.32beta, but that does not work, it does not read the chip ID.
    and will not even program the chip with the ID detect turned off.

    More info when I do some more testing....

Similar Threads

  1. Problem to compile my program
    By wagner in forum Off Topic
    Replies: 5
    Last Post: - 7th July 2008, 20:17
  2. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 08:12
  3. Microcode Studio 18f2455 problem?????
    By volkan in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 21st May 2007, 21:04
  4. Hardware problem or what ?
    By Steve S. in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 4th March 2007, 21:39
  5. 1 slave 1 master 1 MAX232 1 problem ?
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 31st July 2005, 22:59

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