+ Reply to Thread
Page 2 of 3
First 1 2 3 Last
Results 16 to 30 of 32

Thread: PIC16c assembly code

  1. #16
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,759

    Default

    Right, so you're using a crystal oscillator, presumably 4MHz or so?.

    When you get a brand new chip and read it, what do you get? - every memory location should read all ones.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk


  2. #17
    Topz Newbie
    Join Date
    May 2009
    Posts
    18

    Default

    Yes, theres a 4.0mhz crystal...
    When I read it I get all F7F... I'm guessing thats all ones?
    Is there another program I should try to use to burn these? Maybe the MPLAB is doing something thats causing the problem?

  3. #18
    Topz Newbie
    Join Date
    May 2009
    Posts
    18

    Default

    okay, I tried to program another PIC, programming seems okay as usual, but the pic still does not work. Heres the screen from MPLAB, when I hit 'program' I get a screen that says
    Device NOT blank, Program Memory Configuration Bits (Even though it is blank??)
    I programmed it and then did a verify

    PICSTART Plus Firmware Version 04.50.11

    Device is NOT blank:
    Program Memory
    Configuration Bits


    PICSTART Program\Verify Report
    30-May-2009, 17:35:04

    Device Type: PIC16C57
    Address Range 0-7ff


    Programming/Verification completed successfully


    PICSTART Program\Verify Report
    30-May-2009, 17:35:18

    Device Type: PIC16C57
    Address Range 0-7ff


    Program Memory Errors

    Address Good Bad

    0001: 08A0 0820
    0004: 08D7 0857
    0006: 089E 081E
    000B: 0881 0801
    000C: 08B8 0838
    000D: 08CC 084C
    0011: 08FC 087C
    0012: 08D0 0850
    001C: 0C87 0C07
    0048: 04C7 0447
    0049: 0996 0916
    0059: 0AA9 0A29
    005E: 0ACF 0A4F
    0063: 05A3 0523
    0069: 05A3 0523
    006A: 0ABA 0A3A
    006F: 05A3 0523
    0070: 0AB0 0A30
    0072: 06E7 0667
    0075: 07FA 077A
    0078: 0DE0 0D60
    007D: 099F 091F
    0080: 05C7 0547
    0081: 02A4 0224
    0087: 0990 0910
    008A: 0990 0910
    008B: 0388 0308
    0091: 06E7 0667
    0092: 0A90 0A10
    0093: 0CFF 0C7F
    0095: 04C7 0447
    0097: 07E7 0767
    Any additional errors are not displayed.

  4. #19
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,759

    Default

    Quote Originally Posted by Topz View Post
    Yes, theres a 4.0mhz crystal...
    When I read it I get all F7F... I'm guessing thats all ones?
    Is there another program I should try to use to burn these? Maybe the MPLAB is doing something thats causing the problem?
    It's a 12 bit device, when it's blank it should read all 'FFF', whereas the 14 bit devices read '3FFF' because of the extra two bits.

    If it's reading 'F7F' then it's not blank, or at least not working correctly.

    If you check the error log you posted, that's the problem, bit 7 is always zero.

    Do you know someone else who has a PICStart+, who could check one of your blank chips for you?.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  5. #20
    Topz Newbie
    Join Date
    May 2009
    Posts
    18

    Default

    No I don't, I have a Willem and a Data I/O 3900, I'll check if one of those two can supports PICs.. I'm guessing that its the PicStart and not the new PICs from mouser.

  6. #21
    Topz Newbie
    Join Date
    May 2009
    Posts
    18

    Default

    No luck, neither programmers support this PIC

  7. #22
    Help us help you blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent
    Join Date
    Jan 2007
    Location
    Toronto, Canada
    Posts
    10,694
    Blog Entries
    5

    Default

    You should not be using the C series PICs for prototyping as they cannot be erased unless they're the JW versions.
    It should not be difficult to migrate to a Flash device.
    Bill
    Smart Kits build Smart People

    http://www.blueroomelectronics.com/

  8. #23
    Topz Newbie
    Join Date
    May 2009
    Posts
    18

    Default

    I would love to migrate to a flash version (PIC16f57) but I don't have the source code for my project just the .hex and .bin files to burn. Can it still be done easily with these or do I have to have the source code?

  9. #24
    Help us help you blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent
    Join Date
    Jan 2007
    Location
    Toronto, Canada
    Posts
    10,694
    Blog Entries
    5

    Default

    Can you post the .hex file?
    Bill
    Smart Kits build Smart People

    http://www.blueroomelectronics.com/

  10. #25
    Topz Newbie
    Join Date
    May 2009
    Posts
    18

    Default

    it's from an old game. I was wanting to figure out what it does so I can change it and the game settings.

  11. #26
    Topz Newbie
    Join Date
    May 2009
    Posts
    18

    Default

    removed now....
    Last edited by Topz; 2nd June 2009 at 05:24 PM.

  12. #27
    Topz Newbie
    Join Date
    May 2009
    Posts
    18

    Default

    Good news, I contacted Microchip about my problem and they gave me a work around. The PIC16c57 needs Pin 26 not connected to be programmed correclty in the Picstart Plus. So I made an adapter and it works perfectly and I was able to program and verify a working PIC.

    blueroomelectronics- Did you get a chance to DL the .hex yet?

    I actually had to pay to have the rights to use the file for what ever I wanted. So I don't want to leave it out there too long. Its kinda worthless though if you dont know application it goes to which is why I posted it anyways.

    I would just like to be able to decipher that table of values now so I can play with it more.

  13. #28
    Topz Newbie
    Join Date
    May 2009
    Posts
    18

    Default

    I also got it converted to a PIC16F57 today, still working on what the RETLW lines are doing at the top of the file.

  14. #29
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,759

    Default

    Quote Originally Posted by Topz View Post
    I also got it converted to a PIC16F57 today, still working on what the RETLW lines are doing at the top of the file.
    As I've said repeatedly, the reset vector on the 16C57 is at the very top of memory, NOT at the start - the RETLW's are a simple lookup table.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  15. #30
    Topz Newbie
    Join Date
    May 2009
    Posts
    18

    Default

    okay, Is there a way that I can add some code to the .asm and make it show me the value of each of the items it is looking up? Like using the Debugger in MPLAB ? Some kind of Print type command that will show up in the output window of the debugger?

    Heres the table from the .asm
    ;--------------------------------------------------------
    ;
    ; Created By: PIC Disassembler
    ;
    ; Version: 0.3.0.476
    ;
    ; Created On: 6/4/2009 3:43:50 PM
    ;
    ;--------------------------------------------------------
    ; Processor Type
    ;--------------------------------------------------------
    LIST P=PIC16F

    ;--------------------------------------------------------
    ; Equ
    ;--------------------------------------------------------
    W EQU H'0000'
    F EQU H'0001'

    ;--------------------------------------------------------
    ; Code
    ;--------------------------------------------------------

    org 0x0

    RETLW 0x4D
    RETLW 0xA0
    RETLW 0x74
    RETLW 0x05
    RETLW 0xD7
    RETLW 0x51
    RETLW 0x9E
    RETLW 0x0A
    RETLW 0x64
    RETLW 0x14
    RETLW 0x68
    RETLW 0x81
    RETLW 0xB8
    RETLW 0xCC
    RETLW 0x14
    RETLW 0x1C
    RETLW 0x2C
    RETLW 0xFC
    RETLW 0xD0
    CLRWDT
    CLRW

+ Reply to Thread
Page 2 of 3
First 1 2 3 Last

Similar Threads

  1. Replies: 1
    Latest: 2nd March 2009, 01:02 PM
  2. Assembly Code Problem?
    By PhillDubya in forum Micro Controllers
    Replies: 2
    Latest: 13th October 2008, 01:06 PM
  3. Replies: 1
    Latest: 13th August 2007, 05:45 PM
  4. Looking for example assembly source code
    By sbdwag in forum Micro Controllers
    Replies: 2
    Latest: 15th March 2007, 05:04 PM
  5. Help understanding assembly code
    By KMD in forum Micro Controllers
    Replies: 9
    Latest: 16th May 2005, 07:38 PM

Tags for this Thread