Pixel Art – Unity3D

Unity3D has been a great tools for multi-platform Game Engine. With the introduction to its 2D Engine, developing 2D games on Unity3D is easier than before, especially to multi-platform and multi-resolution devices.

However when dealing with Pixel Art, Unity doesn’t really producing a good result straight out of the box. In runtime, Unity trying to rescale all the sprites, to the devices resolution accordingly. This feature is great for developing Vector Art to support multi-resolution devices, but when it is dealing with Pixel Art, the outcome is unacceptable.


TableView + JSON Tutorial – Part II

Integrating UITableView and UINavigationController

To add the UINavigationController to the Apps, modify the AppDelegate.h as follow


Then, in the AppDelegate.m



Run your project and you should get the output as follow


The completed Apps can be downloaded from https://itunes.apple.com/us/app/malaysia-car-plate/id504558521?mt=8.


TableView + JSON Tutorial – Part I

Create New ViewController Project

We will start with creating a blank project. From the XCode, choose to Create New Project. Then inside the template selection pane, choose to create a Single View Application. Click Next to continue.



The next pane is for you to enter your Project Name, Company Identifier, and the Device Families. Since we are creating the iPhone Apps, choose the iPhone from the drop down menu.



After that, you will be prompt to select a folder to save your project.



Once your click the Create button, XCode will create the Single View Application template for you. If you click the Run button or ⌘R to test your apps for the first time.



The completed Apps can be downloaded from https://itunes.apple.com/us/app/malaysia-car-plate/id504558521?mt=8.


Interrupt for XC8

Interrupt is an important element in PIC microcontroller. The interrupt mechanism provides the ability to preempted the processor from running the main program and switch its resources to the peripherals that introduce the interrupt.

The flag is the signature for the microcontroller to identify which peripheral is calling the interrupt. In PIC microcontroller, the name of the flag for each peripheral ended with the word IF. For example: Interrupt flag for Timer 0 ( TMR0IF), Interrupt flag for INT1 (INT1IF) …

The portion of the codes that the processor going to execute during interrupt is called Interrupt Service Routine (ISR). It is the best practice to keep the ISR as short as possible.

It couldn’t be simpler for programming the interrupt using XC8 compiler

CodeOffset in MPLAB® X

Typically, the Resset and Interrupt High and Interrupt Low Vector is located at address, 0x0000, 0x0008, and 0x0018, respectively. However, when a bootloader is burned into the microcontroller, these address spaces have been consumed by the firmware (Microchip USB Bootloader Firmware is located in the memory location from 0x000 till 0x0FFF). Therefore, we have to remapped the memory location manually to acknowledge the microcontroller recognizing the memory layout.

Remapping the memory location is much easier using MPLAB® X and XC8 Compiler.

Goto File > Project Properties


Select the XC8 Linker, then from the choose Additional Options from the drop down menu.


In the CodeOffset Textbox, type 0x1000 (The bootloader is located from 0x0000 till 0x0FFF, therefore our program should start at 0x1000)


Click Apply or OK button to save the configuration.


Adding Files into Project

The files for a MPLAB® X Project is organized in various folders. Typically, we are working on either the Header Files (*.h) and the Source Files (*.c).

To add a new file into the Project, Right Click on the corresponding folder, then choose the file that you want to create.


In the New File windows, enter the File Name and make sure the correct Extension is selected.


Click Finish to create the new file.

Creating New Project

To start a new project, click File > New Project


Select the Microchip Embedded, and Standalone Project from the list


Select the Devices used in the project accordingly.


Select the Tool/Programmer available. In case of bootloader board, choose either as it doesn’t matter after all.


Select the Compiler used. If XC8 is not in the list, either the XC8 is not properly installed.


Lastly, key-in a suitable Project Name and Browse for the folder location to store in the computer.