FC6 and pic18f65k80

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
tello
Posts: 94
Joined: Wed Jan 16, 2013 11:37 am
Has thanked: 56 times
Been thanked: 16 times
Contact:

FC6 and pic18f65k80

Post by tello »

:( :( Hi guys, I have problems with FC6, in my design I use a Pic18f65K80.
The display does not work properly when passing a few seconds, the information is deleted and the screen is clean. if the reset circuit, a second display is functioning properly again.
Also I can not read the analog inputs, I always delivers 4095.
Here I attached the code if anyone can help me sulocionar the problem.

Thank you very much
Attachments
Hardware_test.fcfx
(21.24 KiB) Downloaded 209 times

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: FC6 and pic18f65k80

Post by QMESAR »

Hi tello

I would advise you to just post a small code that shows your problem? the full projects is too large and I guess most user do not have the time to analyze such a big code to try and find your error
for example the problem with your adc code just post a simple code that does not work ,if you follow what i mean ,i tried to look at your code but it is too big and I personally do not have the time to go through such a big code :D

tello
Posts: 94
Joined: Wed Jan 16, 2013 11:37 am
Has thanked: 56 times
Been thanked: 16 times
Contact:

Re: FC6 and pic18f65k80

Post by tello »

Thanks for your advice QMESA.
Here I attached the small program, but in simulation everything works fine.
I think it's something microcontroller configuration, but can not find the error.
I tested the hardware and everything is correct.
In the AN0 input I have 2.5V but reading is 4095, when teongo also reads 0V 4095.

I'm going crazy

Has anyone ever worked with PIC18f65k80 ??

thanks
Attachments
SIMPLE Hardware_test.fcfx
(6.95 KiB) Downloaded 204 times

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: FC6 and pic18f65k80

Post by QMESAR »

Hi tello
it seems you are using a 10MHZ Crystal Clock then your Clock frequency you define in the project settings are incorrect (this will have an effect on the LCD delays etc.)
you will notice that in your project settings you have PLL enabled then your Clock frequency is 10*4 = 40MHZ change the value in the project settings to 40MHZ and try it again
also you can disable the PLL and leave the clock as it is

Try this hope it helps
Attachments
4.jpg
4.jpg (67.43 KiB) Viewed 7955 times
2.jpg
2.jpg (146.17 KiB) Viewed 7955 times
3.jpg
3.jpg (59 KiB) Viewed 7955 times

tello
Posts: 94
Joined: Wed Jan 16, 2013 11:37 am
Has thanked: 56 times
Been thanked: 16 times
Contact:

Re: FC6 and pic18f65k80

Post by tello »

Thanks for your help.
I have been tested and still malfunctions.
The display shows strange characters and I can not read the AN0 input always shows 4095 scale background.

You have ever worked with Pic18f65k80 ??

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: FC6 and pic18f65k80

Post by QMESAR »

:D I am not an expert but I am working with PIC's since 12 years
my Problem is a bit like yours I am very new to FC(been programming in C )

I would think that you need to convert your AN value into a string of characters before displaying on the LCD(if not I expect it would show strange things on the screen)
How do you see the 4095 in debugging or in the LCD ?

just send a constant value string of "2100" just to verify that the LCD and Timing is correct then we can solve the ADC problem
Solve the Problems one after the other is my suggestion :D
Attachments
4.png
Convert AN to a string
(3.17 KiB) Downloaded 4519 times
5.png
Like Matrix example
(4.29 KiB) Downloaded 4519 times

tello
Posts: 94
Joined: Wed Jan 16, 2013 11:37 am
Has thanked: 56 times
Been thanked: 16 times
Contact:

Re: FC6 and pic18f65k80

Post by tello »

Hello again, when the display works fine, I can see the value 4095. If I put forced value of 2100, the display can see the correct number.
I need to scale the value of AN0 to print after the number in the display, but first I have to read the value of the input correctly :lol: :lol: .

thank you

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: FC6 and pic18f65k80

Post by QMESAR »

Hi tello

if you measure on the AN0 pin what voltage do you measure on the pin because from your code I see no problem with the configuartion of the potentiometer component
this should read the AN0 correctly !
maybe just for a test
(1)Write to what you measure as a Voltage on the AN0 pin with a voltmeter
(2) just try to read an average int from the AN0 signal and tell us what value you got

:D hope you get it working
Attachments
6.jpg
6.jpg (76.7 KiB) Viewed 7937 times

tello
Posts: 94
Joined: Wed Jan 16, 2013 11:37 am
Has thanked: 56 times
Been thanked: 16 times
Contact:

Re: FC6 and pic18f65k80

Post by tello »

Thank you so much QMESAR.
I tried your advice "GetAverajeInt" and WORKS WELL !!! :D :D :D
But do not understand why it does not work "getint"'ve always used this block and I have not had any problems in other designs.

I just need to troubleshoot the display. I do not get to make it work more than 10sec, when time passes clears the screen and I have to reboot to display the value again.

Thank you very much again

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: FC6 and pic18f65k80

Post by QMESAR »

Hi tello

Great I am happy for you ! :D
I would suggest that you ask benj as my knowledge of FC is is not as it should be at the moment and I can only expect a problem with the getInt() function.as said This benj will clear for you
what we showed is that your Flow diagram and hardware are working correctly
Good luck with your project :D

tello
Posts: 94
Joined: Wed Jan 16, 2013 11:37 am
Has thanked: 56 times
Been thanked: 16 times
Contact:

Re: FC6 and pic18f65k80

Post by tello »

Hello again QMESAR.
I think I found the problem of display. The COG display ERC1602-3 I use has the NT7603 driver and may differ from the start and the data sent by the block display in FC6.

I have to find a way to change the start of the display and data delivery times for this driver.

It is also very interesting to create a display I2C component because it is becoming easier to find these diaplays to include in our designs.

thank you very much

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: FC6 and pic18f65k80

Post by QMESAR »

Hi Tello

This sound very good thank you for informing :D
Good luck

Post Reply