I have considered doing the SPI in software. However, the SSP module can transmit and receive at the same time. Hopefully this means I can write 8 bits to the DAC whilst reading 8 bits from the ADC. If this is correct then with a bit of cunning I can save lots of cycles. Can anyone confirm this or not? I still think things are going to be extremely tight as I have to implement a PID controller in the remaining time. At 20MHz I get a 200ns instruction cycle. At 50k samples/sec I have a loops time of only 20us which is only 100 instuctions. Not possible IMHO. I have haggled the sampling speed down to 20k samples/sec which give me quite a bit more time, I still suspect it's going to be difficult though. Out of interest does the Hi-Tech C compiler support the Scenix chips, or can the ASM output be hacked to make it compatible? Regards Mike Rigby-Jones > Mike, you need to provide a chip-select for each device on the SPI bus. > I've found that it's much easier to do the SPI bus in software as many > devices, such as 12-Bit converters, require more overhead with a hardware > SPI bus. > > - Tom > > At 10:50 AM 4/20/99 +0100, Michael Rigby-Jones wrote: > >I call upon the mighty piclist once more.... > > > >I've just been asked if I can help with a project involving a dual 12 bit > >DAC (MAX144) and a dual 12 bit ADC (MAX5156) which are to be part of a > >closed loop control system. The system has to have very fast response > time > >and the sampling speed will need to be in the region of 50k samples/sec. > >This means I will need a part with a built in SPI interface. No problem > as > >we have an emulator for the 16C63 etc. > > > >However, this system is to be controlled via a 68HC12 over an SPI bus. > >Hmmm. Now do any parts have 2 SPI interfaces? Because I think that's > what > >I'm going to need unfortunately. The PIC will (I suspect) be running > pretty > >well flat out performing it's control functions so a software > implementation > >is going to be tricky. > > > >Any suggestions? > > > >Regards > > > >Mike Rigby-Jones