On Sun, 13 Sep 1998 12:56:51 -0400 Bunburry writes: >First off I would like to say hi, secondly I have never worked >with pic's. Basically what I want to do is use the 8pin pic to listen >to serial data stream on either 1 or 2 ports if neccessary. > >First of all is it possible to read 11 bit into the 8bit port (the pdf >said it was a 8bit port. You are reading the data serially, so only a 1-bit port connection to the data source is required. The PIC data memory and ALU are 8-bit, though you can handle larger variables by using more than one byte of RAM for them. With asynchronous data, you're not going to save the start and stop bits. One byte of RAM (or "file register") could hold the 8 bits of data, and another bit somewhere else would hold the parity. >. I spent several hours searching for this info >but all the pic info that I found were based on the PIC16... Most of what you find for the PIC16CXX is applicable to the 12XXXX parts. Microchip has three CPU "core" designs which are generally backward-compatible. The 12XXX chips have the "low-end" or 12-bit core. The most commonly used PICs, the 16CXXX series, have the "mid-range" or 14-bit core. These two are very similar, the instructions have the same mnemonics and function. A 12-bit program, with a few changes and reassembly, can run on a 14-bit PIC. The reverse is often true except that the 12-bit ones have no interrupts, a few fewer instructions, and more restricted memory spaces. So you can learn a lot about how to write code for a 12XXXX chip by studying 16XXX programs, though ones based on interrupts aren't going to be possible. Especially for receivng two streams of data at once, a "state machine" type of asyncronous reception algorithm is often used. The program would constantly sample the serial input pin(s) at a rate that is an exact multiple (at least 3 or 4) of the baud rate. When a start bit is detected, a software counter would be set to control which samples are the data bits and should be kept. Each time a data bit is sampled, it is rotated (to the right) into a RAM variable. When the counter indicates that all the bits have been received, the completed byte is made available for processing. Disadvantages of this method are that the processor has to be rather fast for the higher baud rates, and without a timer interrupt, the program has to be very carefully written to take samples at the proper time. _____________________________________________________________________ You don't need to buy Internet access to use free Internet e-mail. Get completely free e-mail from Juno at http://www.juno.com Or call Juno at (800) 654-JUNO [654-5866]