Electronic – Communicate PIC with digital scales/DMMs

multimeterpicserialuart

Is it possible for anyone to make a PIC(I'm thinking of using 16F628/16F628A) communicate with another device, in this case a digital scale or industrial digital multimeter using USART/serial port communication?

I know that connecting digiscales to PC and reading data thru serial ports is possible (I've done this before so I know I could). I was just wondering if anyone has ever tried to use PICs or any microcontrollers in place of PC. The change is needed since where I am going to implement this thing, the PC option can't be used(it's not there), and using PIC is much much cheaper.

I got codes for a 16f84 communicating to a PC with me(got it off electronics-diy.com, somehow blocked now), gonna try converting it to 16f628A compatible first. Anyone who has ideas do share.

Best Answer

The PIC has an industry standard UART, and anything the PC can do the PIC can do as regards communicating.

The only difference between the two is the PC will most likely have an RS-232 line driver in the circuit to provide the proper +/-12V or so. The PIC doesn't have this, but adding something like a MAX232 chip will convert the output to standard RS-232 levels.

All you need to know is the correct protocols to use to talk to the remote device, and to implement them in the PIC's firmware. Note that the PIC doesn't have any hardware handshaking as standard, and a very tiny (2 character) receive buffer, so I tend to write my own send/receive routines which implement hardware handshaking using a couple of other I/O lines which also go through the MAX232 chip (CTS/RTS).

Getting the right baud rate setting on the PIC can be a little tricky, depending on which specific language you are programming in - some calculations are often required to get the divisor from the system clock speed. The data sheet is essential for this - read it thoroughly.