LSb Octal DAC Evaluation Board User’s Guide 2021 Microchip Technology Inc.
Note the following details of the code protection feature on Microchip products: • Microchip products meet the specifications contained in their particular Microchip Data Sheet. • Microchip believes that its family of products is secure when used in the intended manner, within operating specifications, and under normal conditions. • Microchip values and aggressively protects its intellectual property rights.
1LSb OCTAL DAC EVALUATION BOARD USER’S GUIDE Table of Contents Preface ........................................................................................................................... 5 Chapter 1. Product Overview 1.1 Introduction ..................................................................................................... 9 1.2 1LSb OCTAL DAC EVALUATION BOARD Overview .................................... 9 1.3 1LSb OCTAL DAC EVALUATION BOARD Features ...................................
1LSb Octal DAC Evaluation Board User’s Guide DS50003218A-page 4 2021 Microchip Technology Inc.
1LSb OCTAL DAC EVALUATION BOARD USER’S GUIDE Preface NOTICE TO CUSTOMERS All documentation becomes dated, and this manual is no exception. Microchip tools and documentation are constantly evolving to meet customer needs, so some actual dialogs and/or tool descriptions may differ from those in this document. Please refer to our website (www.microchip.com) to obtain the latest documentation available. Documents are identified with a “DS” number.
1LSb Octal DAC Evaluation Board User’s Guide CONVENTIONS USED IN THIS GUIDE This manual uses the following documentation conventions: DOCUMENTATION CONVENTIONS Description Arial font: Italic characters Initial caps Quotes Underlined, Italic text with right angle bracket Bold characters N‘Rnnnn Text in angle brackets < > Courier New font: Plain Courier New Represents Referenced books Emphasized text A window A dialog A menu selection A field name in a window or dialog A menu path MPLAB® IDE User’s Guide
Preface RECOMMENDED READING This user’s guide describes how to use the 1LSb Octal DAC Evaluation Board. Another useful document is listed below. The following Microchip documents are available and recommended as a supplemental reference resource.
1LSb Octal DAC Evaluation Board User’s Guide DOCUMENT REVISION HISTORY Revision A (November 2021) • Initial release of this document. DS50003218A-page 8 2021 Microchip Technology Inc.
1LSb OCTAL DAC EVALUATION BOARD USER’S GUIDE Chapter 1. Product Overview 1.1 INTRODUCTION This chapter provides an overview of the 1LSb Octal DAC Evaluation Board. The MCP47CXBX8/MCP48CXBX8 is a 12-bit, 1 LSb DAC. The devices offer two memory options: MCP47CVBX8/MCP48CVBX8 devices have volatile memory, while the MCP47CMBX8/MCP47CMBX8 have 32-times programmable nonvolatile memory (MTP).The devices operate from a single supply voltage of 2.7V to 5.5V for full specified operation and 1.8V to 5.
1LSb Octal DAC Evaluation Board User’s Guide DS50003218A-page 10 FIGURE 1-1: 1LSb OCTAL DAC EVALUATION BOARD (TOP VIEW) FIGURE 1-2: 1LSb OCTAL DAC EVALUATION BOARD (BOTTOM VIEW) 2021 Microchip Technology Inc.
Product Overview The following figure shows the 1LSb Octal DAC Evaluation Board mounted on the Curiosity microcontroller board, using the mikroBUS™ connector. FIGURE 1-3: 1.3 1LSb OCTAL DAC EVALUATION BOARD MOUNTED ON THE MIKROBUS™ CLICK™ BOARD OF THE CURIOSITY HPC DEVELOPMENT BOARD (DM164136) 1LSb OCTAL DAC EVALUATION BOARD FEATURES The 1LSb Octal DAC Evaluation Board is a fully assembled board.
1LSb Octal DAC Evaluation Board User’s Guide NOTES: DS50003218A-page 12 2021 Microchip Technology Inc.
1LSb OCTAL DAC EVALUATION BOARD USER’S GUIDE Chapter 2. Installation and Operation 2.1 GETTING STARTED The 1LSb Octal DAC Evaluation Board can be used by following the four steps listed below. Note: The demo code provided in Chapter 3. “Code” enables use of the 1LSb Octal DAC Evaluation Board with the Curiosity HPC Development Board (DM164136). Once the Curiosity HPC board has been programmed with this code, the DAC’s output can be monitored on the VOUT pin using an oscilloscope. 1.
1LSb Octal DAC Evaluation Board User’s Guide b) Select “Standalone Project” and click Next. FIGURE 2-2: SELECT STANDALONE PROJECT c) Select PIC18F47Q10 as the device and click Next. FIGURE 2-3: SELECT THE DEVICE d) From the “Select Tool” menu, choose “Curiosity/Starter Kits (PKOB4)” and click Next. FIGURE 2-4: DS50003218A-page 14 SELECT THE TOOL 2021 Microchip Technology Inc.
Installation and Operation e) Select XC8 as the Compiler and click Next. FIGURE 2-5: SELECT THE COMPILER f) Name the project, provide the project location and click Finish. g) From the File menu, select “New File...”. FIGURE 2-6: NEW FILE h) From Categories, select “C” and, from File Types, select “C Source File” and click Next. 2021 Microchip Technology Inc.
1LSb Octal DAC Evaluation Board User’s Guide FIGURE 2-7: i) Name the file (“DAC_SAMPLE” in the example shown in the following figure) and click Finish. FIGURE 2-8: j) NAME THE FILE From the file, right click Source File and select “Add Existing Item...”. FIGURE 2-9: DS50003218A-page 16 NEW FILE ADD A SOURCE FILE 2021 Microchip Technology Inc.
Installation and Operation k) Navigate to the project folder, then select the DAC_SAMPLE.c file and click the Select button. FIGURE 2-10: l) ADD A SOURCE FILE This will add the code contained within the DAC_SAMPLE.c file to the source code, as shown in the following figure. FIGURE 2-11: ADD A SOURCE FILE m) Copy and paste the demo code to the DAC_SAMPLE.c file (make sure the code and comments are copied correctly).
1LSb Octal DAC Evaluation Board User’s Guide 3. The LEDs on the Curiosity HPC Board will blink based on which code is running, and the user can monitor the DAC’s output using the VOUT pin (see the following two figures).
Installation and Operation 2.2 SPI DEMO Once the Curiosity board is programmed and running, LED D4 will blink, while the other LEDs will remain off. This indicates that the SPI DAC is working and the output can be monitored on Channel 0 of the SPI output. When LED D4 is blinking, Channel 0 will output a sine wave as shown in the following figure.
1LSb Octal DAC Evaluation Board User’s Guide When the S1 switch is pressed, the SPI output waveform will be a saw-tooth shape, as shown in the following figure. LED D5 will blink, while LEDs D2, D3 and D4 will be off. This indicates SPI DAC is working and the output can be monitored on Channel 0 of the SPI output. The frequency of the waveform can be modified using the potentiometer on the curiosity board (see Figure 2-18).
Installation and Operation 2.3 I2C DEMO Once the Curiosity board is programmed and running, press the S2 switch. The D2 LED will blink while all the other LEDs will remain off. This indicates that the I2C DAC is working and the output can be monitored on Channel 0 of the I2C DAC output. When LED D2 is blinking, the DAC’s Channel 0 will output a sine wave as shown in the following figure. The frequency of the sine wave can be varied using the analog potentiometer.
1LSb Octal DAC Evaluation Board User’s Guide The following figure shows a flow-chart for the DAC demo.
1LSb OCTAL DAC EVALUATION BOARD USER’S GUIDE Chapter 3. Code 3.1 DEMO CODE Program the PIC18F47Q10 on the Curiosity board with the following code to enable use of the connected 1LSb Octal DAC Evaluation Board, which will allow for monitoring and testing the DAC. The sample code is also provided separately on the product page for convenience. 2021 Microchip Technology Inc.
// CONFIG1H #pragma config CLKOUTEN = OFF #pragma config CSWEN = ON #pragma config FCMEN = ON // Clock Out Enable bit (CLKOUT function is disabled) // Clock Switch Enable bit (Writing to NOSC and NDIV is allowed) // Fail-Safe Clock Monitor Enable bit (Fail-Safe Clock Monitor enabled) // CONFIG2L #pragma config #pragma config #pragma config #pragma config // // // // MCLRE = PWRTE = LPBOREN BOREN = EXTMCLR OFF = OFF SBORDIS Master Clear Enable bit (MCLR pin (RE3) is MCLR) Power-up Timer Enable bit (Pow
2021 Microchip Technology Inc.
void ADC_Initialize(void); void Delay( unsigned int ); void SPI1_Initialize(void); void SwitchInit(void); void SW1(void); void SW2(void); void SPI1_WriteWord(unsigned char addr,unsigned int data); unsigned int SPI1_ReadWord (unsigned char addr ); void SystemInit(void); void StartADCoversion(void); void I2C1_Initialize(void); void I2C1Write(unsigned char ControlByte ,unsigned char addr,unsigned int data); unsigned int I2C1ReadLastAddr(unsigned char ControlByte ); unsigned int I2C1Read(unsigned char ControlBy
2021 Microchip Technology Inc.
2021 Microchip Technology Inc.
2021 Microchip Technology Inc.
CS=0; SSP1BUF = (addr<<3)&0xF8; while(!PIR3bits.SSP1IF); PIR3bits.SSP1IF = 0; //Shift and & write command AD4:AD3:AD2:AD1:AD0:0:0:X //Wait for the interrupt //Clear the interrupt flag SSP1BUF = ((data>>8)&(0x00FF));// Shift the data to transmit the MS byte while(!PIR3bits.SSP1IF); PIR3bits.SSP1IF = 0; SSP1BUF = ((data)&(0x00FF)); while(!PIR3bits.SSP1IF); PIR3bits.
2021 Microchip Technology Inc. and its subsidiaries * Function to Initialize SPI1 Module ****************************************************************/ void SPI1_Initialize(void) { SSP1CON1=0; SSP1STAT=0; SSP1ADD=0; //Setup PPS Pins ANSELBbits.ANSELB1=0; //Make the PORTS digital ANSELBbits.ANSELB2=0; //Make the PORTS digital ANSELBbits.ANSELB3=0; //Make the PORTS digital TRISBbits.TRISB1=0; //Make port output TRISBbits.TRISB2=1; //Make port output TRISBbits.
for(del2=0;del2<100;del2++) { if(SWITCH1) { break; } } while(SWITCH1==0);// wait here for the switch to release LED3=0; LED2=0; if(Status==SPI_SINE) { Status=SPI_SAWTOOTH; } else { Status=SPI_SINE; } } 2021 Microchip Technology Inc.
2021 Microchip Technology Inc. and its subsidiaries if(Status==I2C_SINE) { Status=I2C_SAWTOOTH; } else { Status=I2C_SINE; } } Code DS50003218A-page 33 } /**************************************************************** * Initialize ADC module ****************************************************************/ void ADC_Initialize(void) { ANSELAbits.ANSELA0=1; TRISAbits.TRISA0=1; //Setup ADC ADCON0bits.ADFM = 1; //right justify 0=left ADCON0bits.
LED2=1; LED3=0; LED4=0; LED5=0; CS=1; TRIS_CS=0; DIGTAL_CS=0; } /**************************************************************** * Initialize the I2C1 module ****************************************************************/ void I2C1_Initialize(void) { SSP1CON1=0; SSP1STAT=0; SSP1ADD=0; 2021 Microchip Technology Inc. and its subsidiaries /* Set pins RB1 and RB2 as Digital */ ANSELCbits.ANSELC3 = 0; ANSELCbits.ANSELC4 = 0; TRISCbits.TRISC3=0; TRISCbits.TRISC4=0; PORTCbits.RC3=0; PORTCbits.
2021 Microchip Technology Inc. and its subsidiaries SSP1DATPPS = 0x14; SSP1CON1bits.SSPM3 = 1; SSP1ADD = 0x9F; PIR3bits.SSP1IF = 0; // clear the interrupt SSP1CON1bits.SSPEN = 1; } /**************************************************************** *Function to write the I2C with Control Byte ,address and data ****************************************************************/ void I2C1Write(unsigned char ControlByte,unsigned char addr,unsigned int data) { PIR3bits.SSP1IF = 0; SSP1CON2bits.
//address where to read from SSP1BUF = (((addr<<3)&0xF8)|0x06); //address,write command AD4:AD3:AD2:AD1:AD0:0:0:X I2C1_IntPoll(); I2C1_ACKCheck(); SSP1CON2bits.RSEN = 1; I2C1_IntPoll(); //Repeated Start SSP1BUF =(ControlByte|0x01); I2C1_IntPoll(); I2C1_ACKCheck(); //; or with read bit 0 SSP1CON2bits.RCEN=1; //enable receive I2C1_IntPoll(); dataread=SSP1BUF; I2C1_ACK(); //Send ACK for received data 2021 Microchip Technology Inc. and its subsidiaries SSP1CON2bits.
2021 Microchip Technology Inc. and its subsidiaries SSP1CON2bits.SEN = 1; I2C1_IntPoll(); // Start SSP1BUF = (ControlByte|0x01); I2C1_IntPoll(); I2C1_ACKCheck(); //; or with read bit 0 SSP1CON2bits.RCEN=1; I2C1_IntPoll(); dataread=SSP1BUF; I2C1_ACK(); //enable receive //Send ACK for received data SSP1CON2bits.RCEN=1; //enable receive I2C1_IntPoll(); dataread=((dataread<<8)|SSP1BUF);; I2C1_NACK(); //Send NACK for received data SSP1CON2bits.
} 2021 Microchip Technology Inc. and its subsidiaries 1LSb Octal DAC Evaluation Board User’s Guide DS50003218A-page 38 ****************************************************************/ void I2C1_ACKCheck(void) //Check ACK from Slave { if ( SSP1CON2bits.
1LSb OCTAL DAC EVALUATION BOARD USER’S GUIDE Appendix A. Schematics A.1 INTRODUCTION This appendix contains the following schematics and layouts for the 1LSb Octal DAC Evaluation Board - EV76B70A: • Board – Schematics • Board – Top Assembly Drawing • Board – Bottom Assembly Drawing 2021 Microchip Technology Inc.
BOARD – SCHEMATICS VDD=5V/3.3V VSS=GND HVC Power Supply DNP 3 2 LAT0/HVC GND TP1 VDD 1 GND J3 DNP C1 10uF 16V TANT-A 1 S_LAT0/HVC TP2 R8 C4 GND VDD VDD VDD +3.3V VSS 0R DNP R14 R15 DNP DNP 0R 0R R3 2.2K 5% R2 EP VDD LAT1 LAT0/HVC SDA SCL A0 VREF0 VOUT0 VOUT2 VOUT4 MCP47CMB28 2.
Schematics A.3 BOARD – TOP ASSEMBLY DRAWING 1 8 7 6 2 5 1 1 4 3 2 1 2 3 2 1 2 1 2 1 6 5 4 1 2 3 1 2 15 14 13 12 11 16 10 17 1 2 2 9 18 1 21 8 19 7 20 4 1 1 2 2 6 1 2 3 4 5 3 6 5 8 7 2 8 7 6 5 4 1 3 2 1 1 A.
1LSb Octal DAC Evaluation Board User’s Guide NOTES: DS50003218A-page 42 2021 Microchip Technology Inc.
1LSb OCTAL DAC EVALUATION BOARD USER’S GUIDE Appendix B. Bill of Materials (BOM) TABLE B-1: BILL OF MATERIALS (BOM) Qty. Reference Description Manufacturer Manufacturer Part Number 1 C1 Capacitor, tantalum, 10 µF, 16V, 10%, 3, SMD, A KYOCERA AVX TAJA106K016RNJ 1 C3 Capacitor, ceramic, 2.2 µF, 16V, 10%, X5R, SMD, 0603 TDK Corporation C1608X5R1C225K080AB 2 C4, C5 Capacitor, ceramic, 0.1 µF, 25V, 10%, X7R, SMD, 0603 TDK Corporation C1608X7R1E104K080AA 1 J1 Connector, hardware-2.
1LSb Octal DAC Evaluation Board User’s Guide TABLE B-1: BILL OF MATERIALS (BOM) (CONTINUED) Qty. Reference 0 J6 Description Connector, hardware-2.54, male, 2x8, gold, 5.84MH, TH, vertical Manufacturer Manufacturer Part Number Amphenol ICC (FCI) 609-3364-ND 0 R4, R7, Resistor, TKF, 0R, 1/10W, SMD, Yageo Corporation RC0603JR-070RL R12, R13, 0603 R14, R15 Note 1: The components listed in this Bill of Materials are representative of the PCB assembly.
Worldwide Sales and Service AMERICAS ASIA/PACIFIC ASIA/PACIFIC EUROPE Corporate Office 2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 480-792-7200 Fax: 480-792-7277 Technical Support: http://www.microchip.com/ support Web Address: www.microchip.