[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4756: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4758: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4759: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4760: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
Open Music Labs Forums • View topic - Serial comm with Maple

Serial comm with Maple

Re: Serial comm with Maple

Postby clee » Sat Jul 07, 2012 7:31 am

clee
 
Posts: 7
Joined: Thu Jul 05, 2012 10:18 pm

Re: Serial comm with Maple

Postby guest » Sat Jul 07, 2012 1:23 pm

thats awesome
glad to hear its working
a number of people have asked how to get the codec data into the computer
and this looks like a pretty good way
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: Serial comm with Maple

Postby clee » Mon Jul 09, 2012 5:44 pm

Yes, the serial ports seems like a pretty good option.

I have done a few tests and with a baud setting of 2000000, a simple python test client can transfer ra 1024 16-bit ints is about 13.5ms while the maple+audio codec shield continues to play the sine wave tone. That's about 151 kB/s including the overhead for my not-very-efficient python code as compared to the theoretical, no-overhead-max of 250 kB/s.

At the next speed above that, 30000000, the connection can't be made, which makes sense given that 2.25 Mb/s is the spec sheet limit on some of the maple's USARTs.

I'm pretty sure things could be faster. I would think options include looking at using dma or use of the other SPI interface (18 Mb/s) might be the way to go.

I put my test doodles in a repo if people would like to look (the sketch is called "upload_play"):
clee
 
Posts: 7
Joined: Thu Jul 05, 2012 10:18 pm

Re: Serial comm with Maple

Postby guest » Fri Jul 27, 2012 4:38 pm

so i did some more digging into the usb problem

the initial problem had to do with the fact
that the maple usb interrupt can not be blocked for more than a few microseconds
which the audiocdec library clearly does quite frequently

so i rewrote the audiocodec library to only take a fraction of a microsecond in the interrupt
and this allowed the maple usb to function again
but now the maple usb interrupt is blocking the audiocodec interrupt
and the data is not getting clocked out to the codec at regular enough intervals
this gives audible clicks in the playback data

im going to look at a few things on a scope
but i think this is the best the maple can do for usb
until the maple usb library is rewritten
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: Serial comm with Maple

Postby diydsp » Fri Jul 27, 2012 5:52 pm

http://diydsp.com is where I teach people Do-It-Yourself Digital Signal Processing for music instruments and other applications.
diydsp
 
Posts: 21
Joined: Mon Dec 19, 2011 10:44 pm

Re: Serial comm with Maple

Postby clee » Fri Jul 27, 2012 9:24 pm

clee
 
Posts: 7
Joined: Thu Jul 05, 2012 10:18 pm

Re: Serial comm with Maple

Postby guest » Mon Jul 30, 2012 6:08 pm

guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: Serial comm with Maple

Postby guest » Mon Jul 30, 2012 6:38 pm

guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: Serial comm with Maple

Postby clee » Sat Aug 04, 2012 10:52 pm

Thank you for the USB code. I'll give it a try. This also gives helped me learn about how the interrupt priorties are set in the libmaple way of doing things.

I've noticed reliability issues with the using the ft232R based breakout naively. The basic tx/rx connection works pretty well at 2Mb/s but eventually there is a transfer failure. It's unpredictable but usually it makes it about 70-100Mb of transfer and it fails. Because it is rare, I haven't pinned down the exact cause of the problem. I need to figure out if I can read error flags from the ftdi interface. There's probably a system that I need to google for.

One guess about the problem is that the USB bus on my linux laptop is occasional off serving something else occasionally and causing a delay in accepting data in the middle of the transfer from the maple---bits overrun the small buffers in the ft232 occurs and the data stream is corrupted.

I'm trying out using the ft2232H instead which has 4k buffers built in. So far I've repeatedly transferred 2kB at about 180-190 kB/s (using the 2,000,000 baud rate seting) for about 2 hours without an error. :-)

[got it from dangerous prototypes http://dangerousprototypes.com/docs/FT2 ... kout_board]
clee
 
Posts: 7
Joined: Thu Jul 05, 2012 10:18 pm

Re: Serial comm with Maple

Postby clee » Wed Aug 15, 2012 1:15 pm

Update: Things are going well using the USART. Both the FT232RL and the FT2232H based breakouts are working well and consistently giving ~186kB/s with bit rates of 2Mb/s in my test code. My reliability issues initially resolved with using hardware flow control and I've started adding to libmaple to make RTS/CTS flow control available in libmaple. [See http://forums.leaflabs.com/topic.php?id ... post-12454 and https://github.com/cleemesser/libmaple]

However, I think that at least part of my reliability issue was due to a boarderline bad jumper cable, because after a recent cleanup and change of many of the wires, I can't reproduce the error anymore. I really need to get a logic analyzer and my oscilloscope working again.

The next step is to try SPI with its 18Mb/s bandwidth. I've started trying out the olimex maple clone as well, in part, because it has a nice angled UEXT connector which makes USART3 and SPI available even when the audio codec board is mated to the maple.
clee
 
Posts: 7
Joined: Thu Jul 05, 2012 10:18 pm

Previous

Return to Audio Codec Shield

Who is online

Users browsing this forum: No registered users and 0 guests


cron