PythonLinux / Raspberry pi
2114
"It is static or is it memorex?"
This application is born from the requirment of the another project in the Works which is my Commodore Pet Restoration.
No Boot and no Video at this time.
Step 1) Pull Video Memory and test it. (as well as order new via ebay).
Now that I have it off the motherboard .. Now for the testing.
Using my Raspberry Pi5.
Load Raspian 64 Bit OS.
Use PyThon App Programming.
Utalize gpiod library.
I attach it to a breadboard.
Wire it up with all Address (A0..A9) & Data D1 - D4.
Chip Select and Write Enable.
Check PDF For Information and Read/Write Timing.
Write App.
Test. Test. Test. Improve.
Video.
Web Page. :-) Thats it.
TECHNOLOGIESPython
DEVELOPER ROLEDeveloper
RELEASE DATEJun 6, 2023
Compiled Assets Gallery
📁 You Tube Vid.
📁 Work Pic
📁 Work Pic
📁 Work Pic
📁 Work Pic
📁 Specs
📁 Compressed
{`#!/usr/bin/env python3
########################################################################
# Filename : 2114TestMem.py
# Description : Test a 2114 Static Ram Memory For Errors
# Author : rbettinelli
# modification: 3/29/2024
########################################################################
import gpiod
from signal import pause
import random
#var
addrCount = 1024
num = [0] * addrCount
wf = ["Write 0000","Write 1111","RANDOM 0000-1111"]
global a0,a1,a2,a3,a4,a5,a6,a7,a8,a9
ax_lines= [6,13,19,5,22,27,17,26,23,24]
#Open gpiod & Set 2114 Address Lines and Chip Select and Write Enable Pins.
chip = gpiod.Chip('/dev/gpiochip4')
for idx, line_num in enumerate(ax_lines):
globals()[f'a{idx}'] = chip.get_line(line_num)
globals()[f'a{idx}'].request(consumer="chip a{idx} line", type=gpiod.LINE_REQ_DIR_OUT)
globals()[f'a{idx}'].set_value(0)
cs = chip.get_line(12)
cs.request(consumer="chip cs line", type=gpiod.LINE_REQ_DIR_OUT)
cs.set_value(0)
we = chip.get_line(18)
we.request(consumer="chip we line", type=gpiod.LINE_REQ_DIR_OUT)
we.set_value(0)
# This is not called but to ensure working Pi
def my_Info(self):
gpiod.is_gpiochip_device("/dev/gpiochip4")
with gpiod.Chip("/dev/gpiochip4") as chip:
info = chip.get_info()
print(f"{info.name} [{info.label}] ({info.num_lines} lines)")
# Chip Select
def cs_High():
cs.set_value(1)
def cs_Low():
cs.set_value(0)
# Write Enable
def we_High():
we.set_value(1)
def we_Low():
we.set_value(0)
# Set Address Line
def set_Address( addr):
binary_address = bin(addr)[2:].zfill(10) # Convert address to binary string
bout = ""
for pin, bit in zip([a0, a1, a2, a3, a4, a5, a6, a7, a8, a9], binary_address):
if bit == '1':
pin.set_value(1) # Turn pin on
bout += "1"
else:
pin.set_value(0) # Turn pin off
bout += "0"
# Follow Chip Timing PDF To Write Data To Chip
# Keep in mind data Lines Are Set locally to allow for dynamic OUT / IN Swapover * Release Required.
def write_Data( addr, data):
set_Address(addr)
cs_Low()
we_Low()
binary_address = bin(data)[2:].zfill(4)
d1 = chip.get_line(25)
d1.request(consumer="chip d1 line", type=gpiod.LINE_REQ_DIR_OUT)
d2 = chip.get_line(16)
d2.request(consumer="chip d2 line", type=gpiod.LINE_REQ_DIR_OUT)
d3 = chip.get_line(20)
d3.request(consumer="chip d3 line", type=gpiod.LINE_REQ_DIR_OUT)
d4 = chip.get_line(21)
d4.request(consumer="chip d4 line", type=gpiod.LINE_REQ_DIR_OUT)
bout = ""
for pin, bit in zip([d1, d2, d3, d4], binary_address):
pin.set_value(0)
if bit == '1':
pin.set_value(1)
bout += "1"
else:
pin.set_value(0)
bout += "0"
#print(bout)
cs_Low()
we_Low()
d1.release()
d2.release()
d3.release()
d4.release()
# Follow Chip Timing PDF To Read Data From Chip
# Keep in mind data Lines Are Set locally to allow for dynamic OUT / IN Swapover * Release Required.
def read_Data( addr):
set_Address(addr)
cs_Low()
we_High()
d1 = chip.get_line(25)
d1.request(consumer="chip d1 line", type=gpiod.LINE_REQ_DIR_IN)
d2 = chip.get_line(16)
d2.request(consumer="chip d2 line", type=gpiod.LINE_REQ_DIR_IN)
d3 = chip.get_line(20)
d3.request(consumer="chip d3 line", type=gpiod.LINE_REQ_DIR_IN)
d4 = chip.get_line(21)
d4.request(consumer="chip d4 line", type=gpiod.LINE_REQ_DIR_IN)
b1 = d1.get_value()
b2 = d2.get_value()
b3 = d3.get_value()
b4 = d4.get_value()
binary_str = str(b1) + str(b2) + str(b3) + str(b4)
decimal_value = int(binary_str, 2)
cs_Low()
we_High()
d1.release()
d2.release()
d3.release()
d4.release()
#print(binary_str)
return decimal_value
# Set Number Sequence to Check 1=0000, 2=1111, 3=Random 0000-1111, Write Data to RAM
def setNumseq(p):
for x in range(addrCount):
if p == 0:
num[x] = 0
elif p == 1:
num[x] = 15
elif p == 2:
num[x] = random.randint(1, 15)
write_Data(x, num[x])
#print("Write : ",x, num[x])
# This Read from RAM and Compairs to Original Array.
# If OK .. great. If NOT it will show Error and then Percentage of Error (Just for the fun of it)
def check_num_seq():
ok = 0
for x in range(addrCount):
k = read_Data(x)
#print("Read : ",x,num[x],k)
if (num[x] == k):
ok += 1
else:
print("Read Error @ addr ",x, "Written : ",num[x],"Read :",k)
if (ok == addrCount):
print ("THIS WRITE FUNCTION OK!!")
else:
print("Read Error(s)! Count",ok,"/", addrCount," : ", 100-(ok/addrCount)*100,"%")
# Main Routine.
if __name__ == '__main__':
#myChip.myInfo()
print( "2114 Static Ram Tester.")
print( "-----------------------")
print( "rbettinelli 3-31-2024 ")
print( "-----------------------")
print( "Lets Test this RAM.")
#Run all 3 Tests.
for x in range(0,len(wf)):
print("Testing ",x,")", wf[x])
setNumseq(x)
check_num_seq()
print("End of Line.")
`}
</code>
</pre>
</Card.Content>
</Card>
<Card className="mb-2">
<Card.Header className="border-b border-gray-300">App OUTPUT</Card.Header>
<Card.Content>
<pre>
<code>
{`>>> %Run 2114TestMem.py
2114 Static Ram Tester.
-----------------------
rbettinelli 3-31-2024
-----------------------
Lets Test this RAM.
Testing 0 ) Write 0000
THIS WRITE FUNCTION OK!!
Testing 1 ) Write 1111
THIS WRITE FUNCTION OK!!
Testing 2 ) RANDOM 0000-1111
Read Error @ addr 0 Written : 2 Read : 8
Read Error @ addr 1 Written : 6 Read : 8
Read Error @ addr 3 Written : 9 Read : 8
Read Error @ addr 7 Written : 7 Read : 8
Read Error @ addr 31 Written : 3 Read : 8
Read Error @ addr 63 Written : 4 Read : 8
Read Error @ addr 127 Written : 15 Read : 8
Read Error(s)! Count 1017 / 1024 : 0.68359375 %
End of Line.`}
📁 CODE