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. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,869
    Likes:
    144
    Location:
    morristown,tn
  2. breadboardguy

    breadboardguy New Member

    Joined:
    Apr 27, 2009
    Messages:
    140
    Likes:
    0
    Location:
    montreal, Canada
    ...you really think i am that newb?
    (and i dont get what you mean, i know what is a tsop31256 and a tsal6200)

    To Nigel:

    Doesnt works without the 330 ohms resistor.
     
    Last edited: Jun 14, 2009
  3. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,324
    Likes:
    653
    Location:
    Derbyshire, UK
    ONLINE
    As suggested above, check my tutorial which shows how to connect a TSOP, you're missing vital decoupling components, and like I said, 330 ohms is FAR too low, if any resistor is needed at all. Try a 10K or 47K as pullup, but add the rest of the components as my tutorial - notice mine uses a 10K, but will work without it.

    Nigel's PIC Tutorial Infrared Board
     
  4. dave

    Dave New Member

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


     
  5. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,869
    Likes:
    144
    Location:
    morristown,tn

    No but I sure no how old you are. You can build it any way you want when it brake's
    You fix it. When it gos up in smoke you buy it back.
     
  6. npolynomial

    npolynomial New Member

    Joined:
    Jun 14, 2009
    Messages:
    4
    Likes:
    0
    PIC16F84A is unjustifiably expensive, but it will work for you, it is the flash version (upgraded) of the 16c84...

    MPLAB can take your asm program and convert it to the pic16f84a's machine language. Make sure you select which device you are trying to develop for, it is important so that it can assign the correct registers.

    asm programming is in my opinion slightly easier and far more versatile than basic, so good choice. However, for very advanced design you will almost certainly need to use C.. I'm working on a C++ compiler for PIC Micros... I'll be excited when I'm completed!

    You can use so many different ways of actually loading the hex into the PIC. I recommend buying a USB one from melabs they are cheap and can program almost all of the PICs in existance. Alternatively, microchip has some on their website, and there are also industrial tpyes that can program in 1 second to 16 chips at a time...costing about 800 dollars. Well worth it in the long run if you mass produce your designs.

    Sincerely,

    Jesse Randall
    Electronic Engineer
    Complete Turn-key Digital Electronics Design Nova Conceptions - Home
     
  7. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,324
    Likes:
    653
    Location:
    Derbyshire, UK
    ONLINE

    Certainly no one should be using an 16F84, and shouldn't have been for a decade or so - but, it's NOT a FLASH chip.

    The 16F84 was the replacement for the 16C84, mainly curing a bug in the code protection routines, where the 16C84 was relatively easy to break the protection on.

    Both use the same EEPROM memory techology, as do the vast majority of the F series - only some of the very latest ones are actually FLASH.
     
  8. skyhawk

    skyhawk New Member

    Joined:
    Feb 9, 2007
    Messages:
    235
    Likes:
    7
    Location:
    Morgantown, WV
    You obviously have not been following this thread. The OP is a young hobbyist with limited financial resources. He has already bought a PICkit 2 and 16F628As and 18F2525s.
     
  9. breadboardguy

    breadboardguy New Member

    Joined:
    Apr 27, 2009
    Messages:
    140
    Likes:
    0
    Location:
    montreal, Canada
    That is really strange, only the port b works as input on all my 16f628a. Do i have to set to port in some way?

    This problem driven me crazy because i was wondering why my 3 line program was not working.Works on port b...

    Works here

    doesnt here...
     
    Last edited: Jun 15, 2009
  10. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,869
    Likes:
    144
    Location:
    morristown,tn
    How would one no what is wrong can't see your code from here. Here why
    Code (text):

    Start:
    [COLOR="Red"]   movlw   0x07
        movwf   CMCON   ;turn comparators off[/COLOR]
        movlw B'00000000  ;loads w
        banksel TRISA     ;moves to tris reg.
        movwf TRISA    ;wirtes to tris setting all to out put
        banksel PORTA  ; moves to Porta reg
        clrf PORTA     ; sets all pins to output
     
    most likely the part in red
     
    Last edited: Jun 15, 2009
  11. skyhawk

    skyhawk New Member

    Joined:
    Feb 9, 2007
    Messages:
    235
    Likes:
    7
    Location:
    Morgantown, WV
    You have to turn off the comparators on port A.
     
  12. skyhawk

    skyhawk New Member

    Joined:
    Feb 9, 2007
    Messages:
    235
    Likes:
    7
    Location:
    Morgantown, WV
    PICs reset with analog inputs enabled. Use to disable comparators.

    Code (text):
    movlw   0x07
    movwf   CMCON
     
    Last edited: Jun 15, 2009
  13. breadboardguy

    breadboardguy New Member

    Joined:
    Apr 27, 2009
    Messages:
    140
    Likes:
    0
    Location:
    montreal, Canada
    Thanks for the info.
     

Share This Page