Chameleon-PIC Nurve Networks, Chameleon-PIC Datasheet - Page 217

MCU, MPU & DSP Development Tools PIC24 & PROPELLER DEV SYSTEM (SBC)

Chameleon-PIC

Manufacturer Part Number
Chameleon-PIC
Description
MCU, MPU & DSP Development Tools PIC24 & PROPELLER DEV SYSTEM (SBC)
Manufacturer
Nurve Networks
Datasheet

Specifications of Chameleon-PIC

Processor To Be Evaluated
PIC24
Data Bus Width
16 bit
Interface Type
USB, VGA, PS/2, I2C, ISP, SPI
Operating Supply Voltage
3.3 V, 5 V
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Technical Overview
Here’s just the main() / loop() excerpt which shows the entire star field generator:
int main(void)
{
int ship_x = 12, ship_y = 0;
// Always call ConfigureClock first
SYS_ConfigureClock(MAX_FCY_RATE);
// initialize SPI
SPI_Init();
// give Prop a moment before sending it commands, the boot process is about a second
// if you like you can speed it up, by removing the Prop driver's "LED blink" sequence in the driver
// or speed it up, but commands that are sent before the Prop driver is done booting will be ignored.
// therefore, if you have a lot of set up work to do, then you don't require a delay, but if you jump right
// into commands, then you need a good 1.5 - 2 second delay
DELAY_MS( 2500 );
// clear screens
VGA_ClearScreen();
// enter infinite loop...
while(1)
} // end main
This demo should bring back memories of BASIC programming on your C64 / Atari 800 / Apple ][, if you ever did any text
only games and had to resort to things like “<-#->” as your space ship!
Summary
This demo shows that with a little creativity even the vanilla VGA terminal driver can be used for games.
{
// draw next star
// set color
VGA_Color(0);
// position star at bottom to cause scroll
VGA_SetXY( rand() % 32, 14 );
VGA_Term_Print(".
// draw our little ship at top
// set color to green (with a little forcefield :)
VGA_Color(4);
// position at top of screen and draw with ASCII art
VGA_SetXY( ship_x, ship_y );
VGA_Term_Print("<-#->");
// add some logic here to move the ship!
// slow things down a bit
DELAY_MS(10);
} // end while
// run over and over again
");
© 2009 NURVE NETWORKS LLC “Exploring the Chameleon PIC 16-Bit”
217

Related parts for Chameleon-PIC