Connect with us

Programming Pic

Discussion in 'Electronic Basics' started by lerameur, Sep 9, 2006.

Scroll to continue with content
  1. lerameur

    lerameur Guest

    Hello,

    I would to know what is the better method for programming pic.
    using basic or C ? or just the assembler ?
    I looked at mikroC and mikroBasic, and these are a bit confusing
    software
    Also I have the Microcontroller book from John Iovine, I tried some of
    his code and many do not work with the probasic compiler.

    ken
     
  2. Rich Webb

    Rich Webb Guest

    The answer to that is the same as the answer to: "What is the better
    method for digging a hole? A dental pick, a spade, or a backhoe?"
    The answer to both questions is: It depends.
     
  3. lerameur

    lerameur Guest

    Rich Webb a écrit :

    yes ok I get your point,
    Bu on the other hand, I have this basic program that does compile under
    basic compiler. I take the same program and paste in Mikrobasic and it
    do not recognize half the command...

    k
     
  4. The problem is that not all compiler use the same language - not all
    BASICs are equal, similar may be but not equal.

    you'll need to review your program ;o)

    regards,
    colin
     
  5. Jochen Rapp

    Jochen Rapp Guest

    Hi,

    but C for Pics is not C for Pics
    The Hitec-Compiler don't Compile a Sourcecode for a ccs- Compiler.

    If your Program greater than as a few bytes, you Should use a C-Compiler.

    Programming Pic 16XXXX with more than 2k Program Memory is in assembler a little
    bit tricky, becaus the Memory is oranized in 2k blocks. You must select the
    pages manually and it is not a fun to find a wrong or forgotten page-set.

    Af switch-Case statement ist in C simple, but in Assembler you don't have fun,
    if you see the source-Code one year later.

    With basic i don't have any experience.

    regards Jochen
     
  6. Jamie

    Jamie Guest

    assembler.
    //
    maybe the upper ones with lots of memory you could
    use C but thats about it.
     
  7. Byron A Jeff

    Byron A Jeff Guest

    Best depends on circumstance.

    A high level language will often facilitate getting a project done.
    However, assembly is still really the lingua franca of the PIC world.
    Everyone speaks it and many communicate ideas in it. Consider the
    fact that the PIC family manuals and virtually all of their application
    notes are written in assembly.
    Another issue with high level languages is their fragmented market
    segments. You have a mikroC or a HiTech C question and really only
    someone who uses that particular compiler can be of real help.

    Another issue I find is that as commercial software one is subject
    to the vagaries of the company offering the software. I guess that's
    a personal pet peeve.

    In any case I would advise taking the time to learn PIC assembly if
    for nothing else communication and translation purposes.

    As for another PIC language to take a look for try JAL. It's a
    Pascal like language, Open source, and has a pretty large and active
    community that uses a Yahoo group to interact. They just released
    a heavily modified second version. You can find the details here:

    http://pic.flappie.nl

    Hope this gives you some ideas.

    BAJ
     
  8. lerameur

    lerameur Guest

    Byron A Jeff a écrit :
    Yup,

    I was not sure, but now I will study assembler.
    Also I was using soem already made program and compiling it with
    picbasic, found out that picbasic pro is very different and will not
    compile the same program. pfff
    anyway , one more question

    I got this program fom: http://www.imagesco.com/articles/lcd/05.html

    main: pause 1000 ' wait for the LCD to startup
    serout PortB.0,0,[$FE,$01] ' clear the screen
    serout PortB.0,0,["Wherever you go"] ' send string "Wherever you
    go"
    serout PortB.0,0,[$FE,$C0] ' move the cursor to the 2nd line
    serout PortB.0,0,[" there you are "] ' send string " there you are
    "
    pause 1000 ' pause for a second
    goto main ' loop

    I hooked up the LCD and I get nothingIt does power on the LCD but
    nothing happens. I was not sure about the serial line (just had 16
    connection on top of the LCD) But I tried them out and nothing. Any
    ideas ?
    I test the chip and burner with blinking led so it does work and my
    steps are good.
    Just thought the program might be off.
    bt it does compile
    Also I use only three wires to the lcd.

    k
     
  9. Byron A Jeff

    Byron A Jeff Guest

     
  10. SDC

    SDC Guest

     
  11. lerameur

    lerameur Guest

    Thank you Steve,

    i took an assembly for pic out of my library and I reading it like
    crazy now. Probably be better to finish that befire doing something
    else. I find hat I missed a lot o important details.
    after that i will try your program for sure.
    I am still trying to find a web site where they give you the scematic
    of a device that would allow me to make my lcd serial. do you know of
    any ?
    I know of http://www.wulfden.org/k107/index.shtml but they have a
    prepogram chip that they only sell


    k


    SDC a écrit :
     
  12. "lerameur" <> schreef in bericht
    Thank you Steve,

    i took an assembly for pic out of my library and I reading it like
    crazy now. Probably be better to finish that befire doing something
    else. I find hat I missed a lot o important details.
    after that i will try your program for sure.
    I am still trying to find a web site where they give you the scematic
    of a device that would allow me to make my lcd serial. do you know of
    any ?
    I know of http://www.wulfden.org/k107/index.shtml but they have a
    prepogram chip that they only sell


    k

    <snip>

    Once you can program a PIC you can easily make one yourself :)

    petrus bitbyter
     
  13. jfm

    jfm Guest

    Interesting that you wrote this question because I just wrote some
    notes on it. Personally I like using C because I can read it and it is
    fairly standardized although as some others have said you have to
    adjust it for different compilers. They are also right that basic is
    less standardized and is more difficult to port to a different
    compiler. I find assembler just too much trouble (unless I really
    really need to use it).

    Anyway the article I wrote is at:

    http://www.best-microcontroller-projects.com/article-programming-a-microcontroller.html

    Also later on in this thread is a request for making a serial LCD
    display. You can find a project with full source code, documentation
    and schematic here:

    http://www.best-microcontroller-projects.com/serial-lcd.html

    It uses a PIC as the serial receiver.

    Hope that helps

    John
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-