![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
Hi I was hopeing someone might have some sample code (in C) to help me with the set up of the SPI bus on the PIC18F4550 (or similar) to set 12 bit values in steps of 1/3 or 1/2 on an Analog AD5324 Quad DAC. I am trying to show that I can simply talk with DAC initially then will be adding additional devices on the SPI. I guess what I am not getting - forgive me for being so new - is once the PIC is configured for SPI mode is the data simply transfered to the DACs via the shift register (SSPSR) and the buffer register (SSPBUF)? I understand the setting of the top two bits in the shift register to designate which of the 4 buffers on the DAC I am writing to but I guess I'm timid on the actual implementation of it all... and when I add an additional device on the SPI how do I know what I am writing to the AD5324 or the AD7888 since I do not specify an address or anything? Thank you in advance. | |
| |
| | #2 |
|
Hi, With SPI it is the /SS or /chip select signal from the master that controls which device is to be active. In your case it should work on the /Sync Pin of the AD5324. The AD5324 only receives data, it does not return data, as demanded by the Microchip SPI protocol, so to get it to work you need to fit a 2K2 resistor across the pic ports SDI and SDO, so it can get a return signal this way. Am only into assember so cannot help with the code. | |
| |
|
| Tags |
| dac, guidance, pic, quad, spi |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| looking for a quad op-amp chip | AXmichigan | Datasheet/Parts Requests | 13 | 21st June 2009 11:02 AM |
| quad op amp | NickLee | Electronic Projects Design/Ideas/Reviews | 2 | 14th April 2009 12:47 AM |
| quad comparator | Spikeneeds2no | General Electronics Chat | 1 | 29th November 2008 04:25 AM |
| TL084 quad op-amp help | coolrfid | Datasheet/Parts Requests | 12 | 10th May 2008 10:10 PM |
| Quad 404!!! | chiriac_marius | Electronic Projects Design/Ideas/Reviews | 2 | 9th October 2004 08:16 AM |