Continue to Site

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.

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

Junebug Led Demo

Status
Not open for further replies.

Mike_2545

Super Moderator
OK, so the Junebug is put together. Now I'm reading the LED demo that came with the kit and the second line is : include <p18F1320.inc>. Swordfish says Invalid expression.

What the????
 
OK, so the Junebug is put together. Now I'm reading the LED demo that came with the kit and the second line is : include <p18F1320.inc>. Swordfish says Invalid expression.

What the????

There are a lot of LED demos, and I do not have the docs you have in front of you. The include line you listed looks like it is from an ASM program. Why would you expect to compile it with swordfish basic ?

With one line of code that is my best guess.
 
Well obviously I don't fully understand this whole write, compile, transfer thing yet. Correct me if I'm wrong (Probably am).
There are programs like Swordfish that you write your program in.
Then there are programs (like PICkit2) that compile the program to hex and load it to the chip

Then there are acronyms like MPLAB, & MPASM that I have no idea about yet.

I have down loaded the MPLAB and still no closer to understanding what is going on.
 
Have you looked at JPUG #1? Lots of info on the Charlieplexed LEDs on Junebug. There is a Junebug module (a library program) that does the nitty gritty in the background for the LEDs and pushbuttons.

If you want to dive in you could try sorting out assembler or C18 (both have Junebug debug support)
 
Programming 101

Well obviously I don't fully understand this whole write, compile, transfer thing yet. Correct me if I'm wrong (Probably am).
There are programs like Swordfish that you write your program in.
Then there are programs (like PICkit2) that compile the program to hex and load it to the chip

Then there are acronyms like MPLAB, & MPASM that I have no idea about yet.

I have down loaded the MPLAB and still no closer to understanding what is going on.

Mike, I think you have some mis-conceptions here. If I'm stating things in a way that is *too* obvious, my apologies.

You "write" a program in a language that is easy for you (the human) to understand. This can be done with any text editor that tickles your fancy.
Your "language of choice" could be low lever (such as assembler), a high level language such as "C", or something in between "Basic". (I'm sure there are some out there who will question my categorizations.. but I'm basing this on the "Basic" that I'm familiar with, and used some 20+ years ago).

The program is then compiled into a form that the device itself will understand (aka "Machine Code"). This "machine code" is normally stored
on your drive and referred to as a binary (or HEX) image.

This 'binary' image must then be loaded into the PIC in order for the PIC to execute the code.

So.. back to your earlier statements:

When you mentioned "PICKit 2" as a program that compiles the code and writes it to the PIC, you are incorrect. PICKit2 (the software application) is not a compiler. It is a tool used to take the binary image and transfer it to the PIC.

What you want to look at is MPLAB IDE (IDE = Integrated Development Environment). An IDE typically combines all the tools you need into you program. You can edit your program, compile it, and download it to the device. As a bonus, it also includes a debugger that will allow you to step through your code, as it runs on the device itself.

I hope this puts a context in place for you.

[Disclaimer: I'm ignorant as to what Swordfish basic is. So I can't comment on how it works (or not). It may be just another language that you use to write your programs, or it may be an "Basic interpreter" that runs native on the target (your BASIC is interpreted, versus being compiled). Easy to use, but slow to run. I'm sure someone more knowledgeable can add details
about this]
 
what ever any one could try to explain, the best way, as i feel , is to have initial reading of the swordfish manual. Try to study and appreciate example programs or known working programs.

the OP might appreciate that the machine understands only proper grammer of the Language( presently swordfish basic) and any deviation, only error messages come.

Finally only rehearsal and hard work and understand and follow all the procedural sequences from writing to final loading of derived HEX file into the chip.

I fear, there are no short cuts, as I am also presently trying to do same thing.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top