Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases

help with PIC 16f88 software

Discussion about LCD's and other related hardware

Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo, Fast351, hydrolisk1792

Post Reply
sponder
Posts: 3
Joined: June 19th, 2011, 6:06 pm

help with PIC 16f88 software

Post by sponder »

Hi,

I’m new here, so let me give you guys a little background:
With no electronics background / experience, I bought myself a book about microprocessors and a programmer. (Let’s get to work! :) )
After doing quite a few chapters in the book, I felt confidence enough to grab a breadboard, put a “left over from a another project” pic on it (the 16f88) and connected a LCD to it (44708 controller 2x20 chars).
And before I knew it, I was reading a analog signal from a pot, using the converted digital value to drive the PWM based backlight of the LCD. (+showing the digital value on line 1 and a bar progress on line 2 on the lcd)
I created that software using JAL (don’t know if anyone ever heard of this?)
Next I wanted to see if I could connect the pic to my com port, so I grabbed the book and datasheet, looked up how a max232 chip should be connected, and built the connection. After adding a few lines to the script the values of the pot came flying on to my terminal screen! So far this all was surprisingly simple. (would have expected it to be more difficult)
Anyway, around this time I found this site, and I would love to use LCD smartie on the LCD I built. Once it is working, I’m thinking about getting the circuit off the breadboard, on to a (diy) pcb for a more permanent solution.
But, I’m hitting a brick wall in the process. (this is where it all suddenly ceased to be simple... :cry: )
I don’t really know how to “drive” the incoming signal from the pc to the LCD as output. (software in the pic)
I didn’t expect to find a fully functional hex code for my chip or something, but after a few days of google-ing, I even can’t find any examples to get me started.
There are examples available in JAL, as well as MPLAB, but those examples are either for the rs232 connection, or connecting the LCD, but no hints how to use them both together.

Could you guys help me out getting back on track with this?
Offcourse I’m not asking “please write this software for me..” but at the moment i’m simply a bit overwhelmed with the learning curve, and I don’t know where to go from here.
I have a feeling I did come a long way (at least, lcd and rs232 connection are both working)
I also read that someone people are emulating a Matrix Orbital LCD with a pic. Is this something I can do with that 16f88?

Any advice where to go from here?
Many thanks in advance!
(if more info is required, please let me know..)

mattcro
Forum Supporter
Posts: 590
Joined: March 8th, 2006, 1:58 pm
Location: Scotland

Re: help with PIC 16f88 software

Post by mattcro »

It sounds like you're progressing pretty well for someone new to all this!

You can do this relatively easily with a PIC. The basic Matrix Orbital (MO) command set is fairly simple to implement. You can also do a very basic system that implements the native LCD commands on a serial interface (Seetron made a "backpack" that does this).

I developed a MO compatible backpack (adapter interface) with a PIC16F628 a while ago and still use it. See the details and get source files here: http://forums.lcdsmartie.org/viewtopic.php?f=11&t=501 The MO protocol is natively supported by Smartie.

I've never used JAL but you may be able to adapt my C source code to JAL (Java?). my code was developed only from the MO datasheets, which have lots of detail about the command set. You might need to study the datasheets for a few different displays to get all the features like backlight control, button reading etc.

Before my MO project I developed a very simple serial-to-HD44780 LCD adapter based on Seetron's product http://www.seetron.com/bpk000.html , again just from reading the datasheets. I think this one is supported in Smartie with a native driver. I don't have source code from this handy - again it was in C on a PIC.

If you're into reverse engineering, you can try the Seetron protocol since it's so simple. MO is a bit more complex, but you can use my code as a starting point, and there must be plenty of other implementations too. There are a few other PIC and AVR projects on this forum too: http://forums.lcdsmartie.org/search.php ... mit=Search

sponder
Posts: 3
Joined: June 19th, 2011, 6:06 pm

Re: help with PIC 16f88 software

Post by sponder »

mattcro wrote:It sounds like you're progressing pretty well for someone new to all this!
Thanks to the book to be honest! im no wonder kid or something. :smt002
mattcro wrote: You can do this relatively easily with a PIC. The basic Matrix Orbital (MO) command set is fairly simple to implement. You can also do a very basic system that implements the native LCD commands on a serial interface (Seetron made a "backpack" that does this).

I developed a MO compatible backpack (adapter interface) with a PIC16F628 a while ago and still use it. See the details and get source files here: http://forums.lcdsmartie.org/viewtopic.php?f=11&t=501 The MO protocol is natively supported by Smartie.

but you can use my code as a starting point, and there must be plenty of other implementations too. There are a few other PIC and AVR projects on this forum too: http://forums.lcdsmartie.org/search.php ... mit=Search
Jal ((not)Just Another Language) is a higher language because Wouter van Ooijen didn't like excisting ones. it's widely used and a lot simpler than c. Might be worth looking into if you're intrested.
I don't know any c, but i think your code will be a nice starting point for that as well!

again, thanks!

sponder
Posts: 3
Joined: June 19th, 2011, 6:06 pm

Re: help with PIC 16f88 software

Post by sponder »

Here's an update for the ones who are intrested:
I just puzzled my way through the JAL code to the point where it's working! :lol:
It's a pretty crude version though, no button support yet, some OM commands are not working as they should (yet to be looked at), and some are yet to be translated, but the firmware on the chip seems to spit out everything to the LCD whatever LCD Smartie throws at it! 8)
So thanks again to Matt who put me on the right track to get things going!

If there is any interest, i can share the source and datails i have so far, so others can benfit / test, let me know if you guys want it.


Sander.

LQd
Posts: 4
Joined: December 19th, 2011, 10:26 am
Location: Slovakia

Re: help with PIC 16f88 software

Post by LQd »

Hallo to all!
I am trying to build my own "backpack" based on Atmel chips, in this state it is working quite good now, but it is "simplest" version. I would like to support full protocol including custom characters, eventually buttons and so, but I hit a problem. I have tried to write support for Seetron protocol, because it is so simple and I like it, but on Seetron web I found two different descriptions of protocol and sniffing data from Smartie resulted to third different (but not complete) description. And also with Matrix Orbital it is not so clear to me.
Please, could someone be so kind and point me to some specs compatible with Smartie's ddls? Thank you very much in advance.

mattcro
Forum Supporter
Posts: 590
Joined: March 8th, 2006, 1:58 pm
Location: Scotland

Re: help with PIC 16f88 software

Post by mattcro »

What programming language do you use for Atmel chips? Are you using AVR devices?

If you know or are programming in C, then take a look at the source code for my PIC backpack project for some useful ideas on the Matrix Orbital protocol. I reverse engineered it from several MO LCD datasheets ages ago. See http://forums.lcdsmartie.org/viewtopic.php?f=11&t=501 for details and download.

LQd
Posts: 4
Joined: December 19th, 2011, 10:26 am
Location: Slovakia

Re: help with PIC 16f88 software

Post by LQd »

Thank you, I will try that.

Currently I am mainly programming AVRs in MikroBASIC, but for this project I have decided to use AT89C2051 which is 8051 architecture, programmed in the same language. Few of these are left from older project an they are just fit hardware needs (at least to this time, if I run out of RAM (only few bytes left :D ) then I will move to ATmega8 probably).

mattcro
Forum Supporter
Posts: 590
Joined: March 8th, 2006, 1:58 pm
Location: Scotland

Re: help with PIC 16f88 software

Post by mattcro »

I used to program PICs in HiTech C back when I did my backpack, but now at work I use AVR ATmega devices with Bascom, a reasonable hobby/commercial BASIC compiler. There's a free demo version that will compile up to 4KB of program code, and that's enough for many small hobby projects.

Post Reply