TCNT1 Number must be positive and less than 64 solution

AVR Assembler Arduino

To store zero in TCNT1 using OUT won’t work.  To set the TCNT1 bits requires this technique.  First, you have to write to TCNT1H then TCNT1L but you can’t use OUT.  Here is the proper way to use assembly language to set TCNT1:

STS TCNT1H, 0x00
STS TCNT1L, 0x00

You, of course can also load those values into R16 then do

STS TCNT1H, R16
STS TCNT1L, R16

If you used this, send some luv and leave a reply! 🙂

Advertisements

About SunKing2

Former web developer, guitar player, started Piano 2012 -yes still doing it! Recovery, sobriety, mental health advocate.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s