Page 1 of 1

Please help!!!

Posted: Wed Feb 16, 2011 12:18 pm
by iman05
Heey everyone,

I'm making a project, but flowcode V4 and Eblocks are giving me a really hard time. I made this programme and when i debugg it on flowcode v4 it works but when i send it to eblocks ( using microcontroller 16f887A ) it does nothing, the switches doesnt react and the lcd is blank. I checked my programme over and over again i just can't find whats wrong with it, i really really hope someone here can help me cause im kinda running out of time. i used eblocks programmer + eblocks lcd + eblocks switches, i put +5v on the lcd and switches, i set the clock on Cristal but it still doesnt work, it only works when i debugg it.

Re: PLEASE HELP!!!

Posted: Wed Feb 16, 2011 1:07 pm
by medelec35
I would say the 1st thing to do is create a 1Hz flasher to check hardware and configuration settings.
Have LED connected to port A1 for example
Loop{
port A1 = 1
delay 500ms
port A1 = 0
delay 500ms
}
Also make sure switch (S12) on the programmer is set for XTAL and not RC
If LED is flashing at correct rate then adjust you flowchart so you get a message appear on LCD e.g displays Waiting.. when power is first applied to hardware, then display can change after switch has been pressed.
Try both these steps, then can take it further if still no joy.

Re: PLEASE HELP!!!

Posted: Wed Feb 16, 2011 1:27 pm
by iman05
I tried what you said, the lad flashed correct and i made a string that said "hello" to lcd when i press switch 5, and it showed hello on lcd, so there must be something wrong with my programme but i cant find it
medelec35 wrote:I would say the 1st thing to do is create a 1Hz flasher to check hardware and configuration settings.
Have LED connected to port A1 for example
Loop{
port A1 = 1
delay 500ms
port A1 = 0
delay 500ms
}
Also make sure switch (S12) on the programmer is set for XTAL and not RC
If LED is flashing at correct rate then adjust you flowchart so you get a message appear on LCD e.g displays Waiting.. when power is first applied to hardware, then display can change after switch has been pressed.
Try both these steps, then can take it further if still no joy.

Re: PLEASE HELP!!!

Posted: Wed Feb 16, 2011 2:10 pm
by DavidA
Initialise the variables

Laser1, Laser2 and Laser3

The simulation will assume them to start at zero, in hardware this may not be the case, if you use a variable before you populate it always initialise it.

Change your first calculation block from:

Time1 = 0
Time2 = 0

To:

Time1 = 0
Time2 = 0
Laser1 = 0
Laser2 = 0
Laser3 = 0

Should work now.

Oh and no more all caps titles please.

Re: PLEASE HELP!!!

Posted: Wed Feb 16, 2011 2:19 pm
by iman05
DavidA wrote:Initialise the variables

Laser1, Laser2 and Laser3

The simulation will assume them to start at zero, in hardware this may not be the case, if you use a variable before you populate it always initialise it.

Change your first calculation block from:

Time1 = 0
Time2 = 0

To:

Time1 = 0
Time2 = 0
Laser1 = 0
Laser2 = 0
Laser3 = 0

Should work now.
omg, thankss man it did really work, jeez didn't that such a small stupid mistake can ruin the whole programm, do you know if i have a decimal 1.4589 for example how i can show that on LCD ?

Re: Please help!!!

Posted: Wed Mar 02, 2011 5:34 pm
by Benj
Hello,

To display floating point variables such as 1.4589 on a LCD you fist need to use the FloatToString conversion function available from the string manipulation icon "functions" button to convert the variable into a string. Once you have converted the value to a string you can output the string to the LCD as normal.