Rohbotiker
20.04.2008, 16:04
Hallo,
Ich versuche zurzeit ne Gameboykamera zum Laufen zu bringen, dass will aber nicht so richtig klappen. Alle 16384 (128*128) werden korrekt ausgelesen, und der READ pin geht dann auch wieder auf Low, nur komme ich mit den Kammeraeinstellungen nicht klar.
Mit dem Bild scheine ich die selben Probleme wie hier zu haben
https://www.roboternetz.de/phpBB2/zeigebeitrag.php?t=7504&postdays=0&postorder=asc&highlight=gameboy+camera&start=22
nur wie die das dann geschafft haben ihr Bild brauchbar zu machen steht da nicht
Ich nutze folgenden Code
$regfile = "m48def.dat"
$crystal = 16000000
$baud = 9600
$hwstack = 54
$framesize = 54
$swstack = 74
Declare Sub Highb(byval Axa As Byte)
Declare Sub Lowb(byval Axa As Byte)
Declare Sub Toggleb(byval Axa As Byte)
Config Portb.1 = Input
Config Portc = Output
Config Portd = Output
Config Portc.5 = Input
Config Portc.4 = Input
Config Portc.3 = Input
Config Portc.1 = Input
Config Portb.1 = Input
Config Portb.0 = Output
Dim A As Byte
Dim B As Integer
Dim C As Byte
Dim D As Byte
Dim I As Integer
Dim S As String * 10
Dim S2 As String * 10
Dim S3 As String * 10
Dim Startb As Byte
Dim Sinb As Byte
Dim Loadb As Byte
Dim Resetb As Byte
Dim Xck As Byte
Dim Timeb As Word
Dim V As Word
Dim Daten(8) As String * 8
Dim Daten2(8) As String * 8
Config Portb.1 = Output 'start
Config Portb.2 = Output 'sin
Config Portb.3 = Output 'load
Config Portb.4 = Output 'reset
Config Portb.5 = Output 'xck
Config Portc.2 = Input 'read
Config Portc.3 = Input 'Vout (Adc3)
Portc.2 = 1
Portc.3 = 1
Startb = 1
Sinb = 2
Loadb = 3
Resetb = 4
Xck = 5
Timeb = 10
Daten2(1) = "000"
Daten2(2) = "001"
Daten2(3) = "010"
Daten2(4) = "011"
Daten2(5) = "100"
Daten2(6) = "101"
Daten2(7) = "110"
Daten2(8) = "111"
A = 128
Daten(1) = Bin(a)
A = 12
Daten(2) = Bin(a)
A = 0
Daten(3) = Bin(a)
A = 5
Daten(4) = Bin(a)
A = 1
Daten(5) = Bin(a)
A = 0
Daten(6) = Bin(a)
A = 1
Daten(7) = Bin(a)
A = 1
Daten(8) = Bin(a)
Print Daten(1)
Print Daten(8)
Portb = 0
Waitms 1500
Start Adc
'Reset ----------------------------
Highb Resetb
Waitus Timeb
Lowb Resetb
Waitus Timeb
Highb Xck
Waitus Timeb
Highb Resetb
Waitus Timeb
Lowb Xck
'Parameter laden -------------------
For I = 1 to 8
Lowb Xck
S = Daten(i)
S2 = Daten2(i)
For A = 1 To 3
If Mid(s2 , A , 1) = "1" Then
Highb Sinb
Else
Lowb Sinb
End If
Waitus Timeb
Highb Xck
Waitus Timeb
Lowb Xck
Next A
For A = 1 To 8
If Mid(s , A , 1) = "1" Then
Highb Sinb
Else
Lowb Sinb
End If
Waitus Timeb
Highb Xck
Waitus Timeb
If A <> 8 Then Lowb Xck
Next A
Highb Loadb
Waitus Timeb
Lowb Xck
Waitus Timeb
Lowb Loadb
Next I
Highb Startb
Waitus Timeb
Highb Xck
Waitus Timeb
Lowb Startb
Waitus Timeb
Lowb Xck
'Print "Warten..."
'Wait 1
Print Pinc.2
' Auslesen der Werte ------------
Do
Toggleb Xck
Waitus Timeb
Loop Until Pinc.2 = 1
'Do
Print "Read ist h"
' Wait 1
'Loop
Highb Xck
I = 0
A = 0
Do
I = I + 1
A = A + 1
V = Getadc(3)
Lowb Xck
Waitus Timeb
Highb Xck
Waitus Timeb
If A = 1 Then
S = Str(v)
S = "000" + S
S = Right(s , 4)
Print S
A = 0
End If
Loop Until Pinc.2 = 0
'I = 0
'Do
'I = I + 1
'If I = 128 Then I = 1
' Print I
' Waitms 2500
' S = Str(daten3(i))
' S = "000" + S
' S = Right(s , 4)
' Print S
'Print
'Loop
Do
Loop
Sub Highb(axa As Byte)
Portb.axa = 1
End Sub
Sub Lowb(axa As Byte)
Portb.axa = 0
End Sub
Sub Toggleb(axa As Byte)
Toggle Portb.axa
End Sub
Edit: Hat sich erledigt, scheint jetzt besser zu gehen
Ich versuche zurzeit ne Gameboykamera zum Laufen zu bringen, dass will aber nicht so richtig klappen. Alle 16384 (128*128) werden korrekt ausgelesen, und der READ pin geht dann auch wieder auf Low, nur komme ich mit den Kammeraeinstellungen nicht klar.
Mit dem Bild scheine ich die selben Probleme wie hier zu haben
https://www.roboternetz.de/phpBB2/zeigebeitrag.php?t=7504&postdays=0&postorder=asc&highlight=gameboy+camera&start=22
nur wie die das dann geschafft haben ihr Bild brauchbar zu machen steht da nicht
Ich nutze folgenden Code
$regfile = "m48def.dat"
$crystal = 16000000
$baud = 9600
$hwstack = 54
$framesize = 54
$swstack = 74
Declare Sub Highb(byval Axa As Byte)
Declare Sub Lowb(byval Axa As Byte)
Declare Sub Toggleb(byval Axa As Byte)
Config Portb.1 = Input
Config Portc = Output
Config Portd = Output
Config Portc.5 = Input
Config Portc.4 = Input
Config Portc.3 = Input
Config Portc.1 = Input
Config Portb.1 = Input
Config Portb.0 = Output
Dim A As Byte
Dim B As Integer
Dim C As Byte
Dim D As Byte
Dim I As Integer
Dim S As String * 10
Dim S2 As String * 10
Dim S3 As String * 10
Dim Startb As Byte
Dim Sinb As Byte
Dim Loadb As Byte
Dim Resetb As Byte
Dim Xck As Byte
Dim Timeb As Word
Dim V As Word
Dim Daten(8) As String * 8
Dim Daten2(8) As String * 8
Config Portb.1 = Output 'start
Config Portb.2 = Output 'sin
Config Portb.3 = Output 'load
Config Portb.4 = Output 'reset
Config Portb.5 = Output 'xck
Config Portc.2 = Input 'read
Config Portc.3 = Input 'Vout (Adc3)
Portc.2 = 1
Portc.3 = 1
Startb = 1
Sinb = 2
Loadb = 3
Resetb = 4
Xck = 5
Timeb = 10
Daten2(1) = "000"
Daten2(2) = "001"
Daten2(3) = "010"
Daten2(4) = "011"
Daten2(5) = "100"
Daten2(6) = "101"
Daten2(7) = "110"
Daten2(8) = "111"
A = 128
Daten(1) = Bin(a)
A = 12
Daten(2) = Bin(a)
A = 0
Daten(3) = Bin(a)
A = 5
Daten(4) = Bin(a)
A = 1
Daten(5) = Bin(a)
A = 0
Daten(6) = Bin(a)
A = 1
Daten(7) = Bin(a)
A = 1
Daten(8) = Bin(a)
Print Daten(1)
Print Daten(8)
Portb = 0
Waitms 1500
Start Adc
'Reset ----------------------------
Highb Resetb
Waitus Timeb
Lowb Resetb
Waitus Timeb
Highb Xck
Waitus Timeb
Highb Resetb
Waitus Timeb
Lowb Xck
'Parameter laden -------------------
For I = 1 to 8
Lowb Xck
S = Daten(i)
S2 = Daten2(i)
For A = 1 To 3
If Mid(s2 , A , 1) = "1" Then
Highb Sinb
Else
Lowb Sinb
End If
Waitus Timeb
Highb Xck
Waitus Timeb
Lowb Xck
Next A
For A = 1 To 8
If Mid(s , A , 1) = "1" Then
Highb Sinb
Else
Lowb Sinb
End If
Waitus Timeb
Highb Xck
Waitus Timeb
If A <> 8 Then Lowb Xck
Next A
Highb Loadb
Waitus Timeb
Lowb Xck
Waitus Timeb
Lowb Loadb
Next I
Highb Startb
Waitus Timeb
Highb Xck
Waitus Timeb
Lowb Startb
Waitus Timeb
Lowb Xck
'Print "Warten..."
'Wait 1
Print Pinc.2
' Auslesen der Werte ------------
Do
Toggleb Xck
Waitus Timeb
Loop Until Pinc.2 = 1
'Do
Print "Read ist h"
' Wait 1
'Loop
Highb Xck
I = 0
A = 0
Do
I = I + 1
A = A + 1
V = Getadc(3)
Lowb Xck
Waitus Timeb
Highb Xck
Waitus Timeb
If A = 1 Then
S = Str(v)
S = "000" + S
S = Right(s , 4)
Print S
A = 0
End If
Loop Until Pinc.2 = 0
'I = 0
'Do
'I = I + 1
'If I = 128 Then I = 1
' Print I
' Waitms 2500
' S = Str(daten3(i))
' S = "000" + S
' S = Right(s , 4)
' Print S
'Loop
Do
Loop
Sub Highb(axa As Byte)
Portb.axa = 1
End Sub
Sub Lowb(axa As Byte)
Portb.axa = 0
End Sub
Sub Toggleb(axa As Byte)
Toggle Portb.axa
End Sub
Edit: Hat sich erledigt, scheint jetzt besser zu gehen