how are you? I have a question about the GameBoy camera, did anybody interface it with PIC 16F877A and pic basic pro? I made a code for it but isn't working. I think I don't know how to set the registers so it can start to send me anolog voltage? Can anybody help me? I can show you the code if you want.
Refik, I had some luck with a GB camera and an 8 bit pic. I got analog voltages out but never completed the project. Make sure your hardware is set up properly first. I remember needing one pin pulled up to 5 Vdc. Do you have a schematic of your circuit? I'll dig up my stuff if you want.
TRISA = $FF 'DEFINE TRISA AS INPUT $FF=255 ADCON1 = 0 'PORT A SHOULD BE ANALOG
'DEFINE ALL THE NAMES OF PORTS WHICH WILL BE USED TO CONTROL THE CAMERA symbol GB_LOAD = PORTB.7 SYMBOL GB_READ = PORTB.6 SYMBOL GB_XCK = PORTB.5 SYMBOL GB_START = PORTB.4 SYMBOL GB_SIN = PORTB.3 SYMBOL GB_RESET = PORTB.2 SYMBOL SERIAL_PORT = PORTB.1
'DEFINE FOR LOOP I VAR WORD RESULT_PIXEL VAR BYTE
MAIN:
'START THE CAMERA HIGH GB_RESET LOW GB_SIN LOW GB_LOAD LOW GB_XCK LOW GB_START
'RESET THE CAMERA LOW GB_RESET HIGH GB_XCK HIGH GB_RESET LOW GB_XCK
'ENTER THE REGISTERS 'ADDRESS 1 LOW GB_XCK LOW GB_SIN high GB_XCK low GB_XCK
LOW GB_SIN high GB_XCK low GB_XCK
LOW GB_SIN high GB_XCK low GB_XCK
'REGISTER 1 HIGH GB_SIN high GB_XCK low GB_XCK
LOW GB_SIN high GB_XCK low GB_XCK
LOW GB_SIN high GB_XCK low GB_XCK
LOW GB_SIN high GB_XCK low GB_XCK
LOW GB_SIN high GB_XCK low GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_LOAD HIGH GB_XCK LOW GB_XCK LOW GB_LOAD
'ADDRESS 2 LOW GB_XCK LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
HIGH GB_SIN HIGH GB_XCK LOW GB_XCK
'REGISTER 2 LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
HIGH GB_SIN HIGH GB_XCK LOW GB_XCK
HIGH GB_SIN HIGH GB_XCK LOW GB_XCK
HIGH GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_LOAD HIGH GB_XCK LOW GB_XCK LOW GB_LOAD
'ADDRESS 3 LOW GB_XCK LOW GB_SIN HIGH GB_XCK LOW GB_XCK
HIGH GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
'REGISTER 3 LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
HIGH GB_SIN HIGH GB_XCK LOW GB_XCK
HIGH GB_SIN HIGH GB_LOAD HIGH GB_XCK LOW GB_XCK LOW GB_LOAD
'ADDRESS 4 LOW GB_XCK LOW GB_SIN HIGH GB_XCK LOW GB_XCK
HIGH GB_SIN HIGH GB_XCK LOW GB_XCK
HIGH GB_SIN HIGH GB_XCK LOW GB_XCK
'REGISTER 4 LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_LOAD HIGH GB_XCK LOW GB_XCK LOW GB_LOAD
'ADDRESS 5 LOW GB_XCK HIGH GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
'REGISTER 5 LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
HIGH GB_SIN HIGH GB_LOAD HIGH GB_XCK LOW GB_XCK LOW GB_LOAD
'ADDRESS 6 LOW GB_XCK HIGH GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
HIGH GB_SIN HIGH GB_XCK LOW GB_XCK
'REGISTER 6 LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_LOAD HIGH GB_XCK LOW GB_XCK LOW GB_LOAD
'ADDRESS 7 LOW GB_XCK HIGH GB_SIN HIGH GB_XCK LOW GB_XCK
HIGH GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
'REGISTER 7 LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
HIGH GB_SIN HIGH GB_LOAD HIGH GB_XCK LOW GB_XCK LOW GB_LOAD
'ADDRESS 8 LOW GB_XCK HIGH GB_SIN HIGH GB_XCK LOW GB_XCK
HIGH GB_SIN HIGH GB_XCK LOW GB_XCK
HIGH GB_SIN HIGH GB_XCK LOW GB_XCK
'REGISTER 8 LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
LOW GB_SIN HIGH GB_XCK LOW GB_XCK
HIGH GB_SIN HIGH GB_XCK LOW GB_XCK
HIGH GB_SIN HIGH GB_XCK LOW GB_XCK
HIGH GB_SIN HIGH GB_LOAD HIGH GB_XCK LOW GB_XCK LOW GB_LOAD
'PAUSE 12 MILISECONDS SO THE CAMERA INITIALIZES THE SETTINGS PAUSE 12
'GIVE THE CAMERA SIGNAL TO TAKE PICTURE HIGH GB_START HIGH GB_XCK LOW GB_START LOW GB_XCK
'WAIT 12 MILISECONDS SO THE CAMERA TAKES THE SNAPSHOT PAUSE 12
''LOOK IF READ IS 1 WHILE GB_READ = 0
WEND
'STORE THE PICTURE TO THE EEPROM FOR I = 1 TO 2000 HIGH GB_XCK ADCIN 0, RESULT_PIXEL WRITE I, RESULT_PIXEL LOW GB_XCK NEXT I
FOR I = 1 TO 2000 READ I, RESULT_PIXEL SEROUT SERIAL_PORT, N9600, [#RESULT_PIXEL] NEXT I