Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Using PIC16F1939 and designing a circuit around it.

Fluffyboii

Active Member
Hi,
I recently acquired my PIC16F1939 for driving LCDs for my watch project. I am hoping to fit it inside a wristwatch but if I can not do that I will just use large static LCDs to make a clock.
Since I could not find a DIP version of the chip in local shops and did not want to order one single chip online, I just bought the SMD version. To be more specific it is the 44-Pin TQFP package. There are PCBs to convert it into DIP package and I could buy one later but I thought I would design a converter myself and get it drilled on copper in my school.
This is my current PCB layout to convert this IC to something that can be put on a breadboard like the Arduino Nano:

1714348713304.png

1714348728256.png

1714348787422.png


There is 0.7 inch gap between the pins so this should go on a breadboard just fine.

I was thinking of soldering one of my small 32678Hz crystals at the bottom of the PCB. C1 and C2 are for adding small capacitors from the crystal to ground. C3 is for the built in linear DC-DC converter. It is said to be optional to use a capacitor there but I decided to put it just in case (0.1 uF in datasheet). Thanks to the converter it should work between 1.8V and 5.5V. There are supercaps rated for 5.5V so I may go with a solar powered clock if I can keep the power usage low enough. C4 is regular decoupling capacitor. Quartz crystal is missing in the schematic as I could not find a suitable footprint. I will solder it in between RC0 and RC1 for Timer1 oscillator connection.
1714345069102.png

Datasheet says that Timer1 is especially designed to work with a 32678Hz quartz crystal to do time keeping. From what I understand Timer1 register can be used to count and wake CPU every second to update seconds. Also, this clock signal can be used as the main clock source of the mcu. Or built in clock generator can be used as well. Can I save power by running the mcu with a slow clock speed?
1714345316465.png

I wired the programming pins according to the datasheet to connect to a pickit. I saw one tutorial using a weak pull up resistor for V_PP/MCLR pin but I can not find it referenced in the datasheet. I have added an LED for power indication and another LED connected to the RC0 pin for no particular reason, at least I can use it to test blink code or something. My goal here is to use this board with breadboard to prototype my LCD watch stuff then remove the mcu to use it in the real think when I feel ready. Are there any glaring issues with the layout? I would like to ask since I never used a microcontroller before.

I could have picked up a F1933 instead I guess. F1939 is kind of overkill for my application as I will probably not use 16 segments pins. Only reason I initially chose it was because it had DIP version sold on online shop but I ended up buying the SMD version from local vendor anyway. Should have bought one DIP F1939 to breadboard with and a SMD F1933 to use in finished project.
1714349139733.png
 
Last edited:
You should have two decoupling capacitors, one as close to pins 6 & 7 as possible and one as close to pins 28 & 29 as possible.

Also it’s best to have the wires to the crystal being as short as possible and certainly not going to another board.
 
Including a decoupling capacitor (C4) is essential for providing clean power to the microcontroller. It should be placed close to the VDD and VSS pins of the microcontroller.
Adding a capacitor (C3) for the built-in linear DC-DC converter is a good precautionary measure, as recommended in the datasheet.
 
If my counting is right and there are 11 pins per side, you have pins 11 & 12 floating and pin 13 connected to one of the connection points on the edge.
I see it now, I thought the most upper and lower pins were 12, 13, 33, 34 but it was not like that. This is the updated design:
1714390624764.png

1714390659626.png

I also added C5 as additional decoupling capacitor. Maybe I can add a reset switch somewhere on the left.

Looks like a pull up resistor is needed for the reset pin so I went ahead and removed the power indicator LED in favor for a reset button.
1714394584039.png
 
Last edited:
1714401122499.png

I also draw this monstrosity for PIC16F1933. Probably impossible to solder and even if it was possible to solder the pin outs are all random so would be a pain to use. I do like the challenge of routing the wires with minimal use of vias.
1714421025386.png

1714421040590.png


I put a quartz on the PIC16F1939 layout as well:
1714404853595.png

I added the Gerber files after adding ground copper area to empty places. It would be a good idea to write the pin names next to the pins but I would not change anything for me as my school CNC machine will ignore non copper text.
 

Attachments

  • Gerber_pic16_PCB_pic16F1939_2024-04-29.zip
    43.3 KB · Views: 54
  • Gerber_pic16F1933_PCB_pic16F1933_2024-04-29.zip
    12.9 KB · Views: 48
Last edited:
I noticed a mistake in the schematic of PIC16F1933 version. The Timer1 oscillator quartz was connected to RA0 and RA1 instead of RC0 and RC1. I fixed that and also fixed one of the pins that had no connection.
I added a series resistor to the quartz crystal. I doubt it does much but it was mentioned in PIC16F1947 LCD driving guideline. I added extra pads for 603 and 805 footprint capacitors. I was only able to find 12pF SMD caps in 805 package but I will get 15pF and 10pF caps in 603 package to experiment as well. I did the same with other caps to have extra soldering options. I added a de-bouncing capacitor pad to the reset switch. I switched to full SMD components so I was able to shrink the design a lot. I also added two vias to the sides of the quartz so a small wire can be soldered to stop it from moving around.
1714679730433.png

1714679652820.png

From the copper area outline you can see how much it got smaller.

1714679903295.png

1714679921793.png

I am not updating the PIC16F1939 layout like this because I will just use DIP components to bridge extra stuff if I need it. I did not order SMD parts yet so 1939 layout will use mostly DIP parts and the 1939 mcu I have at hand.
 

Attachments

  • Gerber_pic16F1933_PCB_pic16F1933_2024-05-02.zip
    26.7 KB · Views: 47

Latest threads

Back
Top