Conversion from picbasic pro to hex for mplab


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2010
    Posts
    4

    Default Conversion from picbasic pro to hex for mplab

    Hi all
    I have written a program in picbasic pro and not very familiar with PIC have been using AVR. and i dont have picbasic compliler am using mplab to bur the chip.
    I just want to used the mplab to burn it to tha pic or how will i convert the picbasic program to hex so as i can use it to burn

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


    Did you find this post helpful? Yes | No

    Default

    i dont have picbasic compliler
    You will have to purchase the compiler.
    http://store.melabs.com/prod/software/PBP.html
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    If you have written a program in PICBasic Pro, then you WILL NEED the PICBasic Pro Compiler to produce the HEX. No Compiler, No HEX. It doesn't come with MPLAB and it's not Free.

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,611


    Did you find this post helpful? Yes | No

    Talking

    Hi, Mel

    Sometimes ago we had a very similar query from spain on a model boat forum ...

    after some questions to understand our friend's wish ( of course he didn't speak neither french, German nor English ...) ... and that I gently offered to compile the source program and send back the generated Hex ...

    in the end, just showed he was asking for a new 2.60 release for free ...

    no more ...

    ** smiles **

    Of course ... never heard of him any more ...

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

  5. #5
    crazydave's Avatar
    crazydave Guest


    Did you find this post helpful? Yes | No

    Default a big favor please...

    Quote Originally Posted by Acetronics View Post
    Hi, Mel

    Sometimes ago we had a very similar query from spain on a model boat forum ...

    after some questions to understand our friend's wish ( of course he didn't speak neither french, German nor English ...) ... and that I gently offered to compile the source program and send back the generated Hex ...

    in the end, just showed he was asking for a new 2.60 release for free ...

    no more ...

    ** smiles **

    Of course ... never heard of him any more ...

    Alain
    Sir I have a problem, I have a command written in PIC basic Pro but our instructor told us we can only use MPLab IDE. The problem is I don't know how to convert these PIC basic Pro codes to those compatible to MPLab IDE. I need to pass the codes in one day. Hope you can change the codes for me. I will be very grateful if you can. Thank you
    Here is the code in PIC basic Pro:
    Code:
    ; PicBasic Pro Compiler 2.41, (c) 1998, 2002 microEngineering Labs, Inc. All Rights Reserved. 
    PM_USED            EQU    1
    
        INCLUDE    "16F84A.INC"
    
    RAM_START               EQU    0000Ch
    RAM_END                 EQU    0004Fh
    RAM_BANKS               EQU    00001h
    BANK0_START             EQU    0000Ch
    BANK0_END               EQU    0004Fh
    EEPROM_START            EQU    02100h
    EEPROM_END              EQU    0213Fh
    
    R0                      EQU    RAM_START + 000h
    R1                      EQU    RAM_START + 002h
    R2                      EQU    RAM_START + 004h
    R3                      EQU    RAM_START + 006h
    R4                      EQU    RAM_START + 008h
    R5                      EQU    RAM_START + 00Ah
    R6                      EQU    RAM_START + 00Ch
    R7                      EQU    RAM_START + 00Eh
    R8                      EQU    RAM_START + 010h
    T1                      EQU    RAM_START + 012h
    T2                      EQU    RAM_START + 014h
    T3                      EQU    RAM_START + 016h
    T4                      EQU    RAM_START + 018h
    FLAGS                   EQU    RAM_START + 01Ah
    GOP                     EQU    RAM_START + 01Bh
    RM1                     EQU    RAM_START + 01Ch
    RM2                     EQU    RAM_START + 01Dh
    RR1                     EQU    RAM_START + 01Eh
    RR2                     EQU    RAM_START + 01Fh
    _cms                     EQU    RAM_START + 020h
    _CycleCounter            EQU    RAM_START + 030h
    _i                       EQU    RAM_START + 031h
    PB01                    EQU    RAM_START + 032h
    PB02                    EQU    RAM_START + 033h
    PB03                    EQU    RAM_START + 034h
    _s                       EQU    RAM_START + 035h
    _PORTL                   EQU    PORTB
    _PORTH                   EQU    PORTA
    _TRISL                   EQU    TRISB
    _TRISH                   EQU    TRISA
    #define _MBtn                _PORTA_0
    #define _LBtn                _PORTA_1
    #define _RBtn                _PORTA_2
    #define _MLED                _PORTA_3
    #define _LMotorB             _PORTB_0
    #define _LMotorF             _PORTB_1
    #define _RMotorF             _PORTB_2
    #define _RMotorB             _PORTB_3
    #define _FSensor             _PORTB_4
    #define _RSensor             _PORTB_5
    #define _MSensor             _PORTB_6
    #define _LSensor             _PORTB_7
    #define _lmf                 PB01, 005h
    #define _lmb                 PB01, 004h
    #define _rmf                 PB02, 007h
    #define _rmb                 PB02, 006h
    #define _OnLine              PB02, 005h
    #define _MustTurn            PB02, 003h
    #define _MustTurnLeft        PB02, 004h
    #define _FastRotate          PB01, 000h
    #define _lls                 PB01, 003h
    #define _lrs                 PB02, 000h
    #define _lms                 PB01, 006h
    #define _lcb                 PB01, 001h
    #define _llb                 PB01, 002h
    #define _lrb                 PB01, 007h
    #define _ModeVar0            PB02, 001h
    #define _ModeVar1            PB02, 002h
    #define _schngd              PB03, 000h
    #define _PORTA_0             PORTA, 000h
    #define _PORTA_1             PORTA, 001h
    #define _PORTA_2             PORTA, 002h
    #define _PORTA_3             PORTA, 003h
    #define _PORTB_0             PORTB, 000h
    #define _PORTB_1             PORTB, 001h
    #define _PORTB_2             PORTB, 002h
    #define _PORTB_3             PORTB, 003h
    #define _PORTB_4             PORTB, 004h
    #define _PORTB_5             PORTB, 005h
    #define _PORTB_6             PORTB, 006h
    #define _PORTB_7             PORTB, 007h
    #define _s_2                 _s, 002h
    #define _s_6                 _s, 006h
    #define _s_0                 _s, 000h
    #define _s_1                 _s, 001h
    #define _s_4                 _s, 004h
    #define _s_5                 _s, 005h
        INCLUDE    "LINEFO~1.MAC"
        INCLUDE    "PBPPIC14.LIB"
    
        MOVE?CB    000h, PORTA
        MOVE?CB    000h, PORTB
        MOVE?CT    001h, _lmf
        MOVE?CT    000h, _lmb
        MOVE?CT    001h, _rmf
        MOVE?CT    000h, _rmb
        MOVE?CT    001h, _OnLine
        MOVE?CT    000h, _MustTurn
        MOVE?CT    000h, _MustTurnLeft
        MOVE?CT    000h, _FastRotate
        MOVE?CT    000h, _lls
        MOVE?CT    000h, _lrs
        MOVE?CT    000h, _lms
        MOVE?CT    000h, _lcb
        MOVE?CT    000h, _llb
        MOVE?CT    000h, _lrb
        MOVE?CT    000h, _ModeVar0
        MOVE?CT    000h, _ModeVar1
        MOVE?CB    000h, _CycleCounter
        MOVE?CB    007h, TRISA
        MOVE?CB    0F0h, TRISB
    
        LABEL?L    _main    
        CMPNE?TTB    _LSensor, _MSensor, T1
        CMPNE?TTB    _RSensor, _MSensor, T2
        LAND?BBW    T1, T2, T2
        CMPNE?TTB    _LSensor, _FSensor, T3
        CMPNE?TTB    _RSensor, _FSensor, T4
        LAND?BBW    T3, T4, T4
        LOR?WWW    T2, T4, T4
        CMPF?WL    T4, L00001
        MOVE?CT    001h, _lmf
        MOVE?CT    000h, _lmb
        MOVE?CT    001h, _rmf
        MOVE?CT    000h, _rmb
        MOVE?CT    001h, _OnLine
        MOVE?CT    000h, _MustTurn
        GOTO?L    L00002
        LABEL?L    L00001    
        CMPNE?TCL    _OnLine, 001h, L00003
        MOVE?TT    _LSensor, _lls
        MOVE?TT    _RSensor, _lrs
        MOVE?TT    _MSensor, _lms
        MOVE?CT    000h, _OnLine
        LABEL?L    L00003    
        CMPNE?TCL    _MustTurn, 001h, L00005
        CMPNE?TCL    _MustTurnLeft, 001h, L00007
        MOVE?CT    000h, _lmf
        MOVE?TT    _FastRotate, _lmb
        MOVE?CT    001h, _rmf
        MOVE?CT    000h, _rmb
        GOTO?L    L00008
        LABEL?L    L00007    
        MOVE?CT    001h, _lmf
        MOVE?CT    000h, _lmb
        MOVE?CT    000h, _rmf
        MOVE?TT    _FastRotate, _rmb
        LABEL?L    L00008    
        GOTO?L    L00006
        LABEL?L    L00005    
        CMPNE?TTB    _LSensor, _lls, T1
        CMPNE?TTB    _RSensor, _lrs, T2
        LOR?BBW    T1, T2, T2
        CMPF?WL    T2, L00009
        MOVE?CT    001h, _MustTurn
        CMPEQ?TTL    _RSensor, _lrs, L00011
        MOVE?CT    000h, _MustTurnLeft
        LABEL?L    L00011    
        CMPEQ?TTL    _LSensor, _lls, L00013
        MOVE?CT    001h, _MustTurnLeft
        LABEL?L    L00013    
        LABEL?L    L00009    
        LABEL?L    L00006    
        LABEL?L    L00002    
        CMPEQ?TCB    _MBtn, 000h, T1
        CMPEQ?TCB    _lcb, 001h, T2
        LAND?BBW    T1, T2, T2
        CMPF?WL    T2, L00015
        CMPEQ?TCB    _ModeVar0, 001h, T1
        CMPEQ?TCB    _ModeVar1, 001h, T2
        LAND?BBW    T1, T2, T2
        CMPF?WL    T2, L00017
        MOVE?CT    000h, _ModeVar0
        MOVE?CT    000h, _ModeVar1
        LOW?T    _MLED
        GOTO?L    L00018
        LABEL?L    L00017    
        CMPEQ?TCB    _ModeVar0, 001h, T1
        CMPEQ?TCB    _ModeVar1, 000h, T2
        LAND?BBW    T1, T2, T2
        CMPF?WL    T2, L00019
        MOVE?CT    001h, _ModeVar1
        MOVE?CB    010h, _i
        LABEL?L    L00021    
        CMPGT?BCL    _i, 01Fh, L00022
        READ?BB    _i, _s
        SUB?BCW    _i, 010h, T2
        SUB?CBW    0FFh, _s, T1
        AIN?WBW    T1, _cms, T2
        NEXT?BCL    _i, 001h, L00021
        LABEL?L    L00022    
        GOTO?L    L00020
        LABEL?L    L00019    
        CMPEQ?TCB    _ModeVar0, 000h, T1
        CMPEQ?TCB    _ModeVar1, 000h, T2
        LAND?BBW    T1, T2, T2
        CMPF?WL    T2, L00023
        MOVE?CT    001h, _ModeVar0
        HIGH?T    _MLED
        MOVE?CB    000h, _i
        LABEL?L    L00025    
        CMPGT?BCL    _i, 00Fh, L00026
        READ?BB    _i, _s
        SUB?CBW    0FFh, _s, T1
        AIN?WBB    T1, _cms, _i
        NEXT?BCL    _i, 001h, L00025
        LABEL?L    L00026    
        LABEL?L    L00023    
        LABEL?L    L00020    
        LABEL?L    L00018    
        MOVE?CT    000h, _lcb
        LABEL?L    L00015    
        CMPNE?TCL    _MBtn, 001h, L00027
        MOVE?CT    001h, _lcb
        LABEL?L    L00027    
        CMPEQ?TCB    _ModeVar0, 001h, T1
        CMPEQ?TCB    _ModeVar1, 001h, T2
        LAND?BBW    T1, T2, T2
        CMPF?WL    T2, L00029
        CMPGE?BCL    _CycleCounter, 055h, L00031
        HIGH?T    _MLED
        GOTO?L    L00032
        LABEL?L    L00031    
        LOW?T    _MLED
        LABEL?L    L00032    
        LABEL?L    L00029    
        CMPNE?TCL    _ModeVar0, 001h, L00033
        MOVE?CB    000h, _i
        CMPNE?TCL    _ModeVar1, 000h, L00035
        CMPNE?TCL    _lmf, 001h, L00037
        ADD?BCB    _i, 008h, _i
        LABEL?L    L00037    
        CMPNE?TCL    _lmb, 001h, L00039
        ADD?BCB    _i, 004h, _i
        LABEL?L    L00039    
        CMPNE?TCL    _rmf, 001h, L00041
        ADD?BCB    _i, 002h, _i
        LABEL?L    L00041    
        CMPNE?TCL    _rmb, 001h, L00043
        ADD?BCB    _i, 001h, _i
        LABEL?L    L00043    
        GOTO?L    L00036
        LABEL?L    L00035    
        CMPNE?TCL    _RSensor, 001h, L00045
        ADD?BCB    _i, 008h, _i
        LABEL?L    L00045    
        CMPNE?TCL    _MSensor, 001h, L00047
        ADD?BCB    _i, 004h, _i
        LABEL?L    L00047    
        CMPNE?TCL    _LSensor, 001h, L00049
        ADD?BCB    _i, 002h, _i
        LABEL?L    L00049    
        CMPNE?TCL    _FSensor, 001h, L00051
        ADD?BCB    _i, 001h, _i
        LABEL?L    L00051    
        LABEL?L    L00036    
        AOUT?BBB    _cms, _i, _s
        MOVE?CT    000h, _schngd
        CMPEQ?TCB    _LBtn, 000h, T1
        CMPEQ?TCB    _llb, 001h, T2
        LAND?BBW    T1, T2, T2
        CMPF?WL    T2, L00053
        ADD?BCB    _s, 001h, _s
        CMPNE?TCL    _s_2, 001h, L00055
        AND?BCB    _s, 0F0h, _s
        LABEL?L    L00055    
        AIN?BBB    _s, _cms, _i
        MOVE?CT    001h, _schngd
        MOVE?CT    000h, _llb
        LABEL?L    L00053    
        CMPNE?TCL    _LBtn, 001h, L00057
        MOVE?CT    001h, _llb
        LABEL?L    L00057    
        CMPEQ?TCB    _RBtn, 000h, T1
        CMPEQ?TCB    _lrb, 001h, T2
        LAND?BBW    T1, T2, T2
        CMPF?WL    T2, L00059
        ADD?BCB    _s, 010h, _s
        CMPNE?TCL    _s_6, 001h, L00061
        AND?BCB    _s, 00Fh, _s
        LABEL?L    L00061    
        AIN?BBB    _s, _cms, _i
        MOVE?CT    001h, _schngd
        MOVE?CT    000h, _lrb
        LABEL?L    L00059    
        CMPNE?TCL    _RBtn, 001h, L00063
        MOVE?CT    001h, _lrb
        LABEL?L    L00063    
        CMPNE?TCL    _schngd, 001h, L00065
        CMPNE?TCL    _ModeVar1, 000h, L00067
        SUB?CBW    0FFh, _s, T1
        WRITE?BW    _i, T1
        LABEL?L    L00067    
        CMPNE?TCL    _ModeVar1, 001h, L00069
        ADD?BCW    _i, 010h, T1
        SUB?CBW    0FFh, _s, T2
        WRITE?WW    T1, T2
        LABEL?L    L00069    
        LABEL?L    L00065    
        LABEL?L    L00033    
        CMPNE?TCL    _ModeVar0, 001h, L00071
        CMPNE?TCB    _s_0, 000h, T1
        CMPNE?TCB    _s_1, 000h, T2
        LOR?BBW    T1, T2, T2
        CMPF?WL    T2, L00073
        MOVE?TT    _s_1, _LMotorB
        MOVE?TT    _s_0, _LMotorF
        GOTO?L    L00074
        LABEL?L    L00073    
        MOVE?TT    _lmb, _LMotorB
        MOVE?TT    _lmf, _LMotorF
        LABEL?L    L00074    
        CMPNE?TCB    _s_4, 000h, T1
        CMPNE?TCB    _s_5, 000h, T2
        LOR?BBW    T1, T2, T2
        CMPF?WL    T2, L00075
        MOVE?TT    _s_5, _RMotorB
        MOVE?TT    _s_4, _RMotorF
        GOTO?L    L00076
        LABEL?L    L00075    
        MOVE?TT    _rmb, _RMotorB
        MOVE?TT    _rmf, _RMotorF
        LABEL?L    L00076    
        GOTO?L    L00072
        LABEL?L    L00071    
        MOVE?TT    _lmb, _LMotorB
        MOVE?TT    _lmf, _LMotorF
        MOVE?TT    _rmb, _RMotorB
        MOVE?TT    _rmf, _RMotorF
        LABEL?L    L00072    
        ADD?BCB    _CycleCounter, 001h, _CycleCounter
        GOTO?L    _main
        END?    
    
        END
    Last edited by ScaleRobotics; - 10th October 2010 at 16:53. Reason: added code tags

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by crazydave View Post
    Sir I have a problem
    Yes, I do agree, you have a problem ...

    the Picbasic Pro source program would be MUCH,MUCH, MUCH easier to try to "translate".

    just a question ... do you really understand what the PBP program does as a job ???

    Alain

    PS: I NEVER do homeworks for students ... just give help ...
    Last edited by Acetronics2; - 10th October 2010 at 20:57.
    ************************************************** ***********************
    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 " !!!
    *****************************************

Similar Threads

  1. PicBasic Pro Demo
    By nbrucew in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 26th August 2009, 20:10
  2. How to configure SPI in PICBASIC PRO?
    By moogle in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 15th April 2007, 19:31
  3. Question for all that use MELABS PICBASIC PRO
    By oskuro in forum Off Topic
    Replies: 2
    Last Post: - 24th March 2005, 18:15
  4. PicBasic Pro & PicBasic syntax different
    By Billyc in forum General
    Replies: 5
    Last Post: - 16th April 2004, 22:19
  5. PICbasic pro HEX file size
    By winsthon in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th January 2004, 09:11

Members who have read this thread : 1

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