# My first PCB

#### Markd77

Joined Sep 7, 2009
2,806
I just had a thought, it takes me a while sometimes. I could send you the displays and a PIC16F819, they could probably be with you by next weekend if you want.

#### R!f@@

Joined Apr 2, 2009
9,734
I just had a thought, it takes me a while sometimes. I could send you the displays and a PIC16F819, they could probably be with you by next weekend if you want.
Thanks for the offer but I have to decline.
Like to learn and build.

I am learning cause this is just one of the few Voltmeters I have planned to make. I cannot expect you to send me all of 'em u know.

Complete with PIC, Inverters and it's 5V reg. with all the components in a tiny SS PCB.

The RA0 part is yet to implement once I bread board to test it.
Eagle does not have a DIP PIC16F88, so I use a what is in the library. Pins are all the same.

The segment PCB layout is already done.

The connector which goes to segments is what I have. All I have right now is that IDC connector and cables.

All the components are from junk. So not necessary to comment on them.

Comments are welcome on trace layout.
The signals are routed under the chips and are 16 mil.
The Power traces are at 24 mil.
The jumpers are mostly used for Power.

I like to know whether signal routing method is OK.

I am using this method as I find easier to code. The inverters helps a lot.
I can use the same code later If I decide to buy CC 7 segs. Then I will omit the inverters in my next layout.

@ Mark
It's OK if you are bzy, I understand. I will tackle ur code with this board, It would be easier

By the way this layout too around 4 Hrs.

#### Attachments

• 24.7 KB Views: 31

#### Markd77

Joined Sep 7, 2009
2,806
I should have plenty of time to look at code tomorrow, some replacement parts for my bike arrived today so have mostly been fitting those instead.
You will still need 4 transistors for the common anodes of the displays. When an 8 is displayed they require 8*20mA = 160mA which I don't think inverters can deal with.
I meant to do it in code with compiler directives like this:
There's not too many parts which need changing.

If the #define line is commented out it compiles the second part instead of the first.

Rich (BB code):
;#DEFINE COMMONCATHODE

IFDEF COMMONCATHODE
;table is at start to avoid page crossing
bcdto7seg            ;bit 2 not used here (decimal point)
addwf    PCL, F    ; Jump into the lookup table
retlw    B'11101011'    ; Return segment code for 0
retlw    B'00100001'    ; Return segment code for 1
retlw    B'10111010'    ; Return segment code for 2
retlw    B'10110011'    ; Return segment code for 3
retlw    B'01110001'    ; Return segment code for 4
retlw    B'11010011'    ; Return segment code for 5
retlw    B'11011011'    ; Return segment code for 6
retlw    B'10100001'    ; Return segment code for 7
retlw    B'11111011'    ; Return segment code for 8
retlw    B'11110011'    ; Return segment code for 9
return
ELSE
bcdto7seg            ;bit 2 not used here (decimal point)
addwf    PCL, F    ; Jump into the lookup table
retlw    B'00010100'     ; Return segment code for 0
retlw    B'11011110'     ; Return segment code for 1
retlw    B'01000101'     ; Return segment code for 2
retlw    B'01001100'     ; Return segment code for 3
retlw    B'10001110'     ; Return segment code for 4
retlw    B'00101100'     ; Return segment code for 5
retlw    B'00100100'     ; Return segment code for 6
retlw    B'01011110'     ; Return segment code for 7
retlw    B'00000100'     ; Return segment code for 8
retlw    B'00001100'     ; Return segment code for 9
return

ENDIF

#### R!f@@

Joined Apr 2, 2009
9,734
Thanks, I will recheck the code.

As for the PNP, it is already added in the 7 Seg layout.

#### Markd77

Joined Sep 7, 2009
2,806
I think it looks pretty good with the inverters, not much more to do.
I presume the second digit decimal point just connects through a resistor to ground on the other board.

#### R!f@@

Joined Apr 2, 2009
9,734
I presume the second digit decimal point just connects through a resistor to ground on the other board.
Yup.

Like to ask you how would be the RA0 input Voltage dividers that U used

What I found is attached.

Vout = (R2 / R1+R2) * Vin.

Will this method be fine.

My Voltage variation will be 0 to 40V.

{ed}

I did a bit of calculating.
I assigned a R2 value of 4.7KΩ.
Maximum RA0 voltage is limited to 5V, so at an input of 40V, R1 comes to 32.9K (33K).

I presume the Vout will now vary from 0V to 5V.

Any hints or advice on this is highly anticipated.

#### Attachments

• 3.8 KB Views: 13
Last edited:

#### Markd77

Joined Sep 7, 2009
2,806
I've stripped out the dead wood so it just needs converting to your PIC from the 16F819. It works fine on my setup, so should work with your inverters.
Just rename the attached to .asm and you should be in business.
For the voltage divider I'd put a high value variable resistor in parallel with one of the resistors and recalculate so with the variable resistor in the midpoint it gives 5V out.
You would have to be very lucky to get a 5V regulator which is exactly 5.000V and resistors which are spot on.

#### Attachments

• 12.9 KB Views: 33

#### t06afre

Joined May 11, 2009
5,934
Yup.

Like to ask you how would be the RA0 input Voltage dividers that U used

What I found is attached.

Vout = (R2 / R1+R2) * Vin.

Will this method be fine.
You must also take into consideration the RA0 input impedance. And as Mark said resistors are never spot on. Ad a port for fine tuning

#### R!f@@

Joined Apr 2, 2009
9,734
Thanks a bunch.

I did exactly the same.
The Vin,s R1 has some parallel R & trimpot. I will use a trial & error and swap values until I get 5.00V at RA0.

I guess this is the Final Layout of both

{ed}
By the way, can I use the ICSP on the F88 so I can connect my Pickit3. I just have to connect straight to the ports without any thing in between, right ?

#### Attachments

• 87.3 KB Views: 23
• 26.1 KB Views: 24
Last edited:

#### Markd77

Joined Sep 7, 2009
2,806
Yes ICSP should be fine. The programming pins are connected to the inputs of inverters so there's no load on them. It works fine with my version too.

#### R!f@@

Joined Apr 2, 2009
9,734
What would I do without you guys.

Hey I forgot to ask, would I need a cap like 100nF at the RA0 pin.

ICSP added. MCLR pin has to be a flex wire jumper

#### Attachments

• 40.4 KB Views: 30
Last edited:

#### tom66

Joined May 9, 2009
2,595
Are you etching the boards yourself?

I suspect he only wants one, which is why people DIY PCBs. Shipping to the Maldives is a lot more expensive than you credit, ask him how much 2 rolls of wax paper (worth $3.60) cost in import fees, not to mention shipping. #### tom66 Joined May 9, 2009 2,595 I suspect he only wants one, which is why people DIY PCBs. Shipping to the Maldives is a lot more expensive than you credit, ask him how much 2 rolls of wax paper (worth$3.60) cost in import fees, not to mention shipping.
Yeah, that's the only disadvantage. Also, customs seems to take 2 weeks, plus the 1 week lead time for making the PCBs, that means it's 3 weeks+ to get your boards.

#### R!f@@

Joined Apr 2, 2009
9,734
Ok Mark.

I changed the Divider to R1 (5K6), R2 (470R) & the Trimmer to 10K across R1.

This way I can adjust the RA0 Voltage ±2.5V or so around the 5V.
A jumper is added so I can disconnect the Pin befor adjustment.

The R1 (R19 is schema) is 0.5W per my calculation, R2 can be a SMD.