Hi all,
I am interfacing a PIC24FJ64GA002 with a GameBoy camera using info from this **broken link removed** in order to display the image on a graphics LCD and to save the image as bitmap to an SD card when a button is pressed using the MDD library by Microchip.
Things work almost well except that when I save the bitmap to the SD card, the gameboy camera sensor experiences interference causing "dead" pixels which will create periodic horizontal lines as part of the bitmap. For example, see the first 3 attached photos.
(The original photos were saved as bitmap and is upside-down as the bitmap format requires pixels to be saved from bottom to top, left to right, but has been flipped vertically and saved as JPEG before being uploaded)
The lines are at the same position regardless of the scene. It changes according to the time taken to write to the SD card (for example, when I change the number of bytes in the write buffer)
Without writing to SD card via fsfwrite, I am able to receive the proper photo with no interference when sending the data via UART. Once I attempt writing to sd card (whatever the data is) when fetching the pixel data , the next few hundreds pixels returned by the camera will be "dead".
The analog camera output is connected to the PIC analog input. I have verified independently that the SD card code is able to read and write files properly on its own with no problems such as corrupted data. I have also verified that the analog input is working properly during the SD card write cycles by connecting the input pin to a 1kHz 1Vpp waveform from my scope and try to take a photo - there are no horizontal stripes like above (see the second last photo)
My only conclusion is that writing to SD card is creating some sort of interference that is sensed by the Gameboy camera, resulting in a distorted image. I try various way such as covering the SD card, covering the gameboy camera with anti-static bags, or by using decoupling capacitor, to no avail. The only thing that removes the stripe is to use my finger to cover the camera lenses totally, which will generate a gray photo. (see the last photo)
Any suggestions on where the interference is coming from or how to remove it? Thanks in advance!
I am interfacing a PIC24FJ64GA002 with a GameBoy camera using info from this **broken link removed** in order to display the image on a graphics LCD and to save the image as bitmap to an SD card when a button is pressed using the MDD library by Microchip.
Things work almost well except that when I save the bitmap to the SD card, the gameboy camera sensor experiences interference causing "dead" pixels which will create periodic horizontal lines as part of the bitmap. For example, see the first 3 attached photos.
(The original photos were saved as bitmap and is upside-down as the bitmap format requires pixels to be saved from bottom to top, left to right, but has been flipped vertically and saved as JPEG before being uploaded)
The lines are at the same position regardless of the scene. It changes according to the time taken to write to the SD card (for example, when I change the number of bytes in the write buffer)
Without writing to SD card via fsfwrite, I am able to receive the proper photo with no interference when sending the data via UART. Once I attempt writing to sd card (whatever the data is) when fetching the pixel data , the next few hundreds pixels returned by the camera will be "dead".
The analog camera output is connected to the PIC analog input. I have verified independently that the SD card code is able to read and write files properly on its own with no problems such as corrupted data. I have also verified that the analog input is working properly during the SD card write cycles by connecting the input pin to a 1kHz 1Vpp waveform from my scope and try to take a photo - there are no horizontal stripes like above (see the second last photo)
My only conclusion is that writing to SD card is creating some sort of interference that is sensed by the Gameboy camera, resulting in a distorted image. I try various way such as covering the SD card, covering the gameboy camera with anti-static bags, or by using decoupling capacitor, to no avail. The only thing that removes the stripe is to use my finger to cover the camera lenses totally, which will generate a gray photo. (see the last photo)
Any suggestions on where the interference is coming from or how to remove it? Thanks in advance!
Last edited: