{"action":"created","issue":{"url":"https://api.github.com/repos/mossmann/hackrf/issues/559","repository_url":"https://api.github.com/repos/mossmann/hackrf","labels_url":"https://api.github.com/repos/mossmann/hackrf/issues/559/labels{/name}","comments_url":"https://api.github.com/repos/mossmann/hackrf/issues/559/comments","events_url":"https://api.github.com/repos/mossmann/hackrf/issues/559/events","html_url":"https://github.com/mossmann/hackrf/issues/559","id":387252770,"node_id":"MDU6SXNzdWUzODcyNTI3NzA=","number":559,"title":"some probleam with cpld code","user":{"login":"hustpigeon","id":12145816,"node_id":"MDQ6VXNlcjEyMTQ1ODE2","avatar_url":"https://avatars2.githubusercontent.com/u/12145816?v=4","gravatar_id":"","url":"https://api.github.com/users/hustpigeon","html_url":"https://github.com/hustpigeon","followers_url":"https://api.github.com/users/hustpigeon/followers","following_url":"https://api.github.com/users/hustpigeon/following{/other_user}","gists_url":"https://api.github.com/users/hustpigeon/gists{/gist_id}","starred_url":"https://api.github.com/users/hustpigeon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hustpigeon/subscriptions","organizations_url":"https://api.github.com/users/hustpigeon/orgs","repos_url":"https://api.github.com/users/hustpigeon/repos","events_url":"https://api.github.com/users/hustpigeon/events{/privacy}","received_events_url":"https://api.github.com/users/hustpigeon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-04T12:00:39Z","updated_at":"2018-12-04T18:50:16Z","closed_at":null,"author_association":"NONE","body":"![Uploading 图片.png…]()\r\n\r\nhere   process(host_clk_i)\r\n    begin\r\n        if rising_edge(host_clk_i) then    \r\n            if codec_clk_i = '1' then\r\n                -- I: non-inverted between MAX2837 and MAX5864\r\n                data_to_host_o <= adc_data_i xor X\"80\";--高变，低不变\r\n            else\r\n                -- Q: inverted between MAX2837 and MAX5864---q=1 0x80,q=0 0x7f\r\n                data_to_host_o <= adc_data_i xor rx_q_invert_mask;\r\n               ////////according MAX5864, I think when Q invert ， here should be\r\n            /////////data_to_host_o <= adc_data_i xor rx_q_invert_mask + **1;**\r\n          ///////// addition 1 should be plused , for 127 and -127 are complementary\r\n            end if;\r\n        end if;\r\n    end process;"},"comment":{"url":"https://api.github.com/repos/mossmann/hackrf/issues/comments/444213340","html_url":"https://github.com/mossmann/hackrf/issues/559#issuecomment-444213340","issue_url":"https://api.github.com/repos/mossmann/hackrf/issues/559","id":444213340,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NDIxMzM0MA==","user":{"login":"jboone","id":778248,"node_id":"MDQ6VXNlcjc3ODI0OA==","avatar_url":"https://avatars0.githubusercontent.com/u/778248?v=4","gravatar_id":"","url":"https://api.github.com/users/jboone","html_url":"https://github.com/jboone","followers_url":"https://api.github.com/users/jboone/followers","following_url":"https://api.github.com/users/jboone/following{/other_user}","gists_url":"https://api.github.com/users/jboone/gists{/gist_id}","starred_url":"https://api.github.com/users/jboone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jboone/subscriptions","organizations_url":"https://api.github.com/users/jboone/orgs","repos_url":"https://api.github.com/users/jboone/repos","events_url":"https://api.github.com/users/jboone/events{/privacy}","received_events_url":"https://api.github.com/users/jboone/received_events","type":"User","site_admin":false},"created_at":"2018-12-04T18:50:16Z","updated_at":"2018-12-04T18:50:16Z","author_association":"COLLABORATOR","body":"You're technically correct that the negation by inversion introduces a DC bias in the received samples:\r\n\r\nInput | Raw | not[6:0] | Output\r\n-------|-------|------------|----------\r\n+127 | 1111_1111 | 1000_0000 | -128\r\n+1 | 1000_0001 | 1111_1110 | -2\r\n0 | 1000_0000 | 1111_1111 | -1\r\n-1 | 0111_1111 | 0000_0000 | 0\r\n-2 | 0111_1110 | 0000_0001 | +1\r\n-128 | 0000_0000 | 0111_1111 | +127\r\n\r\nHowever, if one were to add an offset to correct for it, you would then have to handle overflow for -128 -> +128. This is because +128 can't be represented by an 8-bit two's complement number. The obvious solution would be to saturate in this case, turning -128 into +127. That would require additional logic and delay through the CPLD. The CPLD is quite small, so it hasn't been practical to add saturation to the CPLD code. Besides, there's a significant DC offset from other parts of the radio. The DC offset added by the CPLD is minor in comparison.\r\n\r\nIf you still want to address this DC offset, I think the best solution is to remove CPLD negation and replace it with additional firmware on the LPC4320 M4 core. There's an interrupt which occurs when a block of baseband samples is available from the SGPIO peripheral. The code that moves that data could perform an inversion with saturation at the same time. The QSUB8 instruction should do the job."}}
{"actor":{"display_login":"jboone"}}