![]() It seems that the LTC2400 ADC chip uses SPI with its pins: SCK, SDO, /CS. otherwise, write the point and continue on if no places after decimal, stop now and return Tempfloat = tempfloat - ((float)digit * tens) this small addition, combined with truncation will round our calculate rounding term d: 0.5/pow(10,places) if this rounding step isn't here, the value 54.321 prints as If (!(PINB & (1, but doesn't seem worth the import #define LTC_SCK 5 // LTC2400 SCK Select Pin on Portb 5įloat v_ref=4.094 // Reference Voltage, 5.0 Volt for LT1021 or 3.0 for LP2950-3 #define LTC_MISO 4 // LTC2400 SDO Select Pin on Portb 4 #define LTC_CS 2 // LTC2400 Chip Select Pin on Portb 2 #define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit)) #define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) As I said, it works perfectly on the UNO but not the Mega. I did not write it, it came with the purchase of the ADC. Obviously it is outputting now, but there is something wrong.Īny ideas on what to do to make this ADC work on my Mega? Thank you.ĮDIT: The code is below. For example, SCK is pin 13 on the uno and pin 52 on the mega, SS is pin 10 on the uno and pin 53 on the mega, etc.Īfter doing this I get an output on the serial monitor of 8.188000 and it will not change no matter what. I looked into the pinout of the Mega 2560 here: Īnd tried to correlate the pins for the uno and mega. Plugging into the same PWM pins as the UNO has no effect. I need to use this ADC with my Mega 2560 and I'm having problems. ![]() I used a 100k trim pot with one end hooked up to VCC and the other to GND and was able to read voltages between 0-5 with six digits of accuracy just as it's supposed to. ![]() I plugged into my uno, uploaded the code that came with it, and it works perfectly fine. I recently bought a 24-bit ADC from this seller on ebay:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |