Cpu saturation?

Status
Not open for further replies.

emarsh

Member
This is a conceptual question as much as anything.

The project that I'm working on consists of a touchscreen, Raspberry Pi A+, a Teensy LC and a bunch of sensors. I'm using the Teensy to poll the sensors once every 20ms and once it has done so it pushes a pin low. The Pi then gets the data from the Teensy via i2c.

I've been looking at the data streams with a logic analyzer and it takes about 15ms to perform the data transfer. It takes about the same amount of time get the data from the sensors, though most of that time is spent in a delay() waiting for the barometer to do it's thing with oversampling.

I'm using the LC because it's inexpensive and easy to get to both sets of i2c ports. The datacomm is done via Wire and Wire1.

I'm wondering if I might need to worry about cpu saturation. Is there a way to see what the cpu usage is on the Teensy? My gut feeling is that I'm probably OK but I though that it's worth asking about.
 
I'm wondering if I might need to worry about cpu saturation.

If you're using the Wire library in slave mode, with onRequest(), there's unlikely to be any issue.

Is there a way to see what the cpu usage is on the Teensy?

The usual way involves digitalWriteFast() before and after functions which use the CPU. Then watch with an oscilloscope, or just use a DC voltmeter for an average number.

My gut feeling is that I'm probably OK but I though that it's worth asking about.

You're probably ok, but it can depend on the code details, which we can't see.
 
Status
Not open for further replies.
Back
Top