1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

pic compiling/programming questions

Discussion in 'Microcontrollers' started by breadboardguy, May 7, 2009.

  1. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,234
    Likes:
    641
    Location:
    Derbyshire, UK
    The PICKit2 is an ICSP, it can program any size of PIC, size makes no difference.

    The early software versions of the PICKit2 only programed a very limited selection, but software updates now make it an excellent programmer that covers a large range.

    It's just a text file, Notepad is all you need - and is what I used for many years.

    Check out the various programmers on my website, all are parallel port programmers, I don't consider (so called) serial port ones to be reliable enough to support.
     
  2. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    The PICkit2 (and compatibles like my Junebug) come preprogrammed. Why would you need a second programmer?
     
  3. breadboardguy

    breadboardguy New Member

    Joined:
    Apr 27, 2009
    Messages:
    140
    Likes:
    0
    Location:
    montreal, Canada
    The clone version needs a bootloader or something like that, so you need to program a pic, like the propic2 gold.

    EDIT:
    Okay, i have mpasm, i made a notepad file and when i want to compile a lot of error boxes appears like: error :" notepad document name". I called my notepad file .asm .What am i getting wrong? can someone write a small program, so i can try it out to see if i am the problem.

     
    Last edited: May 15, 2009
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,808
    Likes:
    135
    Location:
    morristown,tn

    Your sure going to have a hard time with this if you don't slow down and read more about it before you get started. When I first started I ordered some pic32 chip looked real good reading the datasheet. I was going to make the programmer for it to LOL. When the chips got here and I looked at them I said what was I thinking there so small I can't see witch pin is what. 80 pins on a 3/8 square. So I got a pickit2 with the low count development board worked my way thew lessons That it has and looked at how the development board was made and made boards like it that can hold what ever chip I want to use.Then I found Nigels site and made his boards to and use them to. You get Mplab from witch I think you said you have Start it up and go to File
    1. open go to C://Program Files/Microchip/MPASM Suite/Example/TUTOR
    open that one up and save it to
    2. Make a New folder at C:/MyfirstAsm save as TUTOR in your new folder close all the windows in Mplab
    3. Open Project then use the Project Wizard set you device what your using
    4. Set tool suite to Mpasm
    5. browse to C:/MyfirstAsm open it up
    6. save what ever name you want to name it
    7. add your TUTOR.asm and click next
    Look at that code and see what its all about
     
  6. breadboardguy

    breadboardguy New Member

    Joined:
    Apr 27, 2009
    Messages:
    140
    Likes:
    0
    Location:
    montreal, Canada
    Thanks be80be , i build succeded the program that i shown up there ^ but i dont know where to find the resulting .hex file, i will search later...

    Nigel Goodwin:

    The serial programmer on your website only supports the 16c ...
     
  7. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US
    The .hex files usually compile into the directory where the source code is.
     
  8. breadboardguy

    breadboardguy New Member

    Joined:
    Apr 27, 2009
    Messages:
    140
    Likes:
    0
    Location:
    montreal, Canada
    How can i know what information to send on what pin of the chip with ic-prog? (db9 port)?
    Where can i find this information? And how Bonny Gijzen knew where and how to send the decoded (for the chip) hex file? Is it avalible information?(datasheet)
     
  9. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,808
    Likes:
    135
    Location:
    morristown,tn
    If you saved it like I said it will be at C:/MyfirstAsm/
     
  10. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,234
    Likes:
    641
    Location:
    Derbyshire, UK
    I suspect he possibly took it from the 16 bit version of WinPicProg originally, the source code of which I released, as he used the disassembler code from it entirely untouched.

    But apart from that you simply download the 'programming reference datasheets' from MicroChip - there should be one for every chip.
     
  11. breadboardguy

    breadboardguy New Member

    Joined:
    Apr 27, 2009
    Messages:
    140
    Likes:
    0
    Location:
    montreal, Canada
    I just want to make a unique pic programmer (16f62a), i read the programming datasheet but what i need to know is where to connect the db9 output of ic-prog on what pin of my pic. Of what i understand, ic-prog reads the *.o file and send it per pack of 14 bit (16) and a programming clock because the .o file is just a stream of 0111000100101. But where do i send this information? I think that i have set a pin to enter into prog mode and to send then the 14 bit data at 12 to 14 volts, then set the clock and repeat, but i could be very wrong, this is just a guess.
    I would need to know that because i dont really want to make and big universal programmer like propicII.
     
    Last edited: May 17, 2009
  12. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,234
    Likes:
    641
    Location:
    Derbyshire, UK
    You are VERY, VERY wrong.

    Even down to file you need, which is a *.HEX one.

    How can you have read the programming datasheet and not have the faintest idea about it?.

    Programmers are essentially the same for almost all PIC's, it's only the software which changes - as you obviously don't have the slightest clue what you're doing, I suggest you simply build one of the many programmers out there, and use existing software.

    Or, better still, buy a PICKit2 or a clone like the Junebug kit.
     
  13. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,808
    Likes:
    135
    Location:
    morristown,tn
    That would be fun
     
  14. breadboardguy

    breadboardguy New Member

    Joined:
    Apr 27, 2009
    Messages:
    140
    Likes:
    0
    Location:
    montreal, Canada
    On the propic2, there are 7 inputs(d0 to d5 and ack), is it the same for all the basic programmers with ic-prog? Does it changes with a different software?
    What is the d0 to 5? Does it stands for data?
    What is ack?

    I tought that universal programmers would be more complex due to the fact that the pin postion on each pic would change( mclr,etc.) so a 40 pin zif is needed and thats it...

    I just need to know what pin of my db9 i have to connect to what pin of the pic and at what voltage. The icprog website only gives you programmers, but not a single clue of what pin of your db9 does what. If you are too lazy, just give me a link.

    The only files that got out mpasm where .err .lst and .o .
    What are these.

    So it's icprog that encode the hex file?

    And i will read the prog datasheet( i didn't knew that it was containing useful information,so i just flew over it).
     
    Last edited: May 17, 2009
  15. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,234
    Likes:
    641
    Location:
    Derbyshire, UK
    Those are all nothing to do with the PIC programmer, they are pins on your computer parallel port.

    Programmer software is usually configurable for the precise pin layout you require.

    That's only on the output side of the PIC programmer, and not really part of it. Something like the PICKit2 makes that completely irrelevant by simply providing the lines which connect to the PIC for ICSP, although of course you can simply connect those wires to a socket and program the PIC in that.

    Look at the circuit for any programmer, there are various ones on my site.

    What has a DB9 got to do with anything?.

    No, MPASM generates it, it's the output file that your programmer software needs.
     
  16. breadboardguy

    breadboardguy New Member

    Joined:
    Apr 27, 2009
    Messages:
    140
    Likes:
    0
    Location:
    montreal, Canada
    db9 is the name of my computer port...

    So *.o is the file that i have to send to ic-prog.

    Is this the answer i've been looking for? So i just have to connect connect pgc and pgd on the pic and all the other ones?Will it work with ic-prog or winpic800?I mean that it is not in the availible hardwares, so i have to configure my db9 port?
     
    Last edited: May 17, 2009
  17. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    Nigels programmer uses the Parallel port or DB25, the DE9 won't work.
     
  18. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    What are you talking about? The PICkit2 and compatibles should be preprogrammed by the seller. What's a propic2 (a parallel port progammer) got to do with a bootloader?
     
  19. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,234
    Likes:
    641
    Location:
    Derbyshire, UK
    That's the name of a socket type, not a port.

    No, *.HEX is as I've said before.

    DB9 is a socket, not a port, it's one of the two socket types used for serial ports though - are you talking about a serial port?. If so you've been talking about parallel ports with D0-D5 and ACK, not serial port connections.
     
  20. breadboardguy

    breadboardguy New Member

    Joined:
    Apr 27, 2009
    Messages:
    140
    Likes:
    0
    Location:
    montreal, Canada
    "Unfortunatly to start the clone(pickit2) you have to program the firmware into the 18f2550-you will need a secondary programmer...()...once the firmware has been programmed, you can upgrade it without the need of another programmer, because the firmware also includes a BOOTLOADER."

    db9 serial port yes.

    It's the only output file that i got... with .err and .lst.

    OKAY... i am all mixed with the controversial facts that my father, you and internet provides me ( i dont say that you are wrong, i just dont know to look for what).

    Maybe my paint schematic is very wrong, if it is, just tell me why.How can i configure ic-prog to work with this?

    ...This topic should'nt had got that big...

    EDIT: i just seen that there is a pgm, what is it?
     

    Attached Files:

    Last edited: May 17, 2009
  21. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    Thats why the kits come preprogrammed. They're not expensive.
     

Share This Page