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

converting file type?

Status
Not open for further replies.

Thorpydo

New Member
Hey,

I have a program written in basic. Can I use MPLAB to convert it to assembly and then MPASM to convert it to hex? If so how? And if not, how would you go about this?

Thanks
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Thorpydo said:
Hey,

I have a program written in basic. Can I use MPLAB to convert it to assembly and then MPASM to convert it to hex? If so how? And if not, how would you go about this?
You require the BASIC compiler the program was written for, this converts the BASIC source either to assembler (which you can then use MPASM on) or directly to a HEX file.
 

Thorpydo

New Member
I origionally programmed it with the Pbasic parallax software as I was using a stamp. Since then I have used Crownhill's "PICbasic" demo software and modified the code so there are no errors. The restriction with the demo version is that it only creates code for the several PICs(non of which I have).

I don't really mind paying for the software but it is not offered in the US and may be able to get by with the demo version.

I now have assembly code for the PIC16F877. Is it a simple task to convert it to run with my PIC16F628?

Thanks!
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Thorpydo said:
I now have assembly code for the PIC16F877. Is it a simple task to convert it to run with my PIC16F628?
Assembler code for the 16F877 and the 16F628 are identical, they both have the same 14 bit core. The only differences are in the hardware, the 16F628 has comparators and the 16F877 has analogue to digital converters (and lots more!). The only changes you need to make are in the settings of the hardware - unless you are using hardware not available on the 16F628?.
 
:idea:

Hello, you can program a pic (type supported) with the working code, read it back with a programmer (e.g. picstart) then dissaemble the code..... this isn't a task to take on lightly, dissasembling code can take a LONG time.... especially basic as it's normally pretty bloaty" <-- que mass flaming from "my basic is better/tighter/smaller/sexier etc than asm" brigade :wink:

I hope this helps
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Matt(Pic progger) said:
Hello, you can program a pic (type supported) with the working code, read it back with a programmer (e.g. picstart) then dissaemble the code..... this isn't a task to take on lightly, dissasembling code can take a LONG time.... especially basic as it's normally pretty bloaty" <-- que mass flaming from "my basic is better/tighter/smaller/sexier etc than asm" brigade :wink:
Disassembling PIC assembler only takes seconds, you load the HEX file into WinPicProg and press the 'Disassemble' button - source code in seconds!.

I understand MPLAB can disassemble HEX files as well, but I never use it.

There's generally no people claiming BASIC is better/faster etc. It's obviously not, but it has it's uses and is far quicker to write - and the speed of compiled PIC BASIC is generally pretty good!.
 

Thorpydo

New Member
I now have everything setup. I'm using USB KIT 128. I can't configure it so that the program looks at the USB port instead of the com ports.

I've downloaded the VCP drivers and placed them in a folder. How doI install them?

Thanks
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top