1st project issue/LED-LCD

Forum for problems or queries regarding other Flowcode Components. Eg LEDs, Switches, LCD, Gfx LCD etc

Moderators: Benj, Mods

User avatar
Steve
Matrix Staff
Posts: 3424
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: 1st project issue/LED-LCD

Post by Steve »

If you post a list of the required connections to your PICmicro, I'll write a simple program using the inetrnal oscillator for you.

boa279
Posts: 38
Joined: Mon Sep 15, 2008 11:47 pm
Contact:

Re: 1st project issue/LED-LCD

Post by boa279 »

Here is a schematic...is this at least correct?
Attachments
16f88 schematic
16f88 schematic
schematic.JPG (34.68 KiB) Viewed 13543 times

User avatar
Steve
Matrix Staff
Posts: 3424
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: 1st project issue/LED-LCD

Post by Steve »

Sorry, but I don't know if that is wired correctly because I know nothing about the LCD module you are using.

If you just give me a list which says which pins of the '88 are connected to which pins of the LCD (e.g. A0 <-> RS), I'll write a quick sample porgram that should work for your hardware.

boa279
Posts: 38
Joined: Mon Sep 15, 2008 11:47 pm
Contact:

Re: 1st project issue/LED-LCD

Post by boa279 »

Well, I started my flow code from ground zero and it works perfectly!! Don't know whats wrong with the original code but I suspect it had a lot to do with the multiple changes I made while building it. (variables that were there but not used..maybe the interupt I was using which was also a data output to lcd....stuff like that) Anyway...with the 16f88 it works perfectly when speed is set to 31250 as described here: http://www.matrixmultimedia.com/mmforum ... lit=osccon

I cannot however get it to work with the variable oscillator also described in the above link. Ive attached both versions of the flowcode. The NO_OSCCON.fcf works...The osccon.fcf does not. Can someone help me figure out what Im doing wrong? THANKS A MILLION FOR THE WONDERFUL SUPPORT!!!
Attachments
osccon.fcf
(11.5 KiB) Downloaded 331 times
NO_OSCCON.fcf
(11 KiB) Downloaded 325 times

User avatar
Steve
Matrix Staff
Posts: 3424
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: 1st project issue/LED-LCD

Post by Steve »

I've downloaded and tried both of these programs and they both seem to work fine (at least the LCD is displaying correctly).

Could you also post the C and HEX files for both of these programs - this may help troubleshoot the problem.

boa279
Posts: 38
Joined: Mon Sep 15, 2008 11:47 pm
Contact:

Re: 1st project issue/LED-LCD

Post by boa279 »

steve wrote:I've downloaded and tried both of these programs and they both seem to work fine (at least the LCD is displaying correctly).

Could you also post the C and HEX files for both of these programs - this may help troubleshoot the problem.
Like I mentioned...the no-osccon file works perfectly on the breadboard but the OSCCON one does not work. I will post the C and HEX but these will be generated from flowcode correct? I will post only the OSCCON C and HEX as the other one operates correctly...just trying to speed the program up as it is a little delayed when buttons are pressed. Just to make sure...have I properly set up the osccon correctly?? Just something else wrong? THANKS!! I will try to post tonight.

User avatar
Steve
Matrix Staff
Posts: 3424
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: 1st project issue/LED-LCD

Post by Steve »

As I said, both of these programs work fine on my hardware, so there is nothing wrong with the programs. The setting of the osccon register is ok.

Perhaps the 2MHz speed is too fast for the breadboard project?

boa279
Posts: 38
Joined: Mon Sep 15, 2008 11:47 pm
Contact:

Re: 1st project issue/LED-LCD

Post by boa279 »

steve wrote:As I said, both of these programs work fine on my hardware, so there is nothing wrong with the programs. The setting of the osccon register is ok.

Perhaps the 2MHz speed is too fast for the breadboard project?
Hmmm ...I wonder why its not working on the breadboard?.? Im kind of nervous etching out a board in the hopes it will work normally when I can't test it on my breadboard. What "hardware" are you using to get it working? Eblocks? Anyway, here are the C and hex files for both programs.
Attachments
osccon.hex
(3.73 KiB) Downloaded 304 times
NO_OSCCON.c
(13.48 KiB) Downloaded 312 times
NO_OSCCON.hex
(3.78 KiB) Downloaded 319 times

boa279
Posts: 38
Joined: Mon Sep 15, 2008 11:47 pm
Contact:

Re: 1st project issue/LED-LCD

Post by boa279 »

and the last one
Attachments
osccon.c
(13.67 KiB) Downloaded 307 times

User avatar
goldwingers
Posts: 118
Joined: Wed Sep 06, 2006 1:22 pm
Location: London
Been thanked: 1 time
Contact:

Re: 1st project issue/LED-LCD

Post by goldwingers »

Hi Boa,
Is the breadboard one of those with all the pins inside and you just push in the chip...components etc, If so it could be a capacitance issue across the pins of the osc pins

Regards

Ian

boa279
Posts: 38
Joined: Mon Sep 15, 2008 11:47 pm
Contact:

Re: 1st project issue/LED-LCD

Post by boa279 »

It is one of those push pin type boards and Ive heard of the capacitance thing assosiated with these prototyping boards...what else can Iuse to test cuircuits without them? Im going to have to try something else.

User avatar
Steve
Matrix Staff
Posts: 3424
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: 1st project issue/LED-LCD

Post by Steve »

I tested it on our HP488 development board. You could use Veroboard - we generally use this for very early prototyping.

But I think I've found your problem by file-comparing your 2 C files. The LCD:Cursor commands for your 2 programs are different. The one that works prints out on lines 0 and 1. The one that doesn't work attempts to print out on lines 2 and 3. So if you are using a 2-line LCD, you will not see anything.

boa279
Posts: 38
Joined: Mon Sep 15, 2008 11:47 pm
Contact:

Re: 1st project issue/LED-LCD

Post by boa279 »

what actually happens is readable but not accurate.

Example:

Fi%sT T^Y:
Transmi@e9n

it displays crazy stuff like that over and over...the program only calls for this once but its like its resetting every second or so and repeatedly trys displaying First test, transmission over and over..buttons do nothing and every now and again it will try to display the other information like Gear: or Mode:
I have veroboard but if im going to use parts I might as well make a real deal board with my fingers crossed. Also, Ive been looking through forums trying to find out how I can set up in circuit programming. I found something that briefly described it but nothing specific. Im trying to use SOIC pics to minimize the space (I also prefer surface mount stuff anyway) and it would be awesome if I could program them on the board as their not so easy to remove when "in place" ;) Do the connections required for programming apply to all pics or is each type different? I appreciate the help and will crank out a board in the few days! THANKS!

User avatar
Steve
Matrix Staff
Posts: 3424
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: 1st project issue/LED-LCD

Post by Steve »

For in-circuit programming, just expose the following pins on your target board:
RB6
RB7
Vcc
Gnd
MCLR

If you are using the LVP capability of the chip, also expose RB3 (or whatever the LVP pin is).

This should be the same for most of the PIC16 and PIC18 chips.

xtdan
Posts: 10
Joined: Wed Jul 04, 2007 1:15 pm
Location: East Yorks
Contact:

Re: 1st project issue/LED-LCD

Post by xtdan »

Hi,

We have used several LCD modules quite successfully with Flowcode, both the character type you are using, and a graphic type.

PICs used have been 16F88, 16F877, 16F887. Main thing is don't forget not all PICs have an internal oscillator and need a xtal. (been there done that going from an 88 to an 877, very embarrassing).

We also use these graphic LCD modules in several commercial products written in assembler from pre Flowcode days, and usually get the row of black blocks when there is no comms between the module and PIC. (try powering the module without any of the I/O pins connected just Vdd Vss you should get the same effect).

We have found that veroboard (stripboard) works fine for these sort of prototypes but the plastic breadboards seem to be 'kiss of death' for PIC based prototyping.

Try veroboard and I think you'll be up and running in no time.

Dan

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 1st project issue/LED-LCD

Post by Benj »

Hello

Sounds like your internal clock speed is not configured correctly. Have a look at the device datasheet for configuring the osccon setting correctly and then match the Flowcode clock speed setting to the value you have assigned. Also the internal clock speed is a RC type and therefore is subject to change with changes in temp or pressure. Therefore it is not 100% reliable in more extreem conditions even if it is configured correctly. Remember you will need to write the osccon register right at the start of your program before the start LCD macros have been called. It is also helpful to use 2 start LCD macro calls in a row to guarentee that the LCD resets correctly, Use this only if you are having problems now and then initialising the LCD.

boa279
Posts: 38
Joined: Mon Sep 15, 2008 11:47 pm
Contact:

Re: 1st project issue/LED-LCD

Post by boa279 »

steve wrote:For in-circuit programming, just expose the following pins on your target board:
RB6
RB7
Vcc
Gnd
MCLR

If you are using the LVP capability of the chip, also expose RB3 (or whatever the LVP pin is).

This should be the same for most of the PIC16 and PIC18 chips.
Im not sure what you mean by "expose" those pins...if you mean simply connect those pins to the programmer that would be easy but wouldnt the pic start running its previous program once vcc and vdd are applied?

User avatar
Steve
Matrix Staff
Posts: 3424
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: 1st project issue/LED-LCD

Post by Steve »

Your circuit presumably has its own power and ground signals. What you need to do when you want to "in-circuit program" the chip is to disconnect these power rails and have them connected to the programmer board.

The programmer will control the Vdd and MCLR lines to put the chip into program mode.

chevy6600
Flowcode V4 User
Posts: 115
Joined: Fri Feb 22, 2008 6:38 pm
Contact:

Re: 1st project issue/LED-LCD

Post by chevy6600 »

Hi all, i am having all sorts of problems getting my prog to run in a real situation one of them being to output to the lcd on the v3 dev board, i get the top line blacked out or sometimes corrupt characters, i am trying to find out what causes various probs, so it`s a work in progress.
I have trailed the forum on the various causes so if any one knows of any different causes not yet put in the forum now would be a good time to add here !.
One problem that caused corrupt data on the LCD second line, i discovered can be caused by the `extended CPU enable` (when it was enabled) selection which is listed in the `expert setup` for the chip selection, this is only on some of the chips so not always given as an option.
If i find anything else out i`ll add as and when.

User avatar
Steve
Matrix Staff
Posts: 3424
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: 1st project issue/LED-LCD

Post by Steve »

Make sure the clock speed setting within Flowcode is correct for the actual hardware setting. If in doubt, create a simple LED flasher to ensure you can get an LED to blick actuately every second.

jbn.mjohn
Posts: 1
Joined: Thu Nov 13, 2008 6:27 pm
Contact:

Re: 1st project issue/LED-LCD

Post by jbn.mjohn »

SIR I AM JOBIN M JOHN,
I AM VERY INTERESTED IN ELECTRONICS FIELD,BUT I AM VERY WEAK IN PROGRAMMING SIDE. BUT NOW I GOT UR NEW SOFTWARE (FLOW CODE) SIR THIS IS REALLY WONDERFUL AND VERY HELPFUL FOR ME . BUT I HAVE SOME DOUBT ,HOW I CAN MAKE A (0.1MS) DELAY .

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times
Contact:

Re: 1st project issue/LED-LCD

Post by Sean »

The easies way to create delays shorter than 1ms is to use the C function delay_10us().

Simply drag a C icon onto your flowchart and replace the deafult text with the following line:

delay_10us(10);

This example will provide you with a 100us delay.

Post Reply