43oh

# gmtii

Members

25

2

## Reputation Activity

1. gmtii reacted to Mark Easley TI in NY Maker Faire
TI will be having a booth at the World Maker Faire in Queens, NY on September 21 & 22.  We'll be showing off some pretty awesome new additions to the TI ecosystem (*cough* *cough* New LaunchPad *cough*), stacks on stacks of BoosterPacks, Energia demos, and we'll be giving away some cool items. If you are in the area, stop by and chat us up!  Should be an amazing event.

Aside from launching new BoosterPacks, we are working with different 3rd Parties, like our friends at Element14, to enable Makers and 43oh members to design their own.  Look out for new resources available at www.ti.com/byob in the coming months.
2.
This isn't my work, it is 99.9% from the libfixmath library found at http://code.google.com/p/libfixmath/  I have just made very minor alterations by putting some necessary #define's into fix16.h to allow it to compile on Energia (the standard library requires -D compiler options), and added a pow() function.
While working on an altimeter project, I needed to convert barometer pressure to altitude which required quite a bit of floating point math.  On small microcontrollers, floating point is typically bad to use - it is expensive in both code size, and execution time. In my case, I was having difficulty getting my code to fit into the 16k on the 2553. For simple mathematic functions, you can often avoid floating point and get by with integers. But with the need to raise numbers to the power of 1/5.257, pure integer math was out of the question for my needs.  I was having difficulty getting my code to fit into the 16k on the 2553. Even a very simple sketch that just did a calculation of the barometric formula (without any code to read from the barometer IC or output the display in readable form) ran to over 6k.

Enter this library which uses a fixed 16.16 format number held as a 32bit signed long, as a compromise between floating point & integer math.  Internally, this allows it to use pure integer math resulting in higher speed and smaller code size.  Using this library, my basic sketch to calculate the barometric formula dropped from over 6k in size to about 2.5k.

Compared to floating point there are still some limitations - the maximum number is +/-32,767.9999... so there may be some instances where you need to divide your numbers to ensure you don't overflow. Also the precision isn't as good as a float, but for most needs it should work fine as a good lean alternative to pure floating point.  In my case, the altitude error compared to pure floating point was in the order of 0.001m - the barometer is not nearly that accurate so errors introduced by the maths were insignificant.

Documentation is available at the original source website, along with examples, although the examples are not 430 compatible.  The attached library will compile as-is for the 430 platform. I haven't tested it on Stellaris, but there is no reason it shouldn't also work. On Stellaris you may want to experiment with the #defines in the fix16.h file. Because the Stellaris is 32bit you can definitely take out FIXMATH_OPTIMISE_8BIT which will increase performance.
libfixmath.zip
3.
Hello!

This is my project Real Time Clock. The project used RTC module ds1394, temperature sensor ds18b20 and driver 7-segment display tm1638. msp430g2553 MCU integrates devices with two hardware ports SPI (USART1, USART2).
Clock Functions:- Showing the time, date, day of the week;
- Set the alarm;
- Shows the temperature of the sensor ds18b20;
- Control the brightness of the indicator.

Video:

Russian description
Source code

Video:

My project site

Project includes:
- ds18b20 maxim + msp430 launchpad
- Library for TM1638 to MSP430

PS: my son was born! Now I do not know whether the time to continue the projects. I hope that I can find the time to do a good description of the projects.

PPS: Sorry for my english...
4.
Just saw this from IRC-

A cheap chinese hardware module incorporating the TI CC2540 Bluetooth Low-Energy chipset for \$6.50/piece.  Not bad!

5.

Feels more like a preorder - I'm in.

Have fun,
Stephan
6.
Hi.

Finally I decided to say a word or two about a project I am currently working on. While this is nothing innovative or really impressive, this is my first invention that actually can be used for something.

This is a MP3 player, with colour LCD screen and touchpanel. I also hope to add some features that an iPod or something like don't have, for example serial console, or AVR programmer.

I have made something like a Booster Pack to connect elements together. While this is a perfboard with a lot of cables, and it looks ugly, it works and I can even say it is portable. I would like to make a real Booster Pack with everything needed, but I have no experience in etching PCBs yet.

My board connects the Launchpad with LCD screen and VS1003b board(which is responsible for sound and MP3/WMA decoding in my project). It also has SD card socket.

I dream of final device with rechargeable battery, VS1053/1063 for FLAC and OGG playback, and a RTC, all enclosed in a nice case.

Now, about the software. I am writing it in Energia IDE, but avoid using things like digitalWrite in parts of code where speed is important. For SD card, I use the FatFs library, the files that I posted before. The code may be a big mess, but it somehow works. Here is the list of what it currently has:
A simple menu to select "apps" Screen calibration. Data is stored in EEPROM so don't run my code without modifications if you own the revision of LM4F120 which stops working after EEPROM write attempt. The calibration algorithm is not very smart. The file selector used in below functions. This currently does not check extensions! Picture viewer. Currently it supports only RAW RGB565 bitmaps and it assumes they are 240x320. Support for BMP is coming, and maybe even some JPEG decoding if I finally understand how picoJPEG works. "Slide" is also RAW picture viewer, but it takes longer images(width 240, height longer than 320) and lets user scroll through the image with touch. It uses LCD's ability to do hardware scrolling and this feature looks nice. Code, however is not perfect and there is a bug which I am trying to fix. Minipaint lets user paint on the screen. This is meant for touch panel testing. But if I add saving feature, this may become more useful. Audio player. It plays MP3, WAV and WMA files. If VS1053 was used instead of VS1003b, also FLAC and OGG would be supported. It shows artist and title from ID3 tag, and also bitrate of MP3 and WMA files. Module player. This is ported from PIC32, the same code was used in Stellaris Mod Player presented there some time ago. But I am using the VS1003b for audio output and not PWM. The player needs optimization. It needs a lot of memory for buffers. With current settings I can play some of my mods, but 4 channel mods with large samples don't play properly. With larger buffer and maximum of 4 channels I can play all my 4 channel mods perfectly, but no mods with larger number of channels are supported. I am going to try putting also S3M playback. I think about making the buffers dynamically allocated, so they won't use RAM when MOD player is not in use. Plasma effect. It displays animated plasma, like in old classic intros. I attached some pictures of the thing. I put that piece of plastic on the Launchpad to diffuse LED lights. They are nasty, aren't they? Also, all my code is available if anybody wants to look at all the mess:
https://github.com/szymekrak/mp3thing

I look forward for any opinions and even criticism. I know everything is far from perfection. I would be pleased for any help and advice

I am also sorry if there were any mistakes in my English as this is not my native language.

7. gmtii got a reaction from lssyczy in [Energia Library] ILI9341 TFT 2.2 port
hi,

I've ported the Seeed library for cheap ebay 2.2 inch ILI9341 displays (only tested on Stellaris),

http://www.ebay.com/itm/1PC-2-2-Inch-SPI-TFT-LCD-Serial-Port-Module-Display-ILI9341-5V-3-3V-New-/200948143239?pt=Cake_Decorating_Supplies&hash=item2ec9715487

https://github.com/gmtii/ILI9341_energia

Saludos!

8. gmtii got a reaction from energia in [Energia Library] ILI9341 TFT 2.2 port
hi,

I've ported the Seeed library for cheap ebay 2.2 inch ILI9341 displays (only tested on Stellaris),

http://www.ebay.com/itm/1PC-2-2-Inch-SPI-TFT-LCD-Serial-Port-Module-Display-ILI9341-5V-3-3V-New-/200948143239?pt=Cake_Decorating_Supplies&hash=item2ec9715487

https://github.com/gmtii/ILI9341_energia

Saludos!

9. gmtii reacted to JWoodrell in Coders needed - Free Hardware
I have done some industrial control design work in the past and could give a good shot at putting something together for them.  I only have 68 right now, but have an interesting skill set

I am officially throwing my name into the hat, for what its worth

List:
1. RobG
2. GWDeveloper
3. JWoodrell
10.
Energia library for using Nordic Semiconductor's nRF24L01+ transceivers
Alternative to the Mirf library.

This is now cross-platform thanks to @L293D 's work.

Main thread is over at 43oh - http://forum.43oh.com/topic/3237-energia-library-nordic-nrf24l01-library/

Release v1.5 supporting the Stellaris LaunchPad:
Enrf24_v1_5.zip
11.
Hello all!

I've got three new libraries to share with you!

They are:

An Arduino "Servo" library clone (StellarPad):

Duplicates all of the functionality of the Arduino "Servo" library. Fully compatible with all existing sketches that use the Arduino "Servo" library. Based upon the Eigendreams servo library posted here a while back. Supports 8 servos as-is. Can be modified to do a heck of a lot more, but that is up to you to incorporate (at least for now -- update to come soon).

An ultrasonic rangefinder library (StellarPad, easily modifiable to work with other Energia devices):

Designed for the HC-SR04 rangefinder, about \$5 on e-bay. Should also work with some other rangefinders, but I have not tested any others. That is, again, up to you (for now). Supports as many of them as you can fit on your I/O.

A data smoother library (All Energia/Arduino supported devices):

Inspired by the Arduino "smoothing" example by Tom Igoe. Allows the creation of "Smoother" objects that calculate running averages of raw data. "Smoother" is a template class and can be instantiated to work with int's, float's, long's, etc.

All three libraries have their own examples, and the following is an example that incorporates the functionality of all of them (No comments, sorry! This one is pretty self-explanatory. See the library-specific examples for more details):
#include <SonicRanger.h> #include <Smoother.h> #include <Servo.h> SonicRanger sr; Servo servo; Smoother<int, 10> ssmoother; boolean smoothing = false; void setup () { sr.attach(PE_1, PE_2); servo.attach(PF_1); pinMode(BLUE_LED, OUTPUT); digitalWrite(BLUE_LED, LOW); pinMode(PUSH2, INPUT); attachInterrupt(PUSH2, buttonISR, FALLING); } void loop () { float distance = sr.getDistance(INCHES); int processedDistance; if(distance > 0) { processedDistance = (int)(distance * 1000); processedDistance = constrain(processedDistance, 2000, 12000); if(smoothing) { ssmoother.pushValue(processedDistance); processedDistance = ssmoother.pullValue(); } servo.write(map(processedDistance, 2000, 12000, 0, 180)); } delay(50); } void buttonISR () { smoothing = !smoothing; digitalWrite(BLUE_LED, smoothing); } Video demonstration of the above example sketch:

http://youtu.be/IViqIa4Rl9Y

Enjoy!

-K/Fughilli
SonicRanger.zip
Smoother.zip
Servo.zip
12. gmtii got a reaction from RobG in 2.2" Color LCD Booster Pack with Touch
Hi, After some bad experience with my last group buy (lost package...), this one has been really great.. fast delivery and gorgeous lcd & library. thank you very much!

13. gmtii got a reaction from SugarAddict in 7110 LCD SPI
5110 nokia lcd version:

* * 5110LCD.h * * Created on: Oct 16, 2012 * Author: SugarAddict */ #ifndef __5110LCD_H__ #define __5110LCD_H__ #define LCD_WIDTH 84 #define LCD_HEIGHT 48 void LCDSend(unsigned long ulData); void LCDInit(); void LCDGotoXY(short col, short row); void LCDClearRow(short row); void LCDCLS(); const unsigned char table [][5] = { {0x00, 0x00, 0x00, 0x00, 0x00}// (space) ,{0x00, 0x00, 0x5F, 0x00, 0x00}// ! ,{0x00, 0x07, 0x00, 0x07, 0x00}// " ,{0x14, 0x7F, 0x14, 0x7F, 0x14}// # ,{0x24, 0x2A, 0x7F, 0x2A, 0x12}// \$ ,{0x23, 0x13, 0x08, 0x64, 0x62}// % ,{0x36, 0x49, 0x55, 0x22, 0x50}// & ,{0x00, 0x05, 0x03, 0x00, 0x00}// ' ,{0x00, 0x1C, 0x22, 0x41, 0x00}// ( ,{0x00, 0x41, 0x22, 0x1C, 0x00}// ) ,{0x08, 0x2A, 0x1C, 0x2A, 0x08}// * ,{0x08, 0x08, 0x3E, 0x08, 0x08}// + ,{0x00, 0x50, 0x30, 0x00, 0x00}// , ,{0x08, 0x08, 0x08, 0x08, 0x08}// - ,{0x00, 0x60, 0x60, 0x00, 0x00}// . ,{0x20, 0x10, 0x08, 0x04, 0x02}// / ,{0x3E, 0x51, 0x49, 0x45, 0x3E}// 0 ,{0x00, 0x42, 0x7F, 0x40, 0x00}// 1 ,{0x42, 0x61, 0x51, 0x49, 0x46}// 2 ,{0x21, 0x41, 0x45, 0x4B, 0x31}// 3 ,{0x18, 0x14, 0x12, 0x7F, 0x10}// 4 ,{0x27, 0x45, 0x45, 0x45, 0x39}// 5 ,{0x3C, 0x4A, 0x49, 0x49, 0x30}// 6 ,{0x01, 0x71, 0x09, 0x05, 0x03}// 7 ,{0x36, 0x49, 0x49, 0x49, 0x36}// 8 ,{0x06, 0x49, 0x49, 0x29, 0x1E}// 9 ,{0x00, 0x36, 0x36, 0x00, 0x00}// : ,{0x00, 0x56, 0x36, 0x00, 0x00}// ; ,{0x00, 0x08, 0x14, 0x22, 0x41}// < ,{0x14, 0x14, 0x14, 0x14, 0x14}// = ,{0x41, 0x22, 0x14, 0x08, 0x00}// > ,{0x02, 0x01, 0x51, 0x09, 0x06}// ? ,{0x32, 0x49, 0x79, 0x41, 0x3E}// @ ,{0x7E, 0x11, 0x11, 0x11, 0x7E}// A ,{0x7F, 0x49, 0x49, 0x49, 0x36}// B ,{0x3E, 0x41, 0x41, 0x41, 0x22}// C ,{0x7F, 0x41, 0x41, 0x22, 0x1C}// D ,{0x7F, 0x49, 0x49, 0x49, 0x41}// E ,{0x7F, 0x09, 0x09, 0x01, 0x01}// F ,{0x3E, 0x41, 0x41, 0x51, 0x32}// G ,{0x7F, 0x08, 0x08, 0x08, 0x7F}// H ,{0x00, 0x41, 0x7F, 0x41, 0x00}// I ,{0x20, 0x40, 0x41, 0x3F, 0x01}// J ,{0x7F, 0x08, 0x14, 0x22, 0x41}// K ,{0x7F, 0x40, 0x40, 0x40, 0x40}// L ,{0x7F, 0x02, 0x04, 0x02, 0x7F}// M ,{0x7F, 0x04, 0x08, 0x10, 0x7F}// N ,{0x3E, 0x41, 0x41, 0x41, 0x3E}// O ,{0x7F, 0x09, 0x09, 0x09, 0x06}// P ,{0x3E, 0x41, 0x51, 0x21, 0x5E}// Q ,{0x7F, 0x09, 0x19, 0x29, 0x46}// R ,{0x46, 0x49, 0x49, 0x49, 0x31}// S ,{0x01, 0x01, 0x7F, 0x01, 0x01}// T ,{0x3F, 0x40, 0x40, 0x40, 0x3F}// U ,{0x1F, 0x20, 0x40, 0x20, 0x1F}// V ,{0x7F, 0x20, 0x18, 0x20, 0x7F}// W ,{0x63, 0x14, 0x08, 0x14, 0x63}// X ,{0x03, 0x04, 0x78, 0x04, 0x03}// Y ,{0x61, 0x51, 0x49, 0x45, 0x43}// Z ,{0x00, 0x00, 0x7F, 0x41, 0x41}// [ ,{0x02, 0x04, 0x08, 0x10, 0x20}// "\" ,{0x41, 0x41, 0x7F, 0x00, 0x00}// ] ,{0x04, 0x02, 0x01, 0x02, 0x04}// ^ ,{0x40, 0x40, 0x40, 0x40, 0x40}// _ ,{0x00, 0x01, 0x02, 0x04, 0x00}// ` ,{0x20, 0x54, 0x54, 0x54, 0x78}// a ,{0x7F, 0x48, 0x44, 0x44, 0x38}// b ,{0x38, 0x44, 0x44, 0x44, 0x20}// c ,{0x38, 0x44, 0x44, 0x48, 0x7F}// d ,{0x38, 0x54, 0x54, 0x54, 0x18}// e ,{0x08, 0x7E, 0x09, 0x01, 0x02}// f ,{0x08, 0x14, 0x54, 0x54, 0x3C}// g ,{0x7F, 0x08, 0x04, 0x04, 0x78}// h ,{0x00, 0x44, 0x7D, 0x40, 0x00}// i ,{0x20, 0x40, 0x44, 0x3D, 0x00}// j ,{0x00, 0x7F, 0x10, 0x28, 0x44}// k ,{0x00, 0x41, 0x7F, 0x40, 0x00}// l ,{0x7C, 0x04, 0x18, 0x04, 0x78}// m ,{0x7C, 0x08, 0x04, 0x04, 0x78}// n ,{0x38, 0x44, 0x44, 0x44, 0x38}// o ,{0x7C, 0x14, 0x14, 0x14, 0x08}// p ,{0x08, 0x14, 0x14, 0x18, 0x7C}// q ,{0x7C, 0x08, 0x04, 0x04, 0x08}// r ,{0x48, 0x54, 0x54, 0x54, 0x20}// s ,{0x04, 0x3F, 0x44, 0x40, 0x20}// t ,{0x3C, 0x40, 0x40, 0x20, 0x7C}// u ,{0x1C, 0x20, 0x40, 0x20, 0x1C}// v ,{0x3C, 0x40, 0x30, 0x40, 0x3C}// w ,{0x44, 0x28, 0x10, 0x28, 0x44}// x ,{0x0C, 0x50, 0x50, 0x50, 0x3C}// y ,{0x44, 0x64, 0x54, 0x4C, 0x44}// z ,{0x00, 0x08, 0x36, 0x41, 0x00}// { ,{0x00, 0x00, 0x7F, 0x00, 0x00}// | ,{0x00, 0x41, 0x36, 0x08, 0x00}// } ,{0x08, 0x08, 0x2A, 0x1C, 0x08}// -> ,{0x08, 0x1C, 0x2A, 0x08, 0x08} // <- }; void LCDSend(unsigned long ulData) { GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_1, 0x00); // CS LOW SSIDataPut(SSI2_BASE,ulData); while(SSIBusy(SSI2_BASE)) { //kill time } GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_1, 0x02); // CS HIGH } void LCDInit() { // Initially only Reset High GPIOPinWrite(GPIO_PORTB_BASE, (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2), 0x01); SysCtlDelay(100); // Set all High GPIOPinWrite(GPIO_PORTB_BASE, (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2), 0x07); SysCtlDelay(100); // Reset Low GPIOPinWrite(GPIO_PORTB_BASE, (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2), 0x06); SysCtlDelay(100); // Reset High GPIOPinWrite(GPIO_PORTB_BASE, (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2), 0x07); SysCtlDelay(100); // Command Low GPIOPinWrite(GPIO_PORTB_BASE, (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2), 0x03); SysCtlDelay(100); LCDSend(0x21); // Function set - extended instructions enabled //LCDSend(0x21); // Set vop (contrast) 0 - 127 LCDSend(0xE6); // This is better for fast LCD update LCDSend(0x06); // Temperature control LCDSend(0x13); // Set bias system LCDSend(0x20); // Function set - chip active, horizontal addressing, basic instructions LCDSend(0x0C); // Display control - normal mode // Data High GPIOPinWrite(GPIO_PORTB_BASE, (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2), 0x07); } void LCDGotoXY(short col, short row) { GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_2, 0x00); // Command Low LCDSend(0x80+col); //col += 18; //LCDSend(0x40+(col>>4)); // column address //LCDSend(0x00+(col&0x0F)); LCDSend(0x40+row); GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_2, 0x04); // Data High } void LCDClearRow(short row) { short i = 0; LCDGotoXY(0, row); for(i=0;i<LCD_WIDTH;i++) LCDSend(0x00); } void LCDCLS() { short i = 0; for(i=0;i<=(LCD_HEIGHT/8);i++) LCDClearRow(i); } void LCDSendChar(char cChar) { LCDSend(table[cChar-32][0]); LCDSend(table[cChar-32][1]); LCDSend(table[cChar-32][2]); LCDSend(table[cChar-32][3]); LCDSend(table[cChar-32][4]); LCDSend(0x00); } #endif /* 5110LCD_H_ */
14. gmtii got a reaction from bluehash in 7110 LCD SPI
5110 nokia lcd version:

* * 5110LCD.h * * Created on: Oct 16, 2012 * Author: SugarAddict */ #ifndef __5110LCD_H__ #define __5110LCD_H__ #define LCD_WIDTH 84 #define LCD_HEIGHT 48 void LCDSend(unsigned long ulData); void LCDInit(); void LCDGotoXY(short col, short row); void LCDClearRow(short row); void LCDCLS(); const unsigned char table [][5] = { {0x00, 0x00, 0x00, 0x00, 0x00}// (space) ,{0x00, 0x00, 0x5F, 0x00, 0x00}// ! ,{0x00, 0x07, 0x00, 0x07, 0x00}// " ,{0x14, 0x7F, 0x14, 0x7F, 0x14}// # ,{0x24, 0x2A, 0x7F, 0x2A, 0x12}// \$ ,{0x23, 0x13, 0x08, 0x64, 0x62}// % ,{0x36, 0x49, 0x55, 0x22, 0x50}// & ,{0x00, 0x05, 0x03, 0x00, 0x00}// ' ,{0x00, 0x1C, 0x22, 0x41, 0x00}// ( ,{0x00, 0x41, 0x22, 0x1C, 0x00}// ) ,{0x08, 0x2A, 0x1C, 0x2A, 0x08}// * ,{0x08, 0x08, 0x3E, 0x08, 0x08}// + ,{0x00, 0x50, 0x30, 0x00, 0x00}// , ,{0x08, 0x08, 0x08, 0x08, 0x08}// - ,{0x00, 0x60, 0x60, 0x00, 0x00}// . ,{0x20, 0x10, 0x08, 0x04, 0x02}// / ,{0x3E, 0x51, 0x49, 0x45, 0x3E}// 0 ,{0x00, 0x42, 0x7F, 0x40, 0x00}// 1 ,{0x42, 0x61, 0x51, 0x49, 0x46}// 2 ,{0x21, 0x41, 0x45, 0x4B, 0x31}// 3 ,{0x18, 0x14, 0x12, 0x7F, 0x10}// 4 ,{0x27, 0x45, 0x45, 0x45, 0x39}// 5 ,{0x3C, 0x4A, 0x49, 0x49, 0x30}// 6 ,{0x01, 0x71, 0x09, 0x05, 0x03}// 7 ,{0x36, 0x49, 0x49, 0x49, 0x36}// 8 ,{0x06, 0x49, 0x49, 0x29, 0x1E}// 9 ,{0x00, 0x36, 0x36, 0x00, 0x00}// : ,{0x00, 0x56, 0x36, 0x00, 0x00}// ; ,{0x00, 0x08, 0x14, 0x22, 0x41}// < ,{0x14, 0x14, 0x14, 0x14, 0x14}// = ,{0x41, 0x22, 0x14, 0x08, 0x00}// > ,{0x02, 0x01, 0x51, 0x09, 0x06}// ? ,{0x32, 0x49, 0x79, 0x41, 0x3E}// @ ,{0x7E, 0x11, 0x11, 0x11, 0x7E}// A ,{0x7F, 0x49, 0x49, 0x49, 0x36}// B ,{0x3E, 0x41, 0x41, 0x41, 0x22}// C ,{0x7F, 0x41, 0x41, 0x22, 0x1C}// D ,{0x7F, 0x49, 0x49, 0x49, 0x41}// E ,{0x7F, 0x09, 0x09, 0x01, 0x01}// F ,{0x3E, 0x41, 0x41, 0x51, 0x32}// G ,{0x7F, 0x08, 0x08, 0x08, 0x7F}// H ,{0x00, 0x41, 0x7F, 0x41, 0x00}// I ,{0x20, 0x40, 0x41, 0x3F, 0x01}// J ,{0x7F, 0x08, 0x14, 0x22, 0x41}// K ,{0x7F, 0x40, 0x40, 0x40, 0x40}// L ,{0x7F, 0x02, 0x04, 0x02, 0x7F}// M ,{0x7F, 0x04, 0x08, 0x10, 0x7F}// N ,{0x3E, 0x41, 0x41, 0x41, 0x3E}// O ,{0x7F, 0x09, 0x09, 0x09, 0x06}// P ,{0x3E, 0x41, 0x51, 0x21, 0x5E}// Q ,{0x7F, 0x09, 0x19, 0x29, 0x46}// R ,{0x46, 0x49, 0x49, 0x49, 0x31}// S ,{0x01, 0x01, 0x7F, 0x01, 0x01}// T ,{0x3F, 0x40, 0x40, 0x40, 0x3F}// U ,{0x1F, 0x20, 0x40, 0x20, 0x1F}// V ,{0x7F, 0x20, 0x18, 0x20, 0x7F}// W ,{0x63, 0x14, 0x08, 0x14, 0x63}// X ,{0x03, 0x04, 0x78, 0x04, 0x03}// Y ,{0x61, 0x51, 0x49, 0x45, 0x43}// Z ,{0x00, 0x00, 0x7F, 0x41, 0x41}// [ ,{0x02, 0x04, 0x08, 0x10, 0x20}// "\" ,{0x41, 0x41, 0x7F, 0x00, 0x00}// ] ,{0x04, 0x02, 0x01, 0x02, 0x04}// ^ ,{0x40, 0x40, 0x40, 0x40, 0x40}// _ ,{0x00, 0x01, 0x02, 0x04, 0x00}// ` ,{0x20, 0x54, 0x54, 0x54, 0x78}// a ,{0x7F, 0x48, 0x44, 0x44, 0x38}// b ,{0x38, 0x44, 0x44, 0x44, 0x20}// c ,{0x38, 0x44, 0x44, 0x48, 0x7F}// d ,{0x38, 0x54, 0x54, 0x54, 0x18}// e ,{0x08, 0x7E, 0x09, 0x01, 0x02}// f ,{0x08, 0x14, 0x54, 0x54, 0x3C}// g ,{0x7F, 0x08, 0x04, 0x04, 0x78}// h ,{0x00, 0x44, 0x7D, 0x40, 0x00}// i ,{0x20, 0x40, 0x44, 0x3D, 0x00}// j ,{0x00, 0x7F, 0x10, 0x28, 0x44}// k ,{0x00, 0x41, 0x7F, 0x40, 0x00}// l ,{0x7C, 0x04, 0x18, 0x04, 0x78}// m ,{0x7C, 0x08, 0x04, 0x04, 0x78}// n ,{0x38, 0x44, 0x44, 0x44, 0x38}// o ,{0x7C, 0x14, 0x14, 0x14, 0x08}// p ,{0x08, 0x14, 0x14, 0x18, 0x7C}// q ,{0x7C, 0x08, 0x04, 0x04, 0x08}// r ,{0x48, 0x54, 0x54, 0x54, 0x20}// s ,{0x04, 0x3F, 0x44, 0x40, 0x20}// t ,{0x3C, 0x40, 0x40, 0x20, 0x7C}// u ,{0x1C, 0x20, 0x40, 0x20, 0x1C}// v ,{0x3C, 0x40, 0x30, 0x40, 0x3C}// w ,{0x44, 0x28, 0x10, 0x28, 0x44}// x ,{0x0C, 0x50, 0x50, 0x50, 0x3C}// y ,{0x44, 0x64, 0x54, 0x4C, 0x44}// z ,{0x00, 0x08, 0x36, 0x41, 0x00}// { ,{0x00, 0x00, 0x7F, 0x00, 0x00}// | ,{0x00, 0x41, 0x36, 0x08, 0x00}// } ,{0x08, 0x08, 0x2A, 0x1C, 0x08}// -> ,{0x08, 0x1C, 0x2A, 0x08, 0x08} // <- }; void LCDSend(unsigned long ulData) { GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_1, 0x00); // CS LOW SSIDataPut(SSI2_BASE,ulData); while(SSIBusy(SSI2_BASE)) { //kill time } GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_1, 0x02); // CS HIGH } void LCDInit() { // Initially only Reset High GPIOPinWrite(GPIO_PORTB_BASE, (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2), 0x01); SysCtlDelay(100); // Set all High GPIOPinWrite(GPIO_PORTB_BASE, (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2), 0x07); SysCtlDelay(100); // Reset Low GPIOPinWrite(GPIO_PORTB_BASE, (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2), 0x06); SysCtlDelay(100); // Reset High GPIOPinWrite(GPIO_PORTB_BASE, (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2), 0x07); SysCtlDelay(100); // Command Low GPIOPinWrite(GPIO_PORTB_BASE, (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2), 0x03); SysCtlDelay(100); LCDSend(0x21); // Function set - extended instructions enabled //LCDSend(0x21); // Set vop (contrast) 0 - 127 LCDSend(0xE6); // This is better for fast LCD update LCDSend(0x06); // Temperature control LCDSend(0x13); // Set bias system LCDSend(0x20); // Function set - chip active, horizontal addressing, basic instructions LCDSend(0x0C); // Display control - normal mode // Data High GPIOPinWrite(GPIO_PORTB_BASE, (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2), 0x07); } void LCDGotoXY(short col, short row) { GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_2, 0x00); // Command Low LCDSend(0x80+col); //col += 18; //LCDSend(0x40+(col>>4)); // column address //LCDSend(0x00+(col&0x0F)); LCDSend(0x40+row); GPIOPinWrite(GPIO_PORTB_BASE, GPIO_PIN_2, 0x04); // Data High } void LCDClearRow(short row) { short i = 0; LCDGotoXY(0, row); for(i=0;i<LCD_WIDTH;i++) LCDSend(0x00); } void LCDCLS() { short i = 0; for(i=0;i<=(LCD_HEIGHT/8);i++) LCDClearRow(i); } void LCDSendChar(char cChar) { LCDSend(table[cChar-32][0]); LCDSend(table[cChar-32][1]); LCDSend(table[cChar-32][2]); LCDSend(table[cChar-32][3]); LCDSend(table[cChar-32][4]); LCDSend(0x00); } #endif /* 5110LCD_H_ */
×
• Blog

• #### Activity

×
• Create New...