barthess wrote:Any way I have pushed changes to github. But I am unable to test them in hardware today.
@avrhack could you test it? Are changes suited your thoughts?
So what I've done with your code is this:
- Ran the pre-changed code against PB7; that works perfectly with timer 4 ch 1+2, AF2
- Ran the changed code with the updated local PWM config etc. set up to work as the original code did, still against PB7; that works perfectly
- Ran the changed code set to use PC13, no changes other than port, pin, AF (4 instead of 2), timer (1 instead of 4) and channels (0,1 instead of 1,2); that doesn't work unfortunately
- Cleared the PC13 pad using normal Chibi pad commands and then set it, to confirm it wasn't a drive-strength issue with that pin per your earlier advice. That works perfectly as a reset and on my logic analyser I can also see the 'presence' pulse reply from the device so confirming that the pin drive is fine
So I conclude that a) my hardware is working on both PB7 and PC13, but something it not working with the PWM set to use the complementary output.
What I need to do next is to single-step through the code with the debugger but I've run out of time this evening and I'm away for work for a few days so I will continue my investigations later in the week. Obviously if I can find where the issue lies and whether it's the configuration parameters I've given as opposed to the code changes you've made then great. If I think it's something in the code I'll let you know of course. And hopefully I won't find that it's just the timer can't work in the way I need it do, using a complementary output only!
More to follow