"2^n resolution" counting on Mega 2560


hi,
thanks everybody, , in particular nick gammon, work.
i've tryed nick gammon's sketch on mega 2560: http://forum.arduino.cc/index.php?topic=102566.msg770642#msg770642, , feeding pin 47 mega (blinking @ given frequencies), can see frequencies (and counts) in 2^n order (1,2,4,8,16,32,...), or similar: code on "feeder mega"
code: [select]
void loop() {
digitalwrite(5,high);  //        portd = b00100000; // sets digital pin 5 high
delay(delay_ms);
digitalwrite(5,low);   //        portd = b00000000; // sets digital pin 5 low
delay(delay_ms);
      }

on "feeded mega" above sketch freqs:
  delay_ms  freq
64000          0
32000          1
16000          2
8000          4
4000          8
2000         16
1000         31
  500         61
  250        122
  122        244
  100        244
   50        488
   20        488
   10        488
    5        488
    2        488
    1        800
    0        46002
so, example, same counts (and freq) 2ms or 50ms delay()... suggestion?
thanx in advance.. , sorry bad english
alì

post code.

mark


Arduino Forum > Using Arduino > Programming Questions > "2^n resolution" counting on Mega 2560


arduino

Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support