- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am new to PSoC programming and would like to have suggestions for the best approach to the measurement of time intervals. In pseudocode what I intend to do is the following:
start = now();
interactWithI2CPeripherals();
interval = now() - start;
The time to process the information in the I2C peripherals isn't known at first and I intend to have the time interval measured with a resolution of 1ms.
My first guess is to use a counter with a period of 1KHz and start the counting prior to the I2C interaction and read the counter value when finishing the I2C interface. Is this a good approach or is there a better solution?
Thanx,
Angelo
- Labels:
-
PSoC 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are trying to do this in your code base then 1 Khz counter would
suffice, using capture or just polled. Counter in bits X 1 mS should be
> largest I2C communication time, or account for counter rollover in
your code.
If your need is to establish the time for design purposes, do a trace when you
are debugging.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content