the integer long variable 'count' is dependent on a function parameter 'time'. I want to set the two registers TMR0H and TMR0L to this variable however since this a 16-bit register pair, how do i split the variable, count, into two 8-bit values where TMR0H is obviously larger in terms of the bit position (TMR0H 65536 : 256, TMR0L 128: 1)?
Code:
unsigned long count = ((1000000)/128)*(time/1000);
TMR0H = "HIGHER BITS OF COUNT";
TMR0L = "LOWER BITS OF COUNT";