- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I really, Really, REALLY need to be able to switch GPIO pins from out to in faster. Surely there is a way to do this that doesn't require calling the Linux file I/O API (???!!!) like mraa_gpio_dir() does. The latency involved in this one simple mraa function is costing us over $100 per unit. If I can get this worked out I can read my sensors directly from GPIO and I don't need a PIC (and the associated cost and complexity) to do it for me. I mean the idea of adding additional computing resources to a platform suffering from an over abundance of processing power is just silly. Especially when all I need to do is read a few DTH11/22s.
I know that the actual hardware part of this works pretty quickly. I can generate the reset pulse then call mraa_gpio_dir() and see it switch almost immediately because I see the sensor able to drive the pin for the 80us presence pulse and all 40 subsequent bits of data. But I don't get control back quickly enough to start reading the pulses. I miss the presence pulse and 6-8 bits of the data. Is the actually hardware switching done by this code from mraa_gpio_dir() maybe?
if (advance_func->gpio_dir_replace != NULL) { return advance_func->gpio_dir_replace(dev,dir); } if (advance_func->gpio_dir_pre != NULL) { mraa_result_t pre_ret = (advance_func->gpio_dir_pre(dev,dir)); if (pre_ret != MRAA_SUCCESS) { return pre_ret; } }
<snark>
I've heard the "you shouldn't bit-bang under Linux" argument and I see the point, but there are very sound reasons (economics being a good one) to be able to interface to external components like the DHT22/11's via the GPIO. I mean it's the IoT for cryin' out loud. You wanna put Galileo/Edison in everything from waffle irons to tractors, you're gonna need to do a little more than blink LEDs. Well maybe not for the waffle iron application ...
</snark>
Any pointers would really be appreciated.
Thx,
Dallas
- Tags:
- Internet of Things
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
as a workaround for 1-wire protocol you might consider using a diode and 2 GPIO?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yeah, we're pursing that now. At first I couldn't get it to work but I believe we boarded it up wrong. Eat's a lot of pins but I can live with it if I can leave off the PIC and associated I2C uart and muxes etc. ad infinitum.
Thanx for the quick response Matthias!

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page