benarjee
Newbie level 4
- Joined
- May 6, 2015
- Messages
- 6
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 37
data_read3 =((unsigned int)data_read1) | ((unsigned int)(data_read2<<8));
data_read3 = (data_read2 | data_read1);
I am doing like this
Code:data_read3 = (data_read2 | data_read1);
is that ok
data_read3 = (data_read1) | ((unsigned int)(data_read2<<8));
while ( !SSPSTATbits.BF ); // wait until the all bits received
SSPSTATbits.BF=0;
data_read1 = SSPBUF; // read the received data from the buffer
data_read2 = SSPBUF; // read the received data from the buffer
data_read2 = data_read2<<8;
dis_cmd ( 0xC0);
data_read3 = (data_read2 | data_read1);
see my code
Code:while ( !SSPSTATbits.BF ); // wait until the all bits received SSPSTATbits.BF=0; data_read1 = SSPBUF; // read the received data from the buffer data_read2 = SSPBUF; // read the received data from the buffer data_read2 = data_read2<<8; dis_cmd ( 0xC0); data_read3 = (data_read2 | data_read1);
see my code
Code:while ( !SSPSTATbits.BF ); // wait until the all bits received SSPSTATbits.BF=0; data_read1 = SSPBUF; // read the received data from the buffer data_read2 = SSPBUF; // read the received data from the buffer data_read2 = data_read2<<8; dis_cmd ( 0xC0); data_read3 = (data_read2 | data_read1);
see my code
Code:while ( !SSPSTATbits.BF ); // wait until the all bits received SSPSTATbits.BF=0; data_read1 = SSPBUF; // read the received data from the buffer data_read2 = SSPBUF; // read the received data from the buffer data_read2 = data_read2<<8; dis_cmd ( 0xC0); data_read3 = (data_read2 | data_read1);
I am using AD7328 at reference 3VDC for reading input voltage with range +/- 10VDC, my problem is that I am getting full reading from 0 to 10Vdc on my LCD display but resolution is not good . when I change 1 volt my display also get change by 1 volt ,but not getting intermediate value
Hello I need to calibrate my ADC , can someone proved me code for calibrating 12-bit ADC
Zero- and fullscale adjustment of digital instruments is often done by digital means, e.g. by applying calibration parameters stored in a nonvolatile memory. In so far some code is required to calculate the corrected measurement values. The mathematic behind this "two-point calibration" is quite simple.Calibrating of ADC can be done by adjusting the analog input volatage step by step and monitor for the output volatges. If there is more variation you need to adjust the Vref.
The voltage deviation from ADC which you are getting for 0V is called offset error and the voltage deviation which you are getting for maximum input volatge is called gain error.
The calibration can be done through hardware itself no specific kind of code of required to achieve this.
I have no experience with that device and I'm not entirely sure what you are trying to do. However looking at the data sheet, and in particular the "Sequencer Operation" section (starting on page 25) you will see that the general sequence is that you write a command and simultaneously read back the previous result with each 16-bit transfer.
You don't show in your picture where the CS line is raised and lowered to delineate each command, but Figure 44 shows clearly that you need to follow the steps I've listed above exactly for each command, including lowering and then raising the CS line for each 16-bit exchange.
Susan
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?