Posts tagged: MikroC

Falling Snowflakes Graphics Demo for the dsPIC 33 MMB board

By , December 26, 2011 12:49 am

Created just in time for Christmas is a falling snowflakes graphics demo for the MikroElektronika dsPIC 33 Mikromedia board. The demo was created using MikroC Pro for dsPIC and VisualTFT. The demo features a winter theme with randomly generated snow particles. Each snowflake has a random position, size, and speed value.

This is a snowy graphics demo for the Mikromedia board.

This is a snowy graphics demo for the Mikromedia board.

Edit: This demo has been expanded into the Snowburst game.

Let’s all have a mikroBirthday!

By , December 12, 2011 8:00 pm

Since my friends over at MikroElektronika are celebrating their 10th Birthday I wanted to do something special to say thanks.

This evening I created an example for the mikroMedia dsPIC 33 MMB that lets you celebrate a birthday by blowing out a virtual candle. You get to blow out the candle on a cupcake by tapping the touch screen on a mikromedia MMB. After two seconds the candle lights itself up again and you can repeat the process.

MikroBirthday was created using MikroC Pro for dsPIC 5.20 and VisualTFT.

The source code and firmware for mikroBirthday can be downloaded from libstock.com

Let's all have a mikroBirthday today!

Let's all have a mikroBirthday today!

Automating Development with Tools in MikroC PRO

By , October 25, 2011 8:02 pm
This is my tool to load the current source code file in NotePad++.

This is my tool to load the current source code file in NotePad++.

MikroElektronika's compiler MikroC PRO has a handy Tools feature that allows you to automate your development workflow. You can specify external programs and command line parameters that you want to run. You can launch these tools from either a button located in your toolbar or with a hotkey. The tools feature is useful if you want to work with a 3rd party chip programmer or bootloader, or if you want to load your current source code file in an external text editor.

I first researched the custom tools feature when I wanted to automate the process of developing my own programs for the MikroElektronika mikromedia dsPIC33 board. This saved me having to manually start up the ds30 loader program every time I wanted to use the bootloader to transfer the latest version of my firmware.

You can download the excellent bootloader software ds30 loader here:
http://mrmackey.no-ip.org/elektronik/ds30loader/

This is my MikroC tool to automate the process of loading a new HEX file onto a mikromedia board using the ds30 loader.

This is my MikroC tool to automate the process of loading a new HEX file onto a mikromedia board using the ds30 loader.

Continue reading 'Automating Development with Tools in MikroC PRO'»

Exploring the Mikromedia dsPIC33 Board and Gaming Shield

By , October 11, 2011 9:54 am

For the past few weeks I have had the opportunity to use MikroElektronika's latest Mikromedia dsPIC33 development board with the new Gaming Shield and Battery Boost Shield. The Mikromedia board is also known as the MikroMMB board. It features a color TFT screen that is touch sensitive and has a 320 x 240 resolution display. The board also has a built-in MP3 decoder chip (VLSI VS1011e) that makes playing sound from a Micro-SD card easy.

The Gaming Shield accessory provides a game pad with arcade style controls, and two integrated speakers for sound playback. The Battery Boost shield allows you to power the Mikromedia Board for hours using two AAA batteries.

My First Mikromedia Project - Mini-Sub Game

For my first project using a Mikromedia dsPIC33 board I created a video game called "Mini-Sub". The game was designed to work with the two button pads and the speakers on the new Mikromedia Gaming Shield. The game was created using MikroC Pro for dsPIC.

In the Mini-Sub game you have to navigate a yellow mini sub through a treacherous ocean filled with naval sea mines. Use the left button pad to control the submarine and the square button to fire torpedoes to clear your path.

It takes 1 torpedo hit to destroy a red sea mine and two torpedo hits to destroy a grey sea mine.

Mini-Sub version 2.1 adds animated rotating sea mine sprites, harder levels, more lives, bonus items, MP3 music playback, and all round improved coolness!

The Mini-Sub game is hosted on libstock.com

You can get the latest version from:
http://www.libstock.com/projects/view/154/mini-sub-game-demo

Here is the title screen for the Mini-Sub game running on a MikroMMB dsPIC33.

Here is the title screen for the Mini-Sub game running on a MikroMMB dsPIC33.

The Mini-Sub game is fast paced and loads of fun!

The Mini-Sub game is fast paced and loads of fun!

You can pickup different types of bonus items as you play the game.

You can pickup different types of bonus items as you play the game.

Your Mini-Sub can fire torpedoes to destroy the sea mines in your path.

Your Mini-Sub can fire torpedoes to destroy the sea mines in your path.

Continue reading 'Exploring the Mikromedia dsPIC33 Board and Gaming Shield'»

Creating Music on a Stepper Motor

By , August 21, 2011 8:58 am

When I was developing an antenna tracker for my FPV flight project I noticed that it is possible to play back music on a stepper motor by energising the coils using a microcontroller + stepper motor controller along with the MikroC PWM1_Set_Duty library function. I kept one coil on the stepper motor permanently ON and then changed the PWM duty cycle on a 2nd coil to generate the sound. The patch antenna resonated due to the stepper motor vibrations and amplified the sound.

I used a program called Goldwave to convert a short clip of the MacGyver theme song to a low frequency integer audio file. I then used MikroElektronika's MikroC to compile a simple stepper motor controller program that energizes the coils to the tune of the music. I used a PIC18F4685 microcontroller to run the experiment.

mikromedia Gaming Shield Enclosure Community Design Concept

By , August 8, 2011 11:14 am
Here is the standard mikromedia Gaming Shield without an enclosure.

Here is the standard mikromedia Gaming Shield without an enclosure.

Last week MikroElektronika released a really cool product accessory called the mikromedia Gaming Shield that works with their existing MMB boards. This accessory is compatible with the PIC18FJ, DSPIC33 and AVR XMEGA mikromedia boards. The MMB boards can be easily programmed using either C code, Basic or Pascal using the MikroElektronika compilers. I have used MikroC since 2007 and have fallen in love with the speed that custom electronics projects can be completed thanks to the included software libraries that come with the compiler.

I think the gaming shield is a really innovative product for both electronics students and hobbyists. This means that electronics enthusiasts now have affordable bare metal access to embedded multimedia hardware. I can see people creating a lot of exciting interactive applications and games.

This week I was inspired to create my own 3D design concept for a mikromedia Gaming Shield enclosure. I used Autodesk Maya to model the design based upon reference images. I rendered the concept images using mental ray. The translucent case was created using a mental ray mia_material_x_passes surface material.

I am really happy that MikroElektronika mentioned my design concept on their news page. For future reference you can find the news article by looking for the date Aug 8, 2011!

When I get more accurate measurements I will update the design to add locking tabs, interior ribbing and bosses. Eventually I hope to create a prototype of the design using a 3D printer.

A Multi-Colour Lineup of MikroMedia Game Sheld Concept Cases

A Multi-Colour Lineup of MikroMedia Game Sheld Concept Cases

Low Angle View of a Multi-Colour Lineup of MikroMedia Game Sheld Concept Cases

Low Angle View of a Multi-Colour Lineup of MikroMedia Game Sheld Concept Cases

This is the Maya scene for my concept enclosure.

This is the Maya scene for my concept enclosure.

This is my concept design for a mikromedia Game Shield enclosure.

This is my concept design for a mikromedia Game Shield enclosure.

The idea for the enclosure was to have a transparent case so the electronics inside are visible to the user.

The idea for the enclosure was to have a transparent case so the electronics inside are visible to the user.

I wanted the controller buttons to have a retro classic console styling.

I wanted the controller buttons to have a retro classic console styling.

This is a rendering of the shell of the case without any electronics inside.

This is a rendering of the shell of the case without any electronics inside.

Here is a shot where you can see the back battery hatch for the case. The idea for the back hatch is that it snaps in place and is smooth with the back surface of the controller.

Here is a shot where you can see the back battery hatch for the case. The idea for the back hatch is that it snaps in place and is smooth with the back surface of the controller.

This is a view showing the openings on the side of the case for the mini-USB connector and audio jack.

This is a view showing the openings on the side of the case for the mini-USB connector and audio jack.