PDA

View Full Version : PIC Code Template



asguard
- 30th November 2006, 03:10
Hi,

Was wondering if there was a template of sorts available.
Have .asm code & HEX, but will not work on PIC.(for some reason, yet it was designed for PIC apparently). The code it seems is a bit on the messy side, And thus far I have not found any tools that will convert assembler (.asm, mpasm,tasm, or any other) in Basic, Pascal, C etc. into something that will work. So it looks as if I must rewrite the code for PIC 16f877, in some form that ICprog & JDM programmer for instance, would accept and write to PIC & work...(as it is, the HEX & .asm codes will write to the CHIP but when installed in hardware...no go).

Thus, the question being is there template that is set out in ordered sections, whereby I can just change the variables?

Eg: LCD,GPS,etc...

Any input would be appreciated.

Thank you

All the best

BobK
- 1st December 2006, 14:51
Hi Asgard,

You have posted a bit of a confusing post but what I think you need to know is the way to program a PIC. This forum is for users of a compiler program known as PIC Basic. Our other forum here is for users of PIC Basic Pro compiler. The compilers take the programs written in either of these two languages and convert them to .asm then to .hex. These compiled files, namely .hex can then be programmed into a PIC using one of many types of programmers available. Many people on these forums also use a companion program called Micro Code Studio which is an IDE. MPLab from Microchip is also an IDE type program and is used in creating programs in assembly language.

As for templates, I personaly don't know of any but if you search these forums you will find many programs that have been written that form the basics for other programs. Darryl Taylor has given us "Instant Interrupts", for example, which is a program that sets up the interrupt process. He has also donated a program that helps you create bargraphs on LCDs.

You will also find forums on Microchip.com. Google PIC and you will get many sites to investigate.

I don't know your level of expertise in this area so if I'm off base here I'm sorry. Let me know if I can help you any further.

HTH,

BobK

Archangel
- 1st December 2006, 23:58
Hi Asgard,

You have posted a bit of a confusing post but what I think you need to know is the way to program a PIC.

BobK
Hi Bob, I think he wants a decompiler to turn assembly back into basic, so he can alter his asm file to work on a different PIC. JS

asguard
- 4th December 2006, 05:07
Pretty close Joe and for right for a few applications I`m looking at, Bob not so close,

It apparently wont work on PICbasic lite as one seems to be limited to f628.
Have MicroCode Studio, MikroBasic Compiler, MPlab etc. All good.

I have erased the rest (another ten or so paragraphs trying to explain, which nodoubt would have confused reader). While writing this, a good example came to mind that would illustrate...The beginners or educational software called - CoreChart (h**p://www.elabtronics.com/Beginners_Templates.htm), is along the lines of what I was trying to explain, instead of sifting through forums and others mistakes, which may lead one to making the same ones, great if one has nothing better to do.

Granted, there are those among you that subscribe to... the do it and learn, and you only learn from your mistakes/errors (funny it seems that the thought must be that people cant learn from the errors of others). Would it not be more conducive, to be shown the right way, or be assisted in the right way first...
Learn from your errors indeed...I guess you were lucky some kept notes hey.. If not you`ld still be trying to invent gunpowder or dynamite..get it, probably not.

Anyways, think I`ve got it sorted, I`ll have something shortly that will do the job, convert etc, found some knowledgeable persons, they`re onto it.

Cheers fellas,
Have a great day.

Melanie
- 4th December 2006, 12:28
> Have MicroCode Studio, MikroBasic Compiler, MPlab etc. All good.

So whose BASIC Compiler are you using? The MeLabs product or the MikroBasic product?