Hi, there is a ready-made application. It is called at us as Pic-Basic Port Extender, and it is a pre-programmed PIC16C57, communicating with one pin serial 2400 Baud. Costs $4 or so. Regards, Imre On Mon, 14 Feb 2000, M. Adam Davis wrote: > Short Answer: Yes, and not too difficult to accomplish. > > Long Answer: > First you should define your needs, and then your instruction set. For > instance, were I to create such a beast, I would probably shoot for 1 PIC, and > 16 i/o lines. To make my job easier, I would choose one of the flash chips > which has an on-board USART, and the ability to program it's own memory > (16F8xx). > > My instructions might be as follows: > (Pins are number in hex, 0-f, so I only need to specify one digit to refer to > any pin) > COx - Configure Pin x as output > CIx - Configure Pin x as input > CBxyy - Configure Byte (8 pins, x being 0 or 8) as in/out according to yy > CCyyyy - Configure Chip input/output according to yyyy > CNyyyy - Configure Notify, notify me (send a read/set response) when one of > these pins change states (so I don't have to keep polling you) > > SHx - Set Pin x High > SLx - Set Pin x Low > SWxy - Set Word (4 pins, x being first pin in the group of four [0,4,8,C]) > to value y (again, in hex) > SBxyy - Set Byte to hex value yy > SCyyyy - Set Chip (16 bits) according to yyyy > > RBx - Read bit x > RWx - Read word x > RBx - Read Byte x > RC - Read all bits > > Pyyyy - Reprogram Chip, yyyy being size of program in words > This can be used to upgrade the firmware, add new features, etc. > This command actually gives control to the bootloader, and is the > only command available if the loaded program has a bad checksum. > > Chip responses might be: > Configure Responses: > C:yyyy:zzzz - yyyy is the current configuration if I/O > zzzz is the current notify setting > Read/Set Responses: > x:b - b is the current status of pin x (H or L) (so it isn't confused > with the next response which is in hex) > x:y - y is the current status of word starting at x (y = 0-f) > x:yy - yy is the current status of byte starting at x > C:yyyy - yyyy is the current status of all i/o (also in response to > change in pin state if one of the changed pins is on the Notify > list) > Program response: > P:yyyy - Ready to receive yyyy words of program, Checksum first. > > One could certianly add new features (A/D, PWM, Timers, etc) as their needs > warranted. > > At any rate, I might actually persue something along these lines. It would make > proof-of-concept and prototyping much easier for some projects... One could > almost think of it as a serial 8255, just more configurable. > > There would be more pins available than just 16, which could be used as more > I/O, A/D, or as an address scheme (every command and response is prefaced by a 1 > digit hex address, four extra pins are used to set that address) > > At any rate, that's enough thinking for now. I will finish my current project > (rs-232 LCD & keypad interface for home automation) first, then will work on > this. Anyone who is interested in the progress of this project should check my > PIC web site occasionally (http://ubasics.com/adam/pic/) > > -Adam > > Jonathan Philpott wrote: > > > > Hi, > > > > I was thinking, would it be possible to have a PIC > > that could you could "talk" to via a serial port, to > > give it commands... i was thinking something like > > this, > > > > When you connect to it, it just waits for input, and > > gives a prompt: > > > > >_ > > > > Then you can give it a command to turn on one of the > > output lines, a simple one character command would be > > enough, e.g "o" for on and "f" for off, so: > > > > >o1 > > > > would turn on output line one, and f1 would turn it > > off. > > > > Is this is possible? > > > > Jon > > -- > > > > __________________________________________________ > > Do You Yahoo!? > > Talk to your friends online with Yahoo! Messenger. > > http://im.yahoo.com > >