{"action":"opened","issue":{"url":"https://api.github.com/repos/indrekluuk/LiveOV7670/issues/8","repository_url":"https://api.github.com/repos/indrekluuk/LiveOV7670","labels_url":"https://api.github.com/repos/indrekluuk/LiveOV7670/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/indrekluuk/LiveOV7670/issues/8/comments","events_url":"https://api.github.com/repos/indrekluuk/LiveOV7670/issues/8/events","html_url":"https://github.com/indrekluuk/LiveOV7670/issues/8","id":332373259,"node_id":"MDU6SXNzdWUzMzIzNzMyNTk=","number":8,"title":"Arduino MEGA2560 connection","user":{"login":"giancarlodomanico","id":8035560,"node_id":"MDQ6VXNlcjgwMzU1NjA=","avatar_url":"https://avatars1.githubusercontent.com/u/8035560?v=4","gravatar_id":"","url":"https://api.github.com/users/giancarlodomanico","html_url":"https://github.com/giancarlodomanico","followers_url":"https://api.github.com/users/giancarlodomanico/followers","following_url":"https://api.github.com/users/giancarlodomanico/following{/other_user}","gists_url":"https://api.github.com/users/giancarlodomanico/gists{/gist_id}","starred_url":"https://api.github.com/users/giancarlodomanico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giancarlodomanico/subscriptions","organizations_url":"https://api.github.com/users/giancarlodomanico/orgs","repos_url":"https://api.github.com/users/giancarlodomanico/repos","events_url":"https://api.github.com/users/giancarlodomanico/events{/privacy}","received_events_url":"https://api.github.com/users/giancarlodomanico/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-14T12:06:12Z","updated_at":"2018-06-14T12:06:12Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\nI would like to connect the OV7670 to a Arduino MEGA bu just looking at your define\r\n#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__))\r\n/*\r\n  B (digital pin 8 to 13)\r\n  C (analog input pins)\r\n  D (digital pins 0 to 7)\r\n*/\r\n\r\n#ifndef OV7670_VSYNC\r\n#define OV7670_VSYNC (PIND & 0b00000100) // PIN 2\r\n#endif\r\n\r\n#ifndef OV7670_PIXEL_CLOCK\r\n#define OV7670_PIXEL_CLOCK_PIN 12\r\n#define OV7670_PIXEL_CLOCK (PINB & 0b00010000) // PIN 12\r\n#endif\r\n\r\n#ifndef OV7670_READ_PIXEL_BYTE\r\n// (PIN 4..7) | (PIN A0..A3)\r\n#define OV7670_READ_PIXEL_BYTE(b) \\\r\n                    uint8_t pinc=PINC;\\\r\n                    b=((PIND & 0b11110000) | (pinc & 0b00001111))\r\n#endif\r\n\r\n// pin 3 to 8Mhz (LiveOV7670Library clock)\r\n#ifndef OV7670_INIT_CLOCK_OUT\r\n#define OV7670_INIT_CLOCK_OUT \\\r\n                    pinMode(3, OUTPUT); \\\r\n                    TCCR2A = _BV(COM2A1) | _BV(COM2B1) | _BV(WGM21) | _BV(WGM20); \\\r\n                    TCCR2B = _BV(WGM22) | _BV(CS20); \\\r\n                    OCR2A = 1; \\\r\n                    OCR2B = 0\r\n#endif\r\n\r\n#endif\r\n\r\nI think there is something wrong.\r\nFor example A0..A3 are not on PORTC but on PORTF, Pin 4..7 are on PG5, PE3,PH3,PH4.\r\nSCL and SDA are not on PC4 and PC5 but on PD0 and PD1.\r\n\r\nBecause Arduino MEGA has a lot of extra port I think it is possible to use a differente wiring, so that 'standard' IO will stay free for other use. This is the wiring I think could work:\r\nSIOC  -> PIN 21 - PD0\r\nSIOD  -> PIN 20 - PD1\r\nVSYNC -> PIN 46 - PL5\r\nHREF -> PIN47 - PL4\r\nPCLK -> PIN49 - PL2\r\nXCLK - > PIN48 - PL3\r\nD0..D7  -> PIN37..PIN30  -> PC0..PC7 (in this way we do need to OR two different port).\r\n\r\nDo you think I'm right ?\r\nIf yes, what are the changes to your code ? \r\nRegards\r\nGiancarlo\r\n\r\n\r\n"}}
{"actor":{"display_login":"giancarlodomanico"}}