Dc voltmeter 0-55v

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

Moderator: Benj

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Dc voltmeter 0-55v

Post by Derrihj »

On measuring the An3 pin zenner with the Peak Atlas Zen50 tester i got 5.18 zenner volt @ 2ma , 5.19v @ 5ma , 5.20v @ 10ma and 5.21v @ 15ma my question , is this zenner fit for my An3 pin with the extra 0.21v at highest?

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: Dc voltmeter 0-55v

Post by medelec35 »

I was hoping that you would connected your i/p terminal blocks to a fixed DC voltage, then using a meter measure the voltage across An3 and GND.
Derrihj wrote: is this zenner fit for my An3 pin with the extra 0.21v at highest?
Of course.
There will be a very low current flowing due to 1Meg series resistance, so even with 100V + on the terminal blocks would not cause an issue with the microcontroller, even if the 100K resistor was to become open circuit.
There is also clamping within microcontroller an3 pin to stop it going 0.7v above VDD, so in theory zener is not even required, but nothing wrong with belt and braces.
Martin

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Dc voltmeter 0-55v

Post by Derrihj »

Martin you are not going to believe what am seeing when i was doing the one sec test.Check out all the attachments, in the code i decided to display a 0 and a 1 on Digit0 only in an interval of one sec to work as on and off but to my surprise on the real boad two Digits were lit that is Digit1 and Digit2 yet in code i only enable Digit0 to give me the 0 and 1 in one sec interval WHAT IN THE WORLD IS THIS???
Attachments
IMG_20200414_181703_551.jpg
IMG_20200414_181703_551.jpg (98.53 KiB) Viewed 12698 times
IMG_20200414_181706_409.jpg
IMG_20200414_181706_409.jpg (91.34 KiB) Viewed 12698 times

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Dc voltmeter 0-55v

Post by Derrihj »

An3, yes i did and there was 1 volt with that one volt was supposed to give me around 12v output on the 7seg but it shows clear flicker zeros and changes to some numbers like like 549 with decimal points on seg2 and seg3 in all the code i never activated decimal point on seg3.And i also did the one sec test coz in code i set the OSCCON = 0x70; it was flashing bang on one sec
Last edited by Derrihj on Tue Apr 14, 2020 4:52 pm, edited 1 time in total.

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Dc voltmeter 0-55v

Post by Derrihj »

Here is the one sec Tester.
Attachments
Test2.fcfx
(10.22 KiB) Downloaded 180 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: Dc voltmeter 0-55v

Post by medelec35 »

I Can't Spot issues with with your hardware after following tracks of your PCB.
There are a few things to try.
1. Place an additional calculation box with

Code: Select all

Voltage = 1.23 
in the position shown on the image:
To Test Hardware1.png
(11.76 KiB) Downloaded 491 times
Let me know what value is displayed.

2. Disable timer 0 so displayed is not activated.
In main, just activate one 7seg at a time with say a delay of 5 seconds.
Set Digit and Value options to the same number.
So you want:

Loop while 1:
7seg0 with a number 0, Delay 5 secs, 7seg1 with a number 1, Delay 5 secs & 7seg2 with a number 2, Delay 5 secs.
Check C & E voltage of all transistors with each of the 7segs activated. Make sure C E of the activated 7seg is less than 0.5V
& the C E of other transistors is near supply volts.
With no power on the board:
3.Check the board for shorts concentration on from MCU pins 1, 6, & 7. & on transistor if did not behave like suggested above.

Just need to use some fault finding skills, changing the flowchart to enable tests.
That is the fun part!
Martin

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Dc voltmeter 0-55v

Post by Derrihj »

After forcing the output voltage to be 1.23v as you requested i got a funny display as you can see below.
Attachments
IMG_20200415_000613_421~2.jpg
IMG_20200415_000613_421~2.jpg (75.53 KiB) Viewed 12677 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: Dc voltmeter 0-55v

Post by medelec35 »

Looks like could be a hardware issue.
Whats the part number for your display and can you upload the schematic?
I have done the same thing for my hardware:
Voltage as 1.23.jpg
(101.07 KiB) Downloaded 477 times
Did you carry out all suggested tests?
Martin

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Dc voltmeter 0-55v

Post by Derrihj »

Yes it must be hardware or chip haven't done all the test am going to do test number two now.The 7seg part number is as it appears on the image below it's a common cathode i got from China but i followed all it's letters and commons and they were matching the standards before i put it on my pcb.I don't have the schematic coz when am doing simple pcb like this one i just draw the pcb right away.
Attachments
IMG_20200415_004944_512.jpg
IMG_20200415_004944_512.jpg (83.5 KiB) Viewed 12672 times

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Dc voltmeter 0-55v

Post by Derrihj »

While I was building my pcb this is how I noted it's pins as in the image below this is in my note book.
Attachments
IMG_20200415_010525_157.jpg
IMG_20200415_010525_157.jpg (136.77 KiB) Viewed 12670 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: Dc voltmeter 0-55v

Post by medelec35 »

Can you try the attached Flowchart.
Attachments
Test 3.fcfx
(10.57 KiB) Downloaded 133 times
Martin

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: Dc voltmeter 0-55v

Post by medelec35 »

Does it display 1, 2 then 3 on just one 7seg?
Martin

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Dc voltmeter 0-55v

Post by Derrihj »

Ok your Test 3 was flashing solid clear 123 at an interval of one second on seg0 and seg2 check the attachment
Attachments
IMG_20200415_031922_547.jpg
IMG_20200415_031922_547.jpg (120.52 KiB) Viewed 12663 times
IMG_20200415_031915_767.jpg
IMG_20200415_031915_767.jpg (106.24 KiB) Viewed 12663 times
IMG_20200415_031912_048.jpg
IMG_20200415_031912_048.jpg (110.08 KiB) Viewed 12663 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: Dc voltmeter 0-55v

Post by medelec35 »

Oh course, transistor inversion of 180 deg.
This should now work middle one only?
If it does, then there is an issue with The 7seg component within flwocode.
If that is the case, I will modify your flowchart to make it work.

Edit: Not a bug with the quad 7seg component- see my post below
Attachments
Test 4.fcfx
(10.57 KiB) Downloaded 124 times
Martin

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Dc voltmeter 0-55v

Post by Derrihj »

How in the world did you do this Martin!! It works as you command it to this has been a one time nightmare for me.
Attachments
IMG_20200415_035215_514~2.jpg
IMG_20200415_035215_514~2.jpg (54.37 KiB) Viewed 12659 times
IMG_20200415_035245_178.jpg
IMG_20200415_035245_178.jpg (100.07 KiB) Viewed 12659 times
IMG_20200415_035212_345~2.jpg
IMG_20200415_035212_345~2.jpg (77.4 KiB) Viewed 12659 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: Dc voltmeter 0-55v

Post by medelec35 »

What I will do when I get up in the morning i will modify flowchart so it will be a fully Woking version (hopefully :mrgreen: ) . It will have the Voltage = 1.23 on it. So you can make sure all three are reading correctly. Then remove the 1.23 calculation to see if voltage input is correctly working for you.
Martin

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Dc voltmeter 0-55v

Post by Derrihj »

Copy that sir i will be waiting thanks for all the efforts GOD BLESS you.

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: Dc voltmeter 0-55v

Post by medelec35 »

I believe have worked out what the issue is.
There are no bugs or a hardware fault.
Its a hardware design compatibility issue.
With the Flowcode built-in Quad 7 seg common cathode display, for the display to be active, the common (cathode )is off!
So the other 7segs commons are high.
Reason being high on both anode and cathode = no potential difference = display off.
The way you have designed the PCB is the opposite, ie the common is high for the display that's enabled( actual voltage on the cathode is low due to transistor inversion).
What you have done makes sense as I understand why you did it that way.
Perhaps the Flwocode 7seg component can be modified to allow for inversion if common pins?

There are two ways around this.
1. use the single 7seg displays as you can disable the common, then just add a port output component to set high the active 7seg common pin.
See attached Test 5a

2. Just use nothing but port output components instead of 7seg displays.
See attached Test 5b

Not sure if either work yet, either may need tweaking?
Perhaps try 5a first?
Attachments
Test 5a.fcfx
(29.57 KiB) Downloaded 127 times
Test 5b.fcfx
(27.31 KiB) Downloaded 121 times
Martin

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Dc voltmeter 0-55v

Post by Derrihj »

Failed to compile reason being there is a missing componet: IsSim1::Check and one question what is the red dot next to the switch in macro TmrMultiplex for?

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: Dc voltmeter 0-55v

Post by medelec35 »

Removed Is Sim component.
Not sure why not working for you?
Is Sim.png
(21.63 KiB) Downloaded 433 times
What is v8 version?
Mine is 8.2.2.15 Built Feb 28 2020
Red dot is just a breakpoint (right click select Toggle breakpoint) , which the simulation stop at.
Simulations will not work well for these.
Attachments
Test 5b.fcfx
(26.05 KiB) Downloaded 110 times
Test 5a.fcfx
(27.82 KiB) Downloaded 105 times
Martin

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Dc voltmeter 0-55v

Post by Derrihj »

Ok test5a has worked going to test5b now
Attachments
IMG_20200415_120943_844.jpg
IMG_20200415_120943_844.jpg (129.29 KiB) Viewed 12626 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: Dc voltmeter 0-55v

Post by medelec35 »

Unless you removed the

Code: Select all

Voltage = 1.23
calculation icon, the display should be showing that.
The image looks like 12.2
Martin

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Dc voltmeter 0-55v

Post by Derrihj »

I first tested with voltage = 1.22 the i removed that calculation as i was most interested in the ADC so yes that is 12.2v as for my batery it all worked well am now testing Test5b.

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: Dc voltmeter 0-55v

Post by Derrihj »

Am done with Test5b it also works but the 3 on seg3 is half way lit it looks like a bracket ].
Attachments
IMG_20200415_122615_844.jpg
IMG_20200415_122615_844.jpg (92.35 KiB) Viewed 12619 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: Dc voltmeter 0-55v

Post by medelec35 »

If you go to the TmrMultiplex Call funtion macro.
look for Switch branch for number 3.
It currently shows

Code: Select all

port A  = 66
&

Code: Select all

Port B = 80
If you change it so

Code: Select all

Port B = 112
, it should then work.
Martin

Post Reply