Omnimaga

General Discussion => Technology and Development => Other => Topic started by: Spyro543 on January 25, 2012, 06:31:09 pm

Title: Spyro gots a pickit 2 starter kit
Post by: Spyro543 on January 25, 2012, 06:31:09 pm
I has gots a PIC18F4XK20 Starter Kit board!
This is a dev board-like device powered by a PIC processor. It has 4 buttons, 2 pots, audio in and out, 8 LEDs, and an OLED 128x64 screen that you can interface with. I'm hopefully gonna start programming it soon. Here's a pic:
(http://i.imgur.com/Wua7h.jpg)
It also came with the PICkit 2 Programmer device (that's also the power supply).
The cord that came with it to connect to the computer is bright red. Mom says she likes the bright red cord best, even more than the board itself. *.*

Pictures of it running programs coming soon (as soon as the IDE finishes downloading x.x man my internet is slow).
Title: Re: Spyro gots a pickit 2 starter kit
Post by: flyingfisch on January 25, 2012, 06:59:53 pm
...
Mom says she likes the bright red cord best, even more than the board itself. *.*
...

XD I can't really see what she would like about the board itself.
Title: Re: Spyro gots a pickit 2 starter kit
Post by: imo_inx on January 25, 2012, 07:06:54 pm
 ;D I need one of those.
Title: Re: Spyro gots a pickit 2 starter kit
Post by: Juju on January 25, 2012, 07:11:52 pm
That looks pretty nice. I should get one. Where do you get that?
Title: Re: Spyro gots a pickit 2 starter kit
Post by: ruler501 on January 25, 2012, 07:51:45 pm
I want one. How much are they?
Title: Re: Spyro gots a pickit 2 starter kit
Post by: runeazn on January 25, 2012, 08:27:07 pm
http://goo.gl/C57Jy

enjoy :)
Title: Re: Spyro gots a pickit 2 starter kit
Post by: Nick on January 26, 2012, 02:01:12 am
i like it that there's already a screen built-on, because correct screens are sometimes hard to find, good luck with it!
Title: Re: Spyro gots a pickit 2 starter kit
Post by: Spyro543 on January 26, 2012, 03:45:18 pm
Infos and stuff found here:
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en535806 (http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en535806)
Title: Re: Spyro gots a pickit 2 starter kit
Post by: Spyro543 on January 28, 2012, 12:56:56 pm
Ok guys, I am in need of some help. I got the correct compiler required for this board, and I tried to build a simple program that would turn on an LED on the board. Here is the code, checked and double-checked with the documentation:
Code: [Select]
#pragma config FOSC = INTIO67
#pragma config WDTEN = OFF, LVP = OFF

#include "p18f46K20.h"

void main(void)
{
TRISD = 0b01111111;
LATDbits.LATD7 = 1;
while (1)
;
}
I click Build All, and I get this error:
Error - could not find definition of symbol 'TRISD' in file './led1.o'.

TRISD is a variable that is defined in p18f46K20.h. For some reason, it says that it's not defined.
Here's the line in the header file:
Code: [Select]
extern volatile near unsigned char TRISD;I have no idea what's happening here. Can anyone here help?
Title: Re: Spyro gots a pickit 2 starter kit
Post by: Spyro543 on January 29, 2012, 08:55:36 am
I have that problem solved (by including the library file for this board) but now i have another problem. For some reason, the LED o the board is not lighting up. I did everything needed, programmed the board and released it from reset...but the LED is just not coming on!
Title: Re: Spyro gots a pickit 2 starter kit
Post by: DJ Omnimaga on January 29, 2012, 01:54:20 pm
I hope that it's not broken. Do you have a way to get a refund or something if that's the case? From what you were saying on IRC it seemed scary x.x
Title: Re: Spyro gots a pickit 2 starter kit
Post by: Nick on January 29, 2012, 02:18:46 pm
don't you have to initialize the led at the beginning of the program to have it working?

maybe try some fully official program that uses the led, if there are such programs, to make sure it's or your code or your board

maybe run the program and measure the voltage or current over the led, if there is nothing somethings wrong, if there is and your led does not work, just place a new led if that's possible
Title: Re: Spyro gots a pickit 2 starter kit
Post by: Spyro543 on January 29, 2012, 03:45:46 pm
I got it working!
Here's a vid:
Title: Re: Spyro gots a pickit 2 starter kit
Post by: Nick on January 29, 2012, 03:48:54 pm
nice :)

maybe you could make the pads wider and thinner, to learn about the sprite handling and coding and such..
really nice to see it working
Title: Re: Spyro gots a pickit 2 starter kit
Post by: Spyro543 on February 01, 2012, 08:01:31 am
Ok, now that I learned how to interface with the buttons, screen, and LEDs, it's time to make an operating system! I'm currently working on one I call Anova OS (it's all text based graphics, sorry, I don't know how to do graphics yet). So far I have gotten the title screen finished! Pics coming soon.

EDIT: 666 posts D:
Title: Re: Spyro gots a pickit 2 starter kit
Post by: Nick on February 01, 2012, 10:59:13 am
well, isn't every program you write for a pic a bit of an OS? since there is (afaik) only a bootloader and boot available, so...

but still it is nice, i really love the screen, but is it B/W, or was that just the pong game being only B/W?
i'm curious to what it looks like :) even if it's text based, you have to start with something, so that's really not bad..
Title: Re: Spyro gots a pickit 2 starter kit
Post by: Spyro543 on February 01, 2012, 02:14:05 pm
well, isn't every program you write for a pic a bit of an OS?
Yes that is true. But I'm making a program that actually behaves like an OS, with program launching and stuff.

well, isn't every program you write for a pic a bit of an OS? since there is (afaik) only a bootloader and boot available, so...

but still it is nice, i really love the screen, but is it B/W, or was that just the pong game being only B/W?
Yes the screen is only B/W but you can adjust the brightness (if I'm not mistaken, you can adjust brightness for a single pixel but I'm not sure).
Title: Re: Spyro gots a pickit 2 starter kit
Post by: Nick on February 02, 2012, 08:28:49 am
wow, so you can place programs on it that you can run from the os? nice, how're you gonna do that, because then you'll have to use the memory mapping (or how you would like to call it)...
i sure want to see that working, nice :)
Title: Re: Spyro gots a pickit 2 starter kit
Post by: Spyro543 on February 08, 2012, 08:27:11 pm
Sorry, no video about this (yet) but I did make a rectangle drawing routine. (Yes, I'm still playing around with it!! :D) You may think this is worthless, but the only way to interface with the screen is pixel by pixel. (Think of it this way:  drawing to the graph screen by only using Pxl-On().) So it was actually a bit challenging getting it working right. Here's the code for it:
Code: [Select]
void drawRect(unsigned char x1,unsigned char y1,unsigned char w,unsigned char h)
{
for(dx=x1; dx<=(x1+w); dx++)
{ putpixel_vram(dx,y1,1); }
for(dx=x1; dx<=(x1+w); dx++)
{ putpixel_vram(dx,(y1+h),1); }
for (dy=y1; dy<=(y1+h); dy++)
{ putpixel_vram(x1,dy,1); }
for (dy=y1; dy<=(y1+h); dy++)
{ putpixel_vram((x1+w),dy,1); }
oled_refresh();
}
Title: Re: Spyro gots a pickit 2 starter kit
Post by: Spyro543 on February 10, 2012, 04:49:49 pm

Here is a video of the rectangle drawing routine + example program, all written by me :)
Title: Re: Spyro gots a pickit 2 starter kit
Post by: Spyro543 on February 11, 2012, 08:05:45 am
I'm thinking about possible ways to get this thing to graph. I probably couldn't draw a solid line, but I could just draw some tested points.
Title: Re: Spyro gots a pickit 2 starter kit
Post by: thydowulays on February 11, 2012, 08:18:37 am
This looks quite amazing! Maybe if some of our members got one of those, a mini community could evolve from it!
Title: Re: Spyro gots a pickit 2 starter kit
Post by: Spyro543 on February 20, 2012, 08:09:10 pm
the only way to interface with the screen is pixel by pixel
Ok I lied there. There is a text drawing function. Also, I made a decimal to binary to hex to octal converter for it :D No video yet, but I should have one uploaded in a week or so :)