Skip to content

Attempting to take over TCD0 on a AT412. Why do I fail? #494

Answered by SpenceKonde
hmeijdam asked this question in Q&A
Discussion options

You must be logged in to vote

What value do you see for TCD0.CMPBCLR? I don't see you writing that to set TOP anywhere. I think its reset value is 0x000, so it's overflowing every timer tick and never getting higher than 0.

If that's not it, print out the values of all the registers of TCD0, writing the results to Serial.

also - Serial.println(value,BIN)? you'll probably be happier with Serial.printHex() - prints most types directly as hexadecimal....without pulling in quite as much bloat as the normal print methods at some point I'm planning to release a microscopic serial librariy.

Also, this sort of construction is evil (mayber "evil" is too dramatic - "bad" may be more correct) - only do this when it's actually wh…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@hmeijdam
Comment options

Answer selected by hmeijdam
Comment options

You must be logged in to vote
3 replies
@SpenceKonde
Comment options

@hmeijdam
Comment options

@hmeijdam
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants