There are a number of advantages for utilizing an external analog to digital converter (ADC) in a project’s design. The internal ADC of the PIC18F series is limited to 10-bit resolution, while much higher resolution ADCs are available. In addition, high-speed multi-channel conversion is possible utilizing multiple external ADCs and multi-channel ADCs. The MAX1241 is a 12-bit single-channel ADC that has a “7.5µs successive-approximation ADC, a fast track/hold (1.5µs), an on-chip clock, and a high-speed, 3-wire serial interface.” All of these contribute to a great compact analog-to-digital converter, which can be utilized in a number of situations where high-speed sampling (73ksps) is required.
Full Circuit
The source and firmware for the circuit can be found at the bottom of the page. Each section of the circuit is labeled in the schematic. All of the sections and their components are described and discussed below. The part numbers for the components are linked to websites for data and more information when available.
Power Supply
The power supply uses a 9 volt battery and a TC1262-5.0V high-accuracy low-dropout linear voltage regulator to provide a stable 5 volt supply for the microcontroller and the MAX1241. A 1uF (microFarad) polarized decoupling capacitor is necessary on the output of the voltage regulator to prevent power spikes or ripples. A wall wart power supply as low as 5.3V can be substituted for the 9 Volt battery.
Analog Input
The analog input is connected to the A0 pin on the PIC, which is configured to be an analog input, and the AIN pin on the MAX1241. Please note that for the PIC, “The source impedance affects the offset voltage at the analog input (due to pin leakage current). The maximum recommended impedance for analog sources is 2.5 kΩ” (PIC18F2550, pp. 260). In addition, please note that for the MAX1241, “Acquisition time is calculated by: tACQ = 9(RS + RIN) x 16pF where RIN = 9k, RS = the input signal’s source impedance, and tACQ is never less than 1.5µs. Source impedances below 1k do not significantly affect the ADC’s AC performance” (MAX1241, pp. 8 ).
MAX1241
The MAX1241 is a “Low-power, 12-bit analog-to-digital converter (ADC) … [That] operates with a single +2.7V to +5.25V supply. [The MAX1241 features] a 7.5µs successive-approximation ADC, a fast track/hold (1.5µs), an on-chip clock, and a high-speed, 3-wire serial interface” (MAX1241, pp. 1). The bypass capacitors (C2, C3, and C5) are necessary to minimize power input fluctuations.
Microcontroller
The microcontroller used is a Microchip PIC18F2550. I modified the PIC18F2550 Tiny PIC Bootloader assembly file so I could use a 20MHz crystal/resonator at 115,200 baud (the modified bootloader can be found at the bottom of the page). The PIC18F2550 runs at 48MHz using the internal PLL. R1 is a pull-up resistor necessary for operation. C1 is a stabilizing capacitor that is used for the onboard USB voltage regulator, which is not used in this project. The component marked ‘RES’ is a 20MHz resonator.
RS232 Level Converter
The microcontroller USART pins need to be connected to a RS-232 Level Converter to connect to a PC for firmware updates using the Tiny PIC Bootloader. Otherwise, after initial programming they can be left disconnected.
Source and Firmware
The PIC must initially programmed with the ‘SAC_tinybld18F2550usb _20MHz_115200_48MHz’ hex file to program the bootloader on the PIC. Then, using Tiny PIC Bootloader, the hex file can be placed on the chip using the Tiny PIC Bootloader frontend with ’12h 34h 56h 78h 90h’ in the ‘List of codes to send first:’ in the ‘Options’ menu. Please feel free to contact me if you have any problems.
– SAC_tinybld18F2550usb_20MHz_115200_48MHz.hex
– 18F2550 MAX1241 SPI.c (hex)
– 18F2550 MAX1241 int16.c (hex)
do you any circuit for a 2-to-4 level converter?
is a part of the 8psk transmitter and i was wondering what is its circuit…
hi , first would like to thank u for such a great set of tutorials/blog all ur projects are ineresting and informitive and set out very well this is a fab web site. i am intreaged though as the setion “RS232 Level Converter” says
“The micro controller USART pins need to be connected to a RS-232 Level Converter to connect to a PC for firmware updates using the Tiny PIC Bootloader. Otherwise, after initial programming they can be left disconnected.”
that rather suggests that no programming board is needed at all apat from a max232/max233 is this true for brand new chips or just all chips which already have boat loaders/firmware?? and whitch programming board do u prefer and do u use the tiny boat loader to program the pic all ways??
thank u very much for the blog and ur answer
will
Remarkable YouTube video tutorials posted at this web page, I am going to subscribe for regularly updates, for the reason that I don’t would like to miss this series.