Cheap PIC board Sure Electronics DP-113

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
User avatar
rene
Posts: 56
Joined: Sun Sep 13, 2009 11:27 am
Location: Dordrecht - Nederland
Has thanked: 5 times
Been thanked: 2 times
Contact:

Cheap PIC board Sure Electronics DP-113

Post by rene »

Cheap PIC board Sure Electronics DP-113

18F4520, 2x16 LCD, 7Seg. display and ICii temp sensor, usb etc.... perfect and cheap!!
Works well with mplabs....

Who has this board working with flowcode4 components?
Everything, except the LCD display seems to works well ....

It seems that the signals are working the other way arround.
Can I somehow do this with Flowcode4 components ???

Thanks ...

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: Cheap PIC board Sure Electronics DP-113

Post by Benj »

Hello,

To use the LCD display on that board you simply have to set your LCD component connections up as follows.

D1 -> RD4
D2 -> RD5
D3 -> RD6
D4 -> RD7
RS -> RA3
Enable -> RA0

You will then need to output a 0 to portA bit 2 using a output icon in single bit mode.

There is also a contrast connection on pin RC1 you may need to output a 1 or a 0 to this pin to allow the contrast to work correctly. It could also be a PWM output as the pin has PWM functionality? I would have to see the schematic to know for sure.

Edit: Looking at the source code the contrast pin is a PWM output. You can control this using the PWM component.

User avatar
rene
Posts: 56
Joined: Sun Sep 13, 2009 11:27 am
Location: Dordrecht - Nederland
Has thanked: 5 times
Been thanked: 2 times
Contact:

Re: Cheap PIC board Sure Electronics DP-113

Post by rene »

Thanks Benj...

This is exacly what i did, but it dit not work....
But if you say it should be working that way, I'm on my own doubt
I must have done somthing wrong.... so i will try this again...

Thanks for your response and confirmation on what I thought it meant to be.

Rene
The Netherlands...

User avatar
rene
Posts: 56
Joined: Sun Sep 13, 2009 11:27 am
Location: Dordrecht - Nederland
Has thanked: 5 times
Been thanked: 2 times
Contact:

Re: Cheap PIC board Sure Electronics DP-113

Post by rene »

Bad luck....

Don't work...

Are you sure Enable have to go on RA0 i thought it should go on RA1 ...
Display is doing something... but it looks like chinees, greek or russian characters :?:

Do you have a small working example program ??

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Cheap PIC board Sure Electronics DP-113

Post by medelec35 »

Just had a look at:
http://www.tromop.eu/cms/index.php/sure ... assignment
Looking at:
DP-113 LCD.jpg
DP-113 LCD.jpg (42.63 KiB) Viewed 8319 times
E Should be Port A1. So A0 just look s like a typo.
But I'm guessing you have already got E connected to A1 since your display is is initialising OK
If E stayed as connected to A0, then all you will see is black squares (usually)

If Display is showing wrong characters, then problem is either the OSC speed is wrong, or one of the data lines not working correctly.
To elimate OSC speed issues, you can do the LED flash at 1Hz test. I'm guessing it is a configuration issue since:
rene wrote:Cheap PIC board Sure Electronics DP-113
18F4520, 2x16 LCD, 7Seg. display and ICii temp sensor, usb etc.... perfect and cheap!!
Works well with mplabs....
So Hardware is OK. Otherwise would not work with mplabs


e.g
RB0 = 1
delay = 500mS
RB0 = 0
delay= 500mS
Loop forever

If you post flowchart you have created for the demo board I will see if i can correct it for you.
Martin

User avatar
rene
Posts: 56
Joined: Sun Sep 13, 2009 11:27 am
Location: Dordrecht - Nederland
Has thanked: 5 times
Been thanked: 2 times
Contact:

Re: Cheap PIC board Sure Electronics DP-113

Post by rene »

Here by the example......

First Row on display show value of counter....
Second row wont work at all....
welcome message looks like chinees

It seams to be that reset display or set cursor don't do a thing.
Could this be a timer problem...oscilator clock is on HS

Program:
Main: main loop
Init: to set all bit and bytes and shows welcome message for 3 sec.
interrupt: to make ~0.5 and ~1 sec trigger with 50Hz 1:256 prescaler @ 12mHz
Call every 0.5 sec diplay update
Diplay: to show counter value at row 0 and shows string on row 2 when button pushed.

If i test this progrma with a 16Fxxx it works fine but not with this sure board ....???
What am I doing wrong...

Thanks
Attachments
DP113.fcf
Simple counter to display
(12.08 KiB) Downloaded 243 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Cheap PIC board Sure Electronics DP-113

Post by medelec35 »

Try this Flowchart.
I have changed:
Osc speed form 19.6MHz to 12MHz. This and watchdog timer could have been causing the issue.
Watchdog timer, Low voltage programming and extended CPU to disabled.
Can you let us know how you get on please.
Attachments
DP113_Modifed.fcf
(12.08 KiB) Downloaded 230 times
Martin

User avatar
rene
Posts: 56
Joined: Sun Sep 13, 2009 11:27 am
Location: Dordrecht - Nederland
Has thanked: 5 times
Been thanked: 2 times
Contact:

Re: Cheap PIC board Sure Electronics DP-113

Post by rene »

Too bad, the modified version does not work. :cry:

I have discovered, If you switched off the power and wait for a few second....switched on the power again and the "welcome message" appears for a few seconds. after about 3 seconds only nonsense appears on the display. :?:
Reset te board with reset botton or switch off power for short time the message don't appears...(only crap)

You can clearly see that the program sends data to the display.
Characters move from left to right ...in regular steps, each time the macro is called :!:

The hardware works fine when I create a program with MPLAB and let it run ..
I have double checked.

Does anyone have a working example with flowcode4 and DP113 board or some other ideas to get it working.

Thanks...

Rene

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Cheap PIC board Sure Electronics DP-113

Post by medelec35 »

:idea: Ah I believe I have worked out what's going wrong! I did not look into programming of your flowchart deep enough.
You are calling the display macro within your timer0 interrupt macro...this is defiantly a big no no. You should never have delays, or call other macros, especially containing delays .e.g Display routines from within a timer0 interrupt macro.
You will get corruption galore.
Instead of calling a macro you can just use an update flag, E.g when display is requiring an update you have got:

Code: Select all

If Update_display
Then Update_display = 0
otherwise
Then Update_display = 1
So what I have done, is remove Call Display macro, Then in Main:

Code: Select all

If Update_display=0
Then Update_display=1: Call Display Macro
otherwise
Don't Call Display Macro.
I'm more confidant this version will work.
Good luck, and fingers crossed.
Attachments
DP113_Modifed2.fcf
(12.43 KiB) Downloaded 224 times
Martin

User avatar
rene
Posts: 56
Joined: Sun Sep 13, 2009 11:27 am
Location: Dordrecht - Nederland
Has thanked: 5 times
Been thanked: 2 times
Contact:

Re: Cheap PIC board Sure Electronics DP-113

Post by rene »

Grrrrrrrrrrrrrr...... :evil:

No Luck, again.
I hope not "flow code" only works with e-Blocks

Perhaps the problem is the LCD display itself.
My board is a "Sure" DB DP113v319 board.
This is different than the board in the user's guide.
The user guide has an 2x20 display, similar to EB005.
My board has a 2x24 display ... can be the problem?
Will it be usefull to try the EB005 with the "sure board" to see if that will work ?

I've tried the 7Seg. display aswell.
For this to work you need to modify the C code.
Does not work with standard flowcode.

I hope someone has a solution and a working program to post.
just show two roles of text will be fine... to start with.

Rene

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Cheap PIC board Sure Electronics DP-113

Post by medelec35 »

:( That is a pity. I thought It was sussed as the problem occurred after 3 seconds. Looking at your code, the timer0 interrupt is enabled after 3 seconds.
Sorry the idea did not work, it was worth a try.
Martin

User avatar
rene
Posts: 56
Joined: Sun Sep 13, 2009 11:27 am
Location: Dordrecht - Nederland
Has thanked: 5 times
Been thanked: 2 times
Contact:

Re: Cheap PIC board Sure Electronics DP-113

Post by rene »

It works !!!!!! :P

Well, the solution was quite simple.
I have changed all the delays in the "custom code" of the lcdDisplay from 2ms to 4ms.
Now it works, as I would expect it to do ..

We thank all for thinking along and other help...
I am very pleased with the results now ...

Flowcode rocks!

Rene

User avatar
rene
Posts: 56
Joined: Sun Sep 13, 2009 11:27 am
Location: Dordrecht - Nederland
Has thanked: 5 times
Been thanked: 2 times
Contact:

Re: Cheap PIC board Sure Electronics DP-113

Post by rene »

Heck, :evil:
I was so happy ............... :P
But it still do not work quite right ... :?:
There most be something wrong with the timing between flocode and how this board (lcd) works.

To create a simple program, with on line 1 and line 2 a text
Something like "Hello" "World " that should not be too difficult ...???
Yet, I can not get it to work properly...
Same program works fine, if made with MPLAB.

What is wrong between flowcode and this board ? :?:
Are there people who have experience with the DP-113 board and flowcode4 or with other non E-Block PIC boards?
I like to know, what is their experience with these development boards and flowcode4
Attachments
Hello_World.fcf
Try this... what's wrong
(11.64 KiB) Downloaded 168 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Cheap PIC board Sure Electronics DP-113

Post by medelec35 »

Two things.
1) I thought Enable was A1 and not A0 as it is on your flowchart.

2) Try disabling extended CPU.

If I have that enabled with LCD eblock. I get funny characters. As soon as disabled, I get correct characters.

I have had experienced of several non LCD eblocks.

Used three different LCDs without any eblocks at all and all three have worked perfectly.
Martin

User avatar
rene
Posts: 56
Joined: Sun Sep 13, 2009 11:27 am
Location: Dordrecht - Nederland
Has thanked: 5 times
Been thanked: 2 times
Contact:

Re: Cheap PIC board Sure Electronics DP-113

Post by rene »

How stupid can you get?

Hours I sit staring at that stupid thing.
I have everything checked more than 50 times ....
And never seen that A0 was connected to the enable input ....!!!!!

Really I am ashamed that I ever seen. :oops:

I had everything and everybody blamed .... but the problem was myself ...

Sorry, and thank you to solve it.

Rene

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Cheap PIC board Sure Electronics DP-113

Post by medelec35 »

Your welcome,
and that does not make you stupid.
We all miss things from time to time (especially me :P ). It's called being human!
Just glad your up and running. That's what's important :)
Martin

Post Reply