- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello
I use microphone and Analog-to-Digital Converter MCP3204. I connect to the SPI, pins 10, 11, 12, 13 (Arduino Board).
In code:
for (int n = 0; n < 1000000; n++){// it's 1MHz
CS->write(1);
CS->write(0);
But this cycle is performed for 30 seconds. What should I do so that it runs in 1 second?
I wand create a digital voice recorder on the Intel Edison.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello nvozniy,
I have two ideas, one more complicated than the other but also more accurate. My first idea is that you take the value of n (currently 1000000) and simply divide it between thirty and this should make the cycle last one thirtieth of the current time (currently ~30 seconds) making the cycle last ~1 second. My second idea, is that you take the time of when the cycle begins and then compare it on your cycle to the current time and break the cycle when one second has passed. This last option is a little bit more complex but it could be also more accurate. If you don't mind as much about accuracy then you should be fine with the first option.
I hope this helps.
-Peter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
You should use the I2S bus which is for audio operations:
For faster GPIO access see here:
http://www.i-programmer.info/programming/hardware/8770-exploring-edison-fast-memory-mapped-io.html?s... Exploring Edison - Fast Memory Mapped I/O
Flo1991
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello nvozniy,
Did Flo1991's suggestion or mine helped you? Please let us know, we would be glad to help in case you still need assistance.
-Peter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Thank you, Flo1991.
I can not find ADC 44.1 KHz with I2C interface, so could not test. This method should to work.
Later, I shall necessarily write about the result.

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