Piggybacking and -bellying

Piggybacking and -bellying

Postby Janke » Tue Oct 03, 2017 2:04 pm

PB.jpg
Piggybacked battery, piggybellied EEPROM


Running out of both flash and RAM memory (due to several large fonts for big LED matrix displays), I added 24LC512 EEPROM chips to all my EzSBC1 boards, instantly giving me 64 kBytes of non-volatile memory readable and writable from within the BASIC Code - something you cannot do with the EzSBC's own flash memory.

Adding the chip was a cinch, in the top part of the photo you see it soldered, "piggybellied" to the GND and 3.3 volt pins on the board - no other attachment is necessary. These two pins just happen to be the outermost ones on the board, and there's enough space for the DIP package (with flattened pins) under the USB connector - perfect!

Of the 8-pin EEPROM chip, pins 1 to 4 and 7 are all grounded (pins 1-4 to board pin 1, pin 7 to board pin 39 with the short U-shaped wire you see in the photo), while pin 8 is connected to the 3.3 volt Vref pin 40 (current draw is max 5 mA during programming, 0.4 mA during reading; well within specs of the board's 3.3 volt regulator.)

EEPROM pins 5 and 6 are connected to the board's pins 5 and 4 respectively (red & black wires), with 2.2 K pull-up resistors to 3.3 volt Vref (board pin 40), completing the connections for the I2C interface - simplicity itself! The necessary code for accessing the EEPROM is simple, an example:

' setup:

I2CINIT(400000) ' EEPROM clock 400Khz
I2CTIME(50) ' timeout 50 ms

' in the code below, 0xa0 = EEPROM chip address when pins 1 to 3 are connected to GND
' Index = 16-bit EEPROM address
' NOTE: a write must NOT straddle an EEPROM 128-byte page boundary!

' write 32-byte m$:

I2CWR16(0xa0,Index,m$,32)

' wait for completed write (about 5 ms):

REPEAT
UNTIL I2CBUSY(0xa0)=0

´read 32-byte n$:

n$=I2CRD16$(0xa0,Index,32)

. . .

While doing the above piggybellying, I also piggybacked a lithium battery holder to the top of the board, now always keeping the RTC in time when when the board is not powered. A small 3-volt 1220 type lithium battery will keep the RTC running for at least half a year without power to the board. The battery holder's negative pin is directly soldered to pin 1 on the board, while the positive pin is connected via a short wire to pin 38, Vbat. No other attachment is necessary here, either. The small battery and its holder don't interfere with either the USB jack or the reset button, as you can see in the bottom photo.

An aside: The RTC on my boards didn't keep time very well originally (all boards were losing several seconds in a week), until I changed the two small SMT RTC caps from 22 pF to 10 pF each - now, one of my boards has kept virtually perfect time to within a second in over 40 days, while the others only gain or lose a fraction of a second per day. The tolerance of the RTC oscillator crystal is some 25 ppm, i.e. about 1.7 seconds per day, so some variation is inevitable (also due to capacitor tolerances).
Janke
 
Posts: 25
Joined: Mon Feb 20, 2017 2:48 pm

Return to EzSBC1

Who is online

Users browsing this forum: No registered users and 1 guest