c - PIC12F675 set timer function . What exactly it does -


please explain set timer function in code. , number 60535 used set timer function.

case 0: if (int_innercount == 0)         {            output_low(pin_b5);            output_low(pin_b6);            output_low(pin_b1);            int_innercount = 1+int_innercount;            set_timer1(60535);         }         else if (int_innercount == 1)         {            output_high(pin_b1);            int_innercount = 1+int_innercount;            set_timer1(65035);         }         else         {            output_low(pin_b1);            int_count = 1+int_count;            int_innercount = 0;            set_timer1(65035);         }      break; 

it loads 16 bit unsigned value timer1 register. because pic 8-bit machine, loading 16 bit timer take 2 8 bit assignments. function provided convenience.

the manual says nothing atomicity. it's best assume assignment non-atomic.


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -