pic16f690 - hardware not working

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
Jocelyn
Flowcode v5 User
Posts: 15
Joined: Thu Jan 31, 2013 11:38 am
Has thanked: 2 times
Contact:

pic16f690 - hardware not working

Post by Jocelyn »

Please can somebody tell me what to do to make my program works on my hardware?is it something wrong on the setting?

I made a program that works well in simulation in FlowCode. But in hardware, LEDs doesn't light at all, all remain light off.
LEDs should have light up at least some to have binary representation.
I'm so clueless now, please help.
Thanks in advance.
Attachments
mdf-Voltage as String.fcf
pic16f690
(16.79 KiB) Downloaded 295 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: pic16f690 - hardware not working

Post by medelec35 »

Hi Jocelyn,

Since your using V5 professional,
I have moved you post to a more suitable section.

Can you please register for V5 Forums by following this link:
http://www.matrixmultimedia.com/mmforum ... =46&t=9958

When you are regstered for V5,
I will see if I can help you with your flowchart.

Martin
Martin

Jocelyn
Flowcode v5 User
Posts: 15
Joined: Thu Jan 31, 2013 11:38 am
Has thanked: 2 times
Contact:

Re: pic16f690 - hardware not working

Post by Jocelyn »

Thanks for your help. Do let me know if you need further details

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: pic16f690 - hardware not working

Post by medelec35 »

Your welcome.
Your LED's should Light, If they don't then try reprogramming and looking at the programmer messages to see if chip is programmed ok.
Using PPP I have noticed then programming does not always work first time.
If you still having and issue with LED's not lighting then you can check if its an analog hardware issue by setting the in_from_sensor variable at a fixed value just before the C output icon.

Are you using Eblocks e.g programmer and EB005 LCD?

If so then LCD will not work as there are only two pins that will work on port A of programmer,

That is A6 (this is RA4 on target device) and A7 (this is RA5 on target device).

Your Flowchart configuration is set up ok for 4MHz internal osc.

If not using Eblocks, are you able to post a circuit diagram please?
Martin

Jocelyn
Flowcode v5 User
Posts: 15
Joined: Thu Jan 31, 2013 11:38 am
Has thanked: 2 times
Contact:

Re: pic16f690 - hardware not working

Post by Jocelyn »

im not using e-block.
erm..i got problem in uploading the circuit image. Can u guide me? sorry for troubling or
probably u can reach here ww1.microchip.com/downloads/en/DeviceDoc/41381B.pdf on pg 96, figure 4-3: SCHEMATIC FOR ADC LAB 1
my circuit similar to this, except im change the R9(potentiometer) to other sensor.
is it correct to use Internal RC No Clock as oscillator?

fyi, i dint use lcd hardware, i just need my program to display value on lcd panel in my program.
in the meantime, i try to reprogram n run again. :)

Jocelyn
Flowcode v5 User
Posts: 15
Joined: Thu Jan 31, 2013 11:38 am
Has thanked: 2 times
Contact:

Re: pic16f690 - hardware not working

Post by Jocelyn »

below is the compiler message after reprogram, seems like having same message like before.

reProg.c
Starting preprocessor: C:\PROGRA~2\Flowcode\v5\Tools\boostc\pp.exe reProg.c -i C:\PROGRA~2\Flowcode\v5\Tools\boostc\include -d _PIC16F690 -la -c2 -o reProg.pp -v -d _BOOSTC -d _PIC16 -d _CHAR_INDEX


........................................

reProg.c success

success

.......................................................Return code = 0
Launching the linker/assembler...
C:\Program Files (x86)\Flowcode\v5\Tools\boostc\boostlink_pic.exe -ld "C:\Program Files (x86)\Flowcode\v5\Tools\BoostC\lib" libc.pic16.lib rand.pic16.lib float.pic16.lib "reProg.obj" -t PIC16F690 -d "C:\Users\User\Sem^Se7en\FyPA\FLOWCODE\Examples\Components\ADC" -p "reProg"

................................................

Caution: argument of 'delay_us' calls must have a value of 1 or more
Caution: Delay inaccurrate: 'delay_us', Delay overhead:0.01ms, Unit delay:0.001ms, Delay resolution:4 units
Caution: argument of 'delay_10us' calls must have a value of 1 or more

Warning unreferenced functions removed:
FC_CAL_Port_Out__x in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_IO.c
FC_CAL_Port_Out_DDR__x in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_IO.c
FC_CAL_Port_In__x in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_IO.c
FC_CAL_Port_In_DDR__x in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_IO.c
Wdt_Delay_S in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_Delay.c
FCI_DELAYINT_US in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_Delay.c
FCI_DELAYINT_MS in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_Delay.c
FCI_DELAYINTWDT_MS in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_Delay.c
FCI_DELAYINT_S in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_Delay.c
FCI_DELAYINTWDT_S in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_Delay.c
FCI_GETCHAR in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
FCI_GETLENGTH in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
FCI_MIDSTRING in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
FCI_LEFTSTRING in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
FCI_RIGHTSTRING in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
FCI_TOLOWER in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
FCI_TOUPPER in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
FCI_COMPARE in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
FCI_NUMBER_TO_HEX in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
FCI_STRING_TO_INT in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
FCI_STRING_TO_FLOAT in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
FCI_STRREV in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
FCI_STRMOV in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
FCI_SCOPY in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_String.c
isinf in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_Float.c
flt_round in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_Float.c
flt_floor in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_Float.c
flt_ceil in: C:\Program Files (x86)\Flowcode\v5\CAL\PIC\PIC_CAL_Float.c
FCD_ADC0_SampleADC in: C:\Examples\Components\ADC\reProg.c
FCD_ADC0_ReadAsInt in: C:\Examples\Components\ADC\reProg.c
FCD_ADC0_ADC_RAW_Sample_Channel_Byte in: C:\Examples\Components\ADC\reProg.c
FCD_ADC0_ADC_RAW_Sample_Channel_Int in: C:\Examples\Components\ADC\reProg.c
FCD_ADC0_ADC_RAW_Average_Channel_Byte in: C:\Examples\Components\ADC\reProg.c
FCD_ADC0_ADC_RAW_Average_Channel_Int in: C:\Examples\Components\ADC\reProg.c
FCD_ADC0_ADC_RAW_Disable_Channel in: C:\\Examples\Components\ADC\reProg.c
FCD_LCDDisplay0_Clear in: C:\Examples\Components\ADC\reProg.c
FCD_LCDDisplay0_PrintASCII in: C:\Examples\Components\ADC\reProg.c
FCD_LCDDisplay0_Command in: C:\Examples\Components\ADC\reProg.c
FCD_LCDDisplay0_PrintNumber in: C:\Examples\Components\ADC\reProg.c
FCD_LCDDisplay0_ScrollDisplay in: C:\Examples\Components\ADC\reProg.c
FCD_LCDDisplay0_ClearLine in: C:\Examples\Components\ADC\reProg.c
FCD_LCDDisplay0_RAM_Write in: C:\Examples\Components\ADC\reProg.c

Building CASM file
Memory Usage Report
===================
RAM available:256 bytes, used:134 bytes (52.4%), free:122 bytes (47.6%),
Heap size:122 bytes, Heap max single alloc:79 bytes
ROM available:4096 words, used:3776 words (92.2%), free:320 words (7.8%)

success
.................................................Return code = 0
Launching the programmer...
C:\Program Files (x86)\Flowcode\v5\Tools\PICkit2\pk2cmd.exe -BC:\Program Files (x86)\Flowcode\v5\Tools\PICkit2\ -PPIC16F690 -FreProg.hex -M -A5 -R
\|/
..
- \ \\|/-\|/ \
.
PICkit 2 Program Report
10-Apr-2013, 01:12:11
Device Type: PIC16F690

Program Succeeded.
Operation Succeeded
Return code = 0
FINISHED

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: pic16f690 - hardware not working

Post by medelec35 »

Looks like it has programmed just fine.
To test Hardware you can try this:
Loop while 1
in_from_sensor = 255
in_from_sensor > C
delay 500ms
in_from_sensor = 0
in_from_sensor > C

Repeat for ever.

That will test all your LED's are working correctly first.
Once they are all working , then you can alter flowchart to control LED's via Analogue i/p
Martin

Jocelyn
Flowcode v5 User
Posts: 15
Joined: Thu Jan 31, 2013 11:38 am
Has thanked: 2 times
Contact:

Re: pic16f690 - hardware not working

Post by Jocelyn »

oh,no.. what if the hardware doesn't work as in simulated program? hardware damage?
but when compiling the program, when the compiler msg states program succeeded, when pickit2 busy, i did see the led array(hardware) blink once and then off even when i run the program after completed the compilation.
Please advise.

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: pic16f690 - hardware not working

Post by medelec35 »

Oops I missed a delay off!.
Should be:
Loop while 1
in_from_sensor = 255
in_from_sensor > C
delay 500ms
in_from_sensor = 0
in_from_sensor > C
delay 500ms
Repeat for ever.
Don't for get LED only connect one way round and must have a suitable current limiting resistor connected in series with each one.

Can't help you any further util you can post a full circuit diagram.

you could try Designspark to create a schematic?
http://www.designspark.com/page/designs ... -home-page
Martin

Jocelyn
Flowcode v5 User
Posts: 15
Joined: Thu Jan 31, 2013 11:38 am
Has thanked: 2 times
Contact:

Re: pic16f690 - hardware not working

Post by Jocelyn »

I did add the second delay as I see why it keeps lighting up. Thx anyway~
here's the circuit
Image
Microcontroller Board configuration schematic is shown above, RB4/AN10 is connected to sensor via connector A.

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: pic16f690 - hardware not working

Post by medelec35 »

Jocelyn wrote:I did add the second delay as I see why it keeps lighting up.
If LED's lit then your Chip is running software ok (unless you was only referring to simulation only)?
You have not shown what your sensor is, as that could be the issue.
If reprogram your original code back in then If you have a multimeter, measure the voltage between An10 and ground. is it greter then say 1/2 Volt?
If not got a multimeter, you can remove An10 connection from sensor and connect it to +5 and make sure all LED's light.

Can you show the type of sensor and other connections, ig if photodiode or LDR show the connections to supply and resistor etc.
Martin

Jocelyn
Flowcode v5 User
Posts: 15
Joined: Thu Jan 31, 2013 11:38 am
Has thanked: 2 times
Contact:

Re: pic16f690 - hardware not working

Post by Jocelyn »

I was referring to the simulation only. :(
It's weird...what makes the leds dint light up?
I think the connection to sensor should be alright as I try to run the same program in Flowcode v3(with some different ADC macros used),LEDs hardware did run as I want it.
Last edited by Jocelyn on Thu Apr 11, 2013 4:07 am, edited 1 time in total.

Jocelyn
Flowcode v5 User
Posts: 15
Joined: Thu Jan 31, 2013 11:38 am
Has thanked: 2 times
Contact:

Re: pic16f690 - hardware not working

Post by Jocelyn »

I've measure with multimeter, whereby voltage between AN10 and ground shows 0V,
however, while compiling, when PICkit2 busy, compiler msg states program succeeded, LEDs hardware does blink once and by that time, there is voltage arnd 1.252V and sink down to 0V after compilation finished.

Post Reply