So far so good, you've been able to setup your Jaluino environment, let's now dive into this "Blink a LED" experiment. This will ensure your Jaluino board is working properly. At least to blink a LED...
Blinking a LED is somewhat the equivalent of a "Hello World" example, if you're familiar with software computing and programming language. "Hellow World" is supposed to be the simplest program, ever, which basically prints "Hello World", claiming to the whole world it's alive.
Printing something on a screen with a microcontroller isn't that simple.
In microcontrollers world, there's also a hardware part. So this "Hello World" example also has to be very simple on that side too. Blinking a LED seems to fit both hardware and software requirements of simplicity: not much parts, easy to build, easy to program, easy to check. Claiming to the world it's alive isn't as explicit as printing "Hello World" but watching a blinking LED should be enough.
Careful though: even blinking a LED can be a hair-pulling generator1. I hope you'll find enough information to pass this exam without getting bald.
Option 1 will require several parts:
Basically, as simple as it can be, we'll plug a LED and a resistor to one of PIC outputs, as shown in the following schematic2.

When assembling Jaluino and all these components on a breadboard, you should get something like this:
Double check LED pin layout, be sure it's not inverted. Longest pin is the anode, it must be connected to pin RA0. Pin on the flat side is the cathode, it must be connected to the ground.
As option 2, if you're a lucky Crumboard shield owner, you can simply plug it over Jaluino and enable LEDs by putting jumpers on JP1 and JP2. You'll get two blinking LEDs for the same price...
Select Jaluino without bootloader in compiling options, and compile sample. You should get the following output, notably "Exit Code: 0" which basically means "success" !
Amongst several files produced by jalv2 compiler is a file having *.hex extension. This file has to be uploaded to Jaluino. You'll need to use a programmer for this step. As there are many PIC programmers out there, not all are described in this documentation. Because it's widely used in jalv2 community3, uploading with Wisp648 programmer is explained in the following content4.
This pin layout is rather common and is at least used by widely used PICKit2 and Wisp648. If your programmer shows the same pin layout, you can directly plug it. If not, you'll need to use wires in order to connect correct pins together.
Use software which comes with your programmer and upload HEX file.
With Wisp648, we'll use xwisp5 (GUI graphical frontend). You can also use xwisp2 (command line tool), you'll have to bypass Jaluino IDE and type commands from within a terminal or console.
Using xwisp through Jaluino IDE, just select "XWisp programmer" and click on "Upload". XWisp interface will show up.
In the opened XWisp window, press "Go" button, your HEX file will get programmed.
Select XWisp2 binary according to your platform, and type (eg. Linux):
$ ./xwisp2u PORT /dev/ttyS0 GO ../samples/jaluino_medium_blink.hex xwisp2 version 1.9.6 for Linux (Dec 11 2008, Open Watcom C/C++ 1.70) File ../samples/jaluino_medium_blink.hex loaded and is Intel Hex format conforming Detected programmer: Wisp648, firmware version 1.29 Target: 18F4550 revision 06 (ID=1206) Target erased Transferring program to 18F4550 via Wisp648 Transferring program memory...100% Verifying program memory......100% Transferring data memory......100% Verifying data memory.........100% Transferring ID memory........100% Verifying ID memory...........100% Transferring fuses memory.....100% Verifying fuses memory........100% Write-Verify operation terminated successfully in 1.63 seconds Putting target in run mode xwisp2 terminated successfully in 2.00 seconds
Replace /dev/ttyS0 with your serial device file path, like /dev/ttyUSB0 if using a USB-to-serial adapter undex Linux, or COM1 if under Windows. If XWisp2 complains about not being able to detect target, or ends with some timeouts, unplug Wisp648 power supply for ~10secs, plug it and try again.
So HEX file has been uploaded to Jaluino, now can you see the LED blinking ? Is it alive ? Congratulations, you've been able to correctly setup your Jaluino board !
| Attachment | Size |
|---|---|
| jaluino_blink_sch.png | 3.2 KB |
| jaluino_blink_bb.png | 56.84 KB |
| crumboard_blink_bb.png | 46.14 KB |
| jaluino_compile_output.png | 16.52 KB |
| jaluino_wisp_icsp.jpg | 61.41 KB |
| jaluino_xwisp_setup.png | 5.28 KB |
| jaluino_xwisp_open.png | 9.57 KB |
| jaluino_xwisp_upload.png | 11.13 KB |