{"action":"created","issue":{"url":"https://api.github.com/repos/d-ronin/dRonin/issues/946","repository_url":"https://api.github.com/repos/d-ronin/dRonin","labels_url":"https://api.github.com/repos/d-ronin/dRonin/issues/946/labels{/name}","comments_url":"https://api.github.com/repos/d-ronin/dRonin/issues/946/comments","events_url":"https://api.github.com/repos/d-ronin/dRonin/issues/946/events","html_url":"https://github.com/d-ronin/dRonin/pull/946","id":151509657,"number":946,"title":"Flight: Fix F3 version of pios_internal_adc.c","user":{"login":"jihlein","id":3869782,"avatar_url":"https://avatars.githubusercontent.com/u/3869782?v=3","gravatar_id":"","url":"https://api.github.com/users/jihlein","html_url":"https://github.com/jihlein","followers_url":"https://api.github.com/users/jihlein/followers","following_url":"https://api.github.com/users/jihlein/following{/other_user}","gists_url":"https://api.github.com/users/jihlein/gists{/gist_id}","starred_url":"https://api.github.com/users/jihlein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jihlein/subscriptions","organizations_url":"https://api.github.com/users/jihlein/orgs","repos_url":"https://api.github.com/users/jihlein/repos","events_url":"https://api.github.com/users/jihlein/events{/privacy}","received_events_url":"https://api.github.com/users/jihlein/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/d-ronin/dRonin/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/d-ronin/dRonin/labels/flight","name":"flight","color":"fbca04"},{"url":"https://api.github.com/repos/d-ronin/dRonin/labels/status/ready-for-review","name":"status/ready-for-review","color":"bfe5bf"},{"url":"https://api.github.com/repos/d-ronin/dRonin/labels/status/work-in-progress","name":"status/work-in-progress","color":"fef2c0"},{"url":"https://api.github.com/repos/d-ronin/dRonin/labels/targets/open-hardware","name":"targets/open-hardware","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/d-ronin/dRonin/milestones/3","html_url":"https://github.com/d-ronin/dRonin/milestones/Samsara","labels_url":"https://api.github.com/repos/d-ronin/dRonin/milestones/3/labels","id":1508039,"number":3,"title":"Samsara","description":"Things targeted for \"Samsara\", dRonin's 3rd major release.","creator":{"login":"mlyle","id":90903,"avatar_url":"https://avatars.githubusercontent.com/u/90903?v=3","gravatar_id":"","url":"https://api.github.com/users/mlyle","html_url":"https://github.com/mlyle","followers_url":"https://api.github.com/users/mlyle/followers","following_url":"https://api.github.com/users/mlyle/following{/other_user}","gists_url":"https://api.github.com/users/mlyle/gists{/gist_id}","starred_url":"https://api.github.com/users/mlyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlyle/subscriptions","organizations_url":"https://api.github.com/users/mlyle/orgs","repos_url":"https://api.github.com/users/mlyle/repos","events_url":"https://api.github.com/users/mlyle/events{/privacy}","received_events_url":"https://api.github.com/users/mlyle/received_events","type":"User","site_admin":false},"open_issues":157,"closed_issues":47,"state":"open","created_at":"2016-01-15T00:17:44Z","updated_at":"2016-04-27T23:12:58Z","due_on":"2016-07-03T07:00:00Z","closed_at":null},"comments":3,"created_at":"2016-04-27T22:48:27Z","updated_at":"2016-04-28T01:05:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/d-ronin/dRonin/pulls/946","html_url":"https://github.com/d-ronin/dRonin/pull/946","diff_url":"https://github.com/d-ronin/dRonin/pull/946.diff","patch_url":"https://github.com/d-ronin/dRonin/pull/946.patch"},"body":"I've been working on implementing a servo position feedback using an ADC channel.  I'm reading on ADC channel from the actuator task.  I discovered that I could get stable readings from F4 targets, but F3 targets would not read reliably.\r\n\r\nAfter studying pios_internal_adc.c for F3 targets, I noticed that the ADC clock is set (clock divisor set to 16), then both the master and slave (if applicable) ADCs are calibrated.  So far so good.  Then the clock divisor is changed to 256.  I don't think the ADC clock should be changed after calibration is done.  \r\n\r\nAfter removing the code code that changes the divisor after calibration, the F3 targets now return stable readings.\r\n\r\nI'm not sure what the reasoning behind the change from divide by 16 to divide by 256, but that seems to be the cause of the issue I was seeing.\r\n\r\nTested on Sparky 1, on both ADC0 and ADC1."},"comment":{"url":"https://api.github.com/repos/d-ronin/dRonin/issues/comments/215277874","html_url":"https://github.com/d-ronin/dRonin/pull/946#issuecomment-215277874","issue_url":"https://api.github.com/repos/d-ronin/dRonin/issues/946","id":215277874,"user":{"login":"jihlein","id":3869782,"avatar_url":"https://avatars.githubusercontent.com/u/3869782?v=3","gravatar_id":"","url":"https://api.github.com/users/jihlein","html_url":"https://github.com/jihlein","followers_url":"https://api.github.com/users/jihlein/followers","following_url":"https://api.github.com/users/jihlein/following{/other_user}","gists_url":"https://api.github.com/users/jihlein/gists{/gist_id}","starred_url":"https://api.github.com/users/jihlein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jihlein/subscriptions","organizations_url":"https://api.github.com/users/jihlein/orgs","repos_url":"https://api.github.com/users/jihlein/repos","events_url":"https://api.github.com/users/jihlein/events{/privacy}","received_events_url":"https://api.github.com/users/jihlein/received_events","type":"User","site_admin":false},"created_at":"2016-04-28T01:05:02Z","updated_at":"2016-04-28T01:05:02Z","body":"I'm looking into why, but setting to Div256 causes the target to enter a bootloop.  Div64 works.  I'll get some throughput numbers a little later."}}