Hardware/CubeSat Gumstix/Test/ADC
|
The ADC controller design reads the 8 ADC channels together with the temperature value and sends the values to the serial port.
The UART baud rate is 115˙200. The ADC sampling rate is 100 Hz, due to the slow UART text transmission. The ADC's SPI connection runs at 12.5 MHz (100 MHz / 4 / 2).
FPGA
The FPGA has to be configured with the procController-adc.bit
file.
Alternatively, the procController-adc.mcs
can be loaded into the M25P64 SPI flash (data width is 1 bit).
Booting from the flash takes about 12 seconds.
SPI
The ADC's SPI interface is mirrored on the peripheral 2 connector:
- CS_n pin 5
- SCLK pin 6
- MOSI pin 7
- MISO pin 8
- RST_N pin 9
- BUSY pin 10
Serial port
The serial data out is provided on the serial port to the Gumstix. It is mirrored on the peripheral 2 connector:
- GND pin 2
- TxD pin 3 (not used)
- RxD pin 4
The FTDI serial-USB adapter uses:
- GND: black
- TxD: orange
- RxD: yellow
Measurements
With a 5 V voltage reference, the reading should be:
- FFFh for the 5 V on channel 0
- A8Fh for the 3.3 V on channels 1 to 3
- 800h for the 2.5 V on channel 1
- 5C2h for the 1.8 V on channel 2
- 3D7h for the 1.2 V on channel 4
Gumstix
Log-in to the Gumstix via the USB serial console.
Make sure you belong to the group dialout
.
List the possible serial ports:
ls -l /dev/tty*
With Yocto Linux, the device is ttyO0
.
Change the baud rate:
FPGA_UART='/dev/ttyO0' stty -F $FPGA_UART 115200
Display the ADC data:
cat $FPGA_UART
The output should look like:
0: FFF 1: CD7 2: 70F 3: D00 4: 4C0 5: 000 6: 000 7: 000 8: E9C 0: FFF 1: CE7 2: 712 3: CF9 4: 4BC 5: 000 6: 000 7: 000 8: E8E 0: FEF 1: CC9 2: 713 3: D10 4: 4B9 5: 000 6: 000 7: 000 8: E82 0: FF5 1: CD2 2: 71E 3: D07 4: 4B4 5: 000 6: 000 7: 000 8: EB0 0: FF0 1: CD6 2: 71C 3: D11 4: 4B5 5: 000 6: 000 7: 000 8: E9D 0: FEF 1: CCB 2: 712 3: D08 4: 4BB 5: 000 6: 000 7: 000 8: E8E 0: FFF 1: CDC 2: 719 3: CFF 4: 4B3 5: 000 6: 000 7: 000 8: EB1 0: FFF 1: CD7 2: 710 3: CFE 4: 4C0 5: 000 6: 000 7: 000 8: EA9 0: FFF 1: CD3 2: 70E 3: D00 4: 4C0 5: 000 6: 000 7: 000 8: EA5 0: FF8 1: CD6 2: 71E 3: D07 4: 4B4 5: 000 6: 000 7: 000 8: EB9