Page 4 of 10

Re: Dc voltmeter 0-55v

Posted: Tue Apr 14, 2020 3:41 pm
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?

Re: Dc voltmeter 0-55v

Posted: Tue Apr 14, 2020 4:09 pm
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.

Re: Dc voltmeter 0-55v

Posted: Tue Apr 14, 2020 4:29 pm
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???

Re: Dc voltmeter 0-55v

Posted: Tue Apr 14, 2020 4:35 pm
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

Re: Dc voltmeter 0-55v

Posted: Tue Apr 14, 2020 4:49 pm
by Derrihj
Here is the one sec Tester.

Re: Dc voltmeter 0-55v

Posted: Tue Apr 14, 2020 6:05 pm
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!

Re: Dc voltmeter 0-55v

Posted: Tue Apr 14, 2020 10:11 pm
by Derrihj
After forcing the output voltage to be 1.23v as you requested i got a funny display as you can see below.

Re: Dc voltmeter 0-55v

Posted: Tue Apr 14, 2020 10:42 pm
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?

Re: Dc voltmeter 0-55v

Posted: Tue Apr 14, 2020 10:47 pm
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.

Re: Dc voltmeter 0-55v

Posted: Tue Apr 14, 2020 11:09 pm
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.

Re: Dc voltmeter 0-55v

Posted: Wed Apr 15, 2020 12:43 am
by medelec35
Can you try the attached Flowchart.

Re: Dc voltmeter 0-55v

Posted: Wed Apr 15, 2020 1:21 am
by medelec35
Does it display 1, 2 then 3 on just one 7seg?

Re: Dc voltmeter 0-55v

Posted: Wed Apr 15, 2020 1:24 am
by Derrihj
Ok your Test 3 was flashing solid clear 123 at an interval of one second on seg0 and seg2 check the attachment

Re: Dc voltmeter 0-55v

Posted: Wed Apr 15, 2020 1:45 am
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

Re: Dc voltmeter 0-55v

Posted: Wed Apr 15, 2020 1:59 am
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.

Re: Dc voltmeter 0-55v

Posted: Wed Apr 15, 2020 2:06 am
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.

Re: Dc voltmeter 0-55v

Posted: Wed Apr 15, 2020 2:09 am
by Derrihj
Copy that sir i will be waiting thanks for all the efforts GOD BLESS you.

Re: Dc voltmeter 0-55v

Posted: Wed Apr 15, 2020 6:32 am
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?

Re: Dc voltmeter 0-55v

Posted: Wed Apr 15, 2020 9:12 am
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?

Re: Dc voltmeter 0-55v

Posted: Wed Apr 15, 2020 9:41 am
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.

Re: Dc voltmeter 0-55v

Posted: Wed Apr 15, 2020 10:13 am
by Derrihj
Ok test5a has worked going to test5b now

Re: Dc voltmeter 0-55v

Posted: Wed Apr 15, 2020 10:21 am
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

Re: Dc voltmeter 0-55v

Posted: Wed Apr 15, 2020 10:25 am
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.

Re: Dc voltmeter 0-55v

Posted: Wed Apr 15, 2020 10:30 am
by Derrihj
Am done with Test5b it also works but the 3 on seg3 is half way lit it looks like a bracket ].

Re: Dc voltmeter 0-55v

Posted: Wed Apr 15, 2020 10:39 am
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.