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.

Design review and critique of my first PIC project (serial data tranceiver)

Status
Not open for further replies.

Gordito

New Member
(EDIT: oops missed that typo in the title)
Hi,

I've breadboarded my first PIC project (PIC16F88) and it works on my bench. It converts a funky 16 bit RS-422 serial protocol into 8 bit ascii RS-232 serial data and sends it to a data acquisition system (or a PC in my case). The final PCB is to be used in a 'noisy' environment (lots of other equipement doing data acquisition, electromagnetics fields, radar frequencies).

Before i start laying out the PCB i'd really appreciate feedback, criticism and confirmation on a few things. Someone is going to use it in his system for his business so i want to make it the most reliable possible. I've attached a PDF. If another format (large JPG) is preferred i can attach it.

Background Info:
- Basically, a 75LBC175 quad differential line receiver gets input from a sensor, converts it to TTL levels and sends it the PIC16F88 on pins RA0, RA1 and RA2. The PIC converts this data into 8 bit serial ascii sent to a MAX232 IC (9600 N81).

- Power supply is a cheapo wall wart rated 6v that gives me about 7.88v with the actual load. I use a 7805 for regulation.

-Output DB9 cable just uses the T1OUT line and GND from MAX232, no handshaking, half-duplex.

Sensor data:
- Sensor gives me a clock (CLOCK line) @ 25KHz i use to read the incoming bits.
-The data is 16 bits (DIGITAL line). Bits are synch to CLOCK (@25khz).
- The data word comes in at 50Hz. The ENABLE line goes high when the the bits start coming in.

-NOTE: I'm using a 1N5819 schottky rather than the one on the schematic.


Questions or points to confirm:


75LBC175 (quad differential line receiver):
From the specs: "The fail-safe design ensures that when the inputs are open-circuited, the outputs are always high"
1. I'll leave the unused inputs open but can i leave the unused outputs unconnected or is it better to tie them to +vcc? If so why?

75LBC175 to PIC16F88
From the datasheets, PIC inputs (RA0 to RA2) are "TTL compatible" and '175 outputs are mosfet totem pole (if i understand the schematic correctly).

2. I've tied the ENABLE pins on the '175 to VCC (enable = true) so according to the datasheet the '175 outputs should never be in high impedance mode (happens on enable = false). I believe the only time i need to add resistors to ground would be to avoid floating PIC inputs. Therefore i don't need pull down resistors, correct?

3. Recommended high and low currents from the '175 outputs are 8ma (80ma short circuit). The PIC RA0 to RA2 TTL inputs can sink or source up to 25ma per pin (100ma) per port.
- Do i need to add series resistors between them to limit the current? if no, why, if yes, how do i calculate the values (suppose like to limit current consumption as much as possible). I haven't found any mention of input impedance or minimal current required for the PORTA inputs.

PIC16F88
4. I've grounded the unused port pins thru 47Ks in case they accidently get set as high outputs. I took a guess, 47k is about 100uA. Is this correct?

5. I've connected the ICSP VCC directly to +5V. I've had problems when i had a resistor between suply +5V and PIC VDD to which the ICSP +5V was connected. Perhaps my resistor was to big... what is the recommended value? Do i need to change this?

PIC to MAX232
6. The Maxim datasheet gives for "Logic Pullup/lnput Current" 10uA. If i understand the datasheet correctly, that means that no resistors are required to limit the current from the pic to the max232. Correct?

MAX232
"The inputs of unused drivers can be left unconnected since 400kΩ input pullup resistors to VCC are built in"
7. As the specs say, I leave the unused inputs and outputs open. correct?

Enclosure / Shielding
8. Do i need to take measures regarding the enclosure in order to protect against EM interference (if it can be an issue). I suppose a metal enclosure would act as a faraday cage, and this enclosure should be connected to the power supply GND? Is this correct?

9. The data coming from the sensor in on balanced twisted pairs and the 75LBC175 should reduce noise but i was thinking of using 6 feet of DB9 cable from the device to the data acquisition system. Is there something else i should consider or this is OK?

Anything else?

Thanks in advance for taking the time to educate me :)

Oh yeah here are the datasheets i used:
PIC16F88
SN75LBC175
MAX232
 

Attachments

  • Transceiver v01b.pdf
    22.4 KB · Views: 311
Last edited:
I corrected two drawing errors i made and attached the new version (Transceiver v01b). Dang.
Errors:
- I had connected the 75LBC175's pin 7 (input 2A) to +5V (cf question 1)
- I had mislabeled the GND pin for the DB9 connector
Sorry about that.
 
The ICSP port doesn't match other diagrams I looked up.
Olimex ICD2 Programmer
Their diagram suggests you got your data and clock pins reversed.
Seeing as how this is an Olimex design, an established development board manufacturere and distributor, I tend to believe their diagram.

All the pulldown resistors got my attention. Where did you find this advice to do it this way? They aren't pulling anything really for current, so I have no concern there.

Out of curiosity, which language are you writing the code in?
kenjj
 
I verified the datasheet for the F88 and the icsp connections are correct (data on RB7).

Regarding the resistors, i found some posts on this forum advising the put resistors to ground to avoid floating inputs (if the pins are accidentally read as inputs) and shorts (in case the pins are accidentally configured as outputs and set to high). On the other hand, i've added them after the fact on the schematic (but `no the prototype yet, the only divergence there is) and i've already programmed the PIC so there is practically no risk in getting these problems.

Suppose i decide to skip on the resistors, do i still need to ground the unused PIC pins for better reliability?

I am writing in ASM. I did some ASM about 18 years ago and had a motorola uC... it's coming back :)

Thanks for your reply Ken
 
Thanks, i will leave the unused PIC pins unconnected.

Any opinion about the resistors between the 75LBC175 and the PIC?
 
Status
Not open for further replies.

Latest threads

Back
Top