Thanks Bill & Marco, Both pointers were useful. I want to interface the PIC with a serial VFD that has selectable baud rates. Only one I/O line be used. If I need to interface it to a PC, I'll use a transistor level shifter. Thanks once again. Regards, Chetan On Thu, 9 Sep 2004 15:56:38 +0200, marco.genovesi@libero.it wrote: > See if this can help you > Attached is my first "code" on these little chips... but really isn't exact: it is only a copy-paste from other projects (as TLOGGER by Stan Ockers and other PICListers). > > This code is much more than your request, so if you need only the serial comm routines, look at OUTCH, SENDIT and BINARY_TO_BCD ( by Scott Dattalo). Note that in SENDIT routine I send Tabs and LF/FF to separatate the 4 bytes of the sensor that I use: you can cut these lines to display your "HELLO WORLD" correctly. > > The original code was for a 16F84, so I have done some modifies to move on a 12F629 (similar to 12F675). The 12F629 is config. as 4MHz INTOSC: the PIC flash a led, read a DS1820 temperature sensor every (about) 1 minute and send 4 bytes of temperature data to RS232 (4800/8/N/2) to a PC serial port. The HW connections I used are briefly explained in the draw attached. > > Notes: > > 1) For 12F675 you must change LIST directive and include "p=12f629" and "p=12f629.inc" with your processor. > 2) ANSEL register must be set ad digital I/O with my layouy (this register there isn't on F629). In the INIT routine you must add: > > bsf STATUS,RP0 ; Bank 1 > clrf ANSEL ; digital IO > bcf STATUS,RP0 ; Bank 0 > > 3) There isn't a level converter for the PC serial port, but even if this is out of RS232 specs, generally you can do the job if the serial cable is SHORT (less than 1mt and maybe shorter). I have done this successfully with my PC desktop, an old Olivetti laptop and also a Casio PVS460 palm. > > I have tested this code only in the breadboard but it has gone successfully, even if the DS1820 sensor gets not too precise readings (but this is another problem and isn't important for you, I think). > > regards > Marco > -- Chetan Bhargava www.bhargavaz.net _______________________________________________ http://www.piclist.com View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist