uXe wrote:...are those pins available on the board though? and is there software library support for two SPI ports?
Right now I can't locate SPI1_SCK on the Pin Assignment table, but the other pins are broken out. I haven't had any luck with software yet. I tried btmcmahan's library in slave mode using the example code, but nothing happens (I was using an Arduino as the master).
uXe wrote:Another option which does have support for two SPI ports is the good old Maple Mini, and it looks like they can be found pretty cheaply on eBay...
Thanks, I may look into this some time.
Jazzmarazz wrote:Well, I was in the process of moving when this thread started and then I got a new job ... and more than a month later, I have my home office mostly set up. I can finally dedicate some time and effort into this project.
Great to hear you're set up in your new place and on board for the project.
Jazzmarazz wrote:Also worth mentioning, I am working with a 16MHz arduino pro mini so I have to focus on sketch streamlining. The reason I set aside my Teensy is because they are expensive and anyone wanting to build this into a GB will be put off by the Teensy's price and size. I also think that the CPP to machine code conversion for the Teensy's CPU is worse than that of the atmega168.
I suspect you're right that Arduino code will be more efficient that Teensyduino code, but I have to agree with friendofmegaman that you're going to be very pushed for cycles, especially using an interrupt and doing a serial write straight away.
Jazzmarazz wrote:Speaking of which, it mag be economical to test a serially clocked parallel-in, serial-out shift register and process all five pins on the PC.
Do you mean converting CLK, D0, D1, HS, and VS to serial data? Do you plan to send this data to a microcontroller, or are you connecting the DMG to the PC through something else?
Jazzmarazz wrote:I have to go grocery shopping before I can sit down and modify friendofmegaman's PC-side code...
You might want to use this version of the display code which I've modified to use Pygame instead of Pylab. Pylab was extremely slow here...
#!/usr/bin/python
#author: friendofmegaman, rvan
#Display captured frame data on the PC. Expects a 0x1E00 header and four
#pixels per byte. Uses pygame, which is faster than pylab's scatter.
import pygame
from pygame.locals import *
upscale = 2
width = 160
height = 144
grey = []
grey.append((224,248,208))
grey.append((136,192,112))
grey.append((52, 104, 86))
grey.append((8, 24, 32))
fd = open('/path/to/screen.bin', 'rb')
data = fd.read()
fd.close()
frames = data.split('\x1E\x00')
print len(frames), 'frames'
class Pixel:
x = 0;
y = 0;
def __call__(self, col):
for upy in range(upscale):
for upx in range(upscale):
window.set_at(((self.x)*upscale+upx,
(self.y)*upscale+upy), grey[col])
self.x +=1
if self.x==160:
self.x = 0
self.y +=1
pixel = Pixel()
window = pygame.display.set_mode((width*upscale, height*upscale))
for frame in frames:
# First and last frames can be smaller than that (because there's small
# chance we start capture right at the beginning of the frame)
if len(frame)!=5760:
continue
for y in range(144):
for x in range(160):
bit_offset = y*320+x*2
array_offset = bit_offset/8
byte_offset = bit_offset%8
byte = ord(frame[array_offset])
px = (byte>>byte_offset)&0b11
pixel(px)
pygame.display.update()
quit = False
while not quit:
event = pygame.event.wait()
if event.type == pygame.QUIT or event.type == KEYDOWN and \
event.key == K_ESCAPE:
quit = True