![]() The description of pins present on the Arduino board are listed below: The Pinout of Arduino Mega is shown below: The advantage of using the Arduino Mega board over other boards is that it gives the advantage of working with more memory space. Thank you so much! All I had to do is change the CS,MISO,and SCK bits from 2,4,5 to 0,3,1 and it is now working perfectly.The Arduino Mega is based on ATmega2560 Microcontroller. To read the status perhaps reading a pin called "MISO" is enough, or I might even connect the SDO to another pin as well to read the status. If I had to use the LTC2400 chip, I would only use normal Arduino SPI functions. I did find a number of other code for the LTC2400 with an Arduino, but they all use code that is like this. It is also PORTB, but I think you have to use bits 0,3,1 for CS,MISO,SCK instead of 2,4,5. Try to find the PORTs for the Mega board for the SPI. If you want to use that code, check if writing the SPI registers on the Mega board would work, perhaps you have to adapt that (it is the "// init SPI Hardware" section). It uses a combination of direct register writing to PORTs. That code uses the hardware SPI bus of the Arduino board, but it does not use the Arduino SPI functions. That is bad use of the SPI bus, therefor the SPI bus can no longer be used for other SPI chips. The SDO should be connected to Arduino MISO, and the SDO also acts as a status signal to indicate that it is ready. There is no input, so data can only be read from the chip. 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. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |