DESIGNCYCLETHE
ADVANCED TECHNIQUES FOR DESIGN ENGINEERS
■ BY FRED EADY
A UNIVERSAL MICRO DESIGN
When I’m not writing, I’m soldering. With that, I figure most of you are not
looking down the sights of a soldering iron as much as I am. So, instead of
subjecting you to soldering up my SERVO-inspired experimental micro-SD
card interface, I decided to design a simple and super-low-cost microSD
interface card that you can build on your bench.
Our EDTP microSD Interface Card is wired to operate in SPI mode, thus
allowing it to attach to any microcontroller capable of communicating via a
SPI portal. However, you know me. If I went to the trouble of putting some
fiberglass and copper under a microSD card socket, I’m going to come up
with a microcontroller board to support the microSD card that gets clicked
into that microSD card socket.
54 November 2010
NO PIC18LF4620??
Nope. Not this time. The venerable PIC18LF4620
microcontroller that has supported so many Design Cycle
projects is being kicked to the curb this month in favor of
the USB-enabled and pin-compatible PIC18F46J50.
The J in PIC18F46J50 tells us that this particular
microcontroller is USB capable. The PIC18F46J50 is also a
member of the nano Watt XLP family which means it
sleeps hard drawing only 850 nA while running its built-in
real time clock/calendar. If the PIC18F46J50’s RTCC is not
required, sleep current can drop as low as 13 nA.
Source voltages between 2.0 volts and 3. 6 volts are
welcomed by the PIC18F46J50. There are 15 5.0 volt
tolerant I/O pins available if you choose to use the 44-pin
TQFP version of the PIC18F46J50. Its PORTB and PORTC
I/O pins retain the high current sink and source values of
25 mA that are normally found only on the 5.0 volt PIC
variants. With respect to on-chip peripherals, the
PIC18F46J50 generally has two of everything as compared
to the PIC18LF4620. This is possible due to the inclusion
of a feature called Peripheral pin select. Peripheral Pin
Select allows the programmer to map certain
PIC18F46J50 I/O pins to built-in peripherals.
Fred Eady’s First Rule of Embedded Computing comes
into play here. The PIC18F46J50 has more goodies than
the PIC18LF4620. However, the PIC18F46J50 pays for
these additional goodies with SRAM and EEPROM. The
PIC18F46J50 rings in with 3,776 bytes of SRAM versus
the PIC18LF4620’s 3,986 bytes of SRAM and 1,024 bytes
of EEPROM. Thus, as the Fred Eady’s First Rule of
Embedded Computing states, “Nothing is free.” The
PIC18F46J50 has the ability to redeem itself as far as its
absence of EEPROM is concerned in that under program
control, the PIC18F46J50 can emulate EEPROM with its
program Flash. While both the PIC18LF4620 and
PIC18F46J50 offer EEPROM alternatives, let us not forget
that both microcontrollers can also deposit data into a
microSD card ATM.
A UNIVERSAL PIC18F46J50 DESIGN
The only way that I can think of to create a “universal”
microcontroller design is to make all of the
microcontroller’s I/O and peripherals available to the
programmer/designer. Again, Fred Eady’s First Rule of
Embedded Computing is observed. The “universal”
microcontroller design’s printed circuit board (PCB)
contains only enough electronic components to support
the base operation of the microcontroller that is supports.
That means that absolutely no external devices have
access to the native universal design, which renders it
virtually useless as an intelligent monitor and control
device. To gain access to the universal design’s