Afternoon, All.

Attached is a PIC assembler I've been working on over the last couple of weeks.

It's still under development and is not yet complete. It doesn't parse binary and decimal numbers, only hex.

I've included the bunch of examples I've used to check whether the outputed ASCII hex file is correct, and it works fine on all of them.

The only data types which the assembler understands at the moment is SSPIC_INPUTTYPE_FILEPATHNAME and SSPIC_OUTPUTTYPE_FILEPATHNAME, so ignore the others you see in SSPICasm.inc .

Also: only the line number is returned if an error occurs. I'll probably change this so that the calling exe can choose for itself where, and in what form, error output goes (ditto for normal input and output info).

It also allows equates (blah equ 0x05) as long as the number is a hex number.

I've noticed "list = blah" etc in some asm files given on a few websites. The parser doesn't understand those, since they're assembler-specific notation and have nothing to do with a plain assembler.
Also, some have "config" info. Those are specific to a prgrammer, and are also not parsed correctly.
I could be wrong in my assumption of the above; got to red a bit more.

Cheers,
Scronty
Posted on 2003-05-14 20:53:11 by Scronty
Scronty,

First, congratulations on creating a good project, any assembler is a non-trivial project.

However, other then the sheer intelectual pleasure of creating an assembler of your own (which is a very valid reason not to be treated lightly) why would you do this?

Microchip gives MPLAB away, its a fully functional manufacturer validated mature stable assembler, and a simulator (which is most useful). You can even use MPLAB to program a chip.

Did you miss MPLAB or am I missing something?

(I'll admit a ton of bias for Microchip, I've even just wrote a PO for their $700USD production programmer.)
Posted on 2003-05-15 07:02:47 by Ernie
Afternoon, Ernie.

I been trying to d/load mplab over the last few weeks, however it's a 25meg d/load and I always remember to d/load it just when I'm about to turn the 'puter off and go to bed:tongue:

If I was truely serious about this project I'd have done it in visual C++ or VB.:alright:

I'm sure I will at some stage remember to d/load mplab during the morning, however I'll probably just use it as a reference to what I can try to get this thing doing (i.e. types of dialogs and locations of controls/etc).

It's purely for fun, just to see if I can actually build something worth using on a regular basis :grin:

A programmer Dll is also in the works, however the assembler and basic IDE have to be finished first.

Cheers,
Scronty
Posted on 2003-05-15 07:24:56 by Scronty
Ohhh.. so you've never seen MPLAB...

It is awseome. Not only does it compile your code, it has decent macro capability, creates hex format output files, and more...

If you have one of their programmers (or s suitable clone) you can program your chips right from there.

And the simulator is unsupassed... you can single step your code line by line, watch the registers change, set breakpoints, toggle input pins. Just awesome in getting your code to work in the real world.

Run, do not walk, do not pass go, download it.
Posted on 2003-05-15 21:23:35 by Ernie
I alway machine code the files using DOS "Debug" than I use a file called Bin2Hex.exe to convert to hex file format. Than in MPLAB I use "Import" hex file. If I need to add comments I'll paste to clip board and put in Winword and add comments there.
Posted on 2003-05-18 17:56:28 by mrgone
Strewth !!
Posted on 2003-05-23 07:13:21 by Homer
I've just checked out MPLAB.
It's not a terrible editor environment, and the compiler gave me no trouble, once I realized that only labels could be in column 1.
I've coded up the framework for my new project (an indexing device for a rotary table on a milling machine), and I'm yet to build my burner.
I've designed my burner and baseboard around a 16f84, I'll try its cheaper and more powerful brother on my next project, when I've played some.

Scronty - When I loaded my code into this testbed assembler, and hit assemble, nothing seemed to happen. I tried invoking it form the keyboard shortcut to no avail also. No error, no action.
Posted on 2003-05-25 12:52:52 by Homer
Afternoon, EvilHomer2k.

Have you checked for a *.hex file where your *.asm file is located? If it assembles with no error, then there's no indication of an error ;).

Also: did you read what the assembler is capable/ not capable of in the first post? If you're using MPLab, then you might have "list = blah" and/or "_config" etc in there. The assembler hasn't been built to understand what to do if those directives are in there:tongue: .

Plus: It only understands HEX numbers/values. No decimal nor binary has been coded for. Note: it *does* check if they're decimal or binary numbers, however if the number *is* binary or decimal, the number is just returned as zero (0) and isn't currently converted yet.

If your sourcecode isn't too large is it possible to post it here and I'll see where the problem is (could actually be the assembler ;) ).

Cheers,
Scronty
Posted on 2003-05-25 17:03:22 by Scronty

Does anybody know the simplest and cheapest way to program the the 18F458/452/258/252?

I heard that the cheapest programmers rely on a helper software already loaded in the PIC, is it true?

Can anybody shed some light?

I don't need superfast programming.. just to transfer the data to the chip's flash memory from time to time (much rarely).

Thanks,
Kyle
Posted on 2003-05-26 01:35:30 by Kyle Katarn
Look up the chip your intersted in and download/print off its spec sheet. Im not familiar with either of them off hand. Each spec sheet will explain the physical hardware requirements for the (or they should).

:NaN:
Posted on 2003-05-26 20:13:58 by NaN
Yes it was due to undefined directives.
I will enclose the source regardless,
and include a bunch of BASIC macros which
emulates most of the BASIC stamp.

I haven't used any of it myself yet, just thought
someone out there might appreciate this too.

Kyle, you can burn PIC's with a burner made from a handful of junkbox parts, with designs devoted to either the serial or the parallel port.
These designs almost all use the same pins for the same functions,
and as such a bastard standard has developed, and theres a bunch of freeware software out there for performing the burn (controlling the serial or parallel interface that you built).
Cheap is as cheap does.
Posted on 2003-05-29 09:12:27 by Homer
I read about one that can be programmed in basic. I use PIC's for small cost effective controls. I like the PIC16F84 which comes in 4 & 10 Mhz. It's strait machine code with flash and 12 I/O's. It has watch dog timer or timer that has a prescaler which can be jam loaded for a highly accurate software adjustable time of day clock.
Posted on 2003-06-07 14:45:03 by mrgone
mrgone, what flavor of burner do you use for your 16f84's ??
Have you ever used the 20Mhz version, the 16f84A?
Posted on 2003-06-09 09:38:42 by Homer
Yes I have use 20 MHZ version with PLL designs. The Pic Start Plus is weak I know so when doing on board programming with surface mount you need a diode on the VDD pin to keep the programmer from trying to supply the whole PCB with power. Or you can use a seperate battery pack in your adaptor id you do not want to incorporate the blocking diode in your design.
Posted on 2003-06-09 11:47:54 by mrgone