Hello World for LiquidCrystal

XCore Project reviews, ideas, videos and proposals.
User avatar
feniksa
Member++
Posts: 22
Joined: Tue Apr 03, 2012 1:12 pm

Hello World for LiquidCrystal

Post by feniksa »

Version: 0.1
Status: Public release
License: BSD
Download: /files/project_builds/LuquidCrystal.zip

This project is "start" point for beginers
Ok, you bought some XMOS dev. kit, you are full of enthysiasm and... you got stuck. What to do? What connect and how? No problem, this HOWTO with small explanation will "dig" you in a XMOS world.
As a good startpoint, lets do some "Hello World" project.
What we will do:

Connect simple display LCM1602 via I2C bus to XMOS dev kit

What you need:

Some arduino start kit. In my case, I used this one: http://www.aliexpress.com/snapshot/6152415351.html
XMOS dev. kit. I used XK-1A http://www.xmos.com/products/xkits/star ... opment-kit
2x1K resistors (I used from Arduino start kit)
XMOS XTimeComposer https://www.xmos.com/support/xtools


 
Steps:
Prepare circuite

Take Liquid Crystal display



 
Connect Liquied Crystal to XMOS

Liquid Crystal GND -> To XMOS GND
Liquid Crystal VCL -> To XMOS +5V
Liquid Crystal SDA -> To XMOS pin XD0
Liquid Crystal SDC -> To XMOS pin XD1

Connect 1K resistor to SDA and +5V
Connect 1K resistor to SDC and +5V



About pins mapping, please see: https://www.xmos.com/xs1-port-pin-mapping?secure=1

In a few words, you can easly find what PIN name you have and how to address to it in XMOS program.
Prepare software:

Install xTIMEcomposer https://www.xmos.com/products/tools/xtimecomposer
Run it

And, now we are only one step from displaying funny stuff on display

Create new project LuquidCrystal , choose your dev. platform. I choose XK-1A
Create main file main.xc with content

int main(void) {

    return 0;

}
Open xSOFTtip view
Find I2C Master (Single bit Ports) Function (General Use)
Import it
Open LiquiedCrystal -> Makefile, select Options , in Used Modules select module_i2c_master
Add i2c_matrix.h , i2c_matrix.xc and main.xc from project files to your project
Compile
Run

Special thanks for:
Mark N R Smith for I2C driver http://www.xcore.com/projects/i2c-lcd-driver
 
 

 
 
Images:
User avatar
feniksa
Member++
Posts: 22
Joined: Tue Apr 03, 2012 1:12 pm

Post by feniksa »

Sorry, images lost. Just re-uload images
User avatar
infiniteimprobability
Verified
XCore Legend
Posts: 1149
Joined: Thu May 27, 2010 10:08 am

Post by infiniteimprobability »

Thanks for sharing this - I'm sure lots of XMOS newbies will appreciate this practical guide. It always helps boost the confidence when working with a new technology to have a decent and fun tutorial, resulting in interesting stuff happening on your hardware..
Engineer at XMOS