On 6/19/08, Harold Hallikainen wrote: > 1. I'm using a PIC24HJ256GP610 with the SPI ENC chip. It appears the > TCP/IP stack initializes the SPI port for the ENC, then never touches the > SPI control registers again. Since I'm using SPI to talk with other > devices that require different SPI configuration, my code is trashing > their initialization. I think I have three options. Those are: use a > separate SPI port for the ENC; modify their code to initialize the SPI > before each use; modify my code to save and restore SPI configuration > before and after use. Well, the easiest way is to throw more hardware at it (ie, use separate SPI ports). The next easiest way is to use compatible SPI devices that can run at the same speed with the same signalling requirements (ie, no need ot change the SPI configuration at all). The 'proper' way to share SPI, though, is to layer an SPI driver on top of the hardware and modify the applications to use the driver. The driver then keep strack of which application is calling it, and maintains a virtual configuration for each application. If the app reconfigures the SPI through the driver, it keeps track of it. Next time the app tries to access the SPI it configures the SPI sccording to this 'virtual' configuration, and then sends the data through. That way it appears to each app that they have their own SPI hardware, and the driver manages all the virtualization functions. It's not a trivial system, but it's not difficult, and once you've written it you can use it elsewhere. > Documentation on this appears skimpy and out of date. I'd really like to > see something like the documentation for PHP at http://www.php.net . Their > user comments on each function are excellent. I've been wanting to setup something like that for a very long time now, and simply haven't gotten around to it. Jame's techref aspires to that in some ways, but is much more freeform, and not comprehensive. -Adam -- EARTH DAY 2008 Tuesday April 22 Save Money * Save Oil * Save Lives * Save the Planet http://www.driveslowly.org -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist