for reference, this is the commit:
https://github.com/leaflabs/libmaple/commit/12914284f5053d5c83cda8e5f8a944c2957c9f5c
A few API questions
(25 posts) (4 voices)-
Posted 4 years ago #
-
Hi,
I use the last version with the linux chain.
It works beautifully (but i don't use the new stuffs).
I write my code in eclipse... to enjoy the refactoring and the "F3/go to declaration".
Very nice.Is it normal that i have to reset the maple before typing "make install" if i opened a screen to the /dev/ttyACM0 ? Is there a way to avoid that ?
My FM synth is going ahead rather well.
. Midi is working (sparkfun midi shield) : "note on / note off / pitch bend" only for the moment.
. 35156Hz / PWM size : 2048
. Each voices has 3 FM operators (each one has a ADSR env)
. LFO modulation matrix (3 rows only for the moment)The maple can handle in real time 5 voices :-)
Next step, adding some rotary encoders to change the parameters in real time, then a LCD.
I also have to try to reduce the background noise.Cheers,
Xavier
Posted 4 years ago # -
Hi Xavier,
Yes, it's normal to have to reset your Maple if you have a screen opened to its virtual serial port. Due to operating system restrictions, at most one process can claim the port at a time. Thus, the bootloader won't receive the reset signal if you've already got a screen open on it.
I like to use Serial1 for that reason -- it's the fastest USART on the board, and when hooked up to an FTDI chip, I can leave my screen session running and still reprogram the board.
Glad to hear that you've been having a good experience so far. Can you tell us a little bit about how you set up Eclipse? We've been meaning to provide a tutorial on that for a while, but all of us are old-fashioned emacs or vim users, so we haven't gotten around to figuring it out.
Posted 4 years ago # -
Xavier,
The other workaround, of course, is just to close your screen before you try to upload :).
Posted 4 years ago # -
Hi,
I don't compile for ARM in eclipse...
I created a simple project that compile my sources for Linux...
I launch "make *" from an xterm to compile for ARM.Regarding the debugging, since i plugged a 2x20 LCD and use LiquidCrystal, every thing is much easier.
I noticed that writing to LCD took a huge amount of time that broke my real time process.
I made 2 modifications in LiquidCrystal.cpp
I reduced the delay in pulseEnable... don't really tried smaller numbers but those one worked for me... 60 micros instead of 3000 !inline void LiquidCrystal::pulseEnable(void) {
digitalWrite(_enable_pin, LOW);
delayMicroseconds(30);
digitalWrite(_enable_pin, HIGH);
delayMicroseconds(30);
digitalWrite(_enable_pin, LOW);
}And i also moved the pinMode() call from write4bits() to init() function... I'm not sure why that was done every time.
If that works for everybody, that would be great to have this in the main branch.I also could plug rotary encoders with 2 74HC165 shift registers.
Works fine: 6 rotary encoders and 1 button using 3 maple pins ! (still have 3 free pins on the second 74HC165).So much fun with this maple !
Thanks a lot guys, i'll publish soon what i've wrote.Xavier
Posted 4 years ago # -
Xavier,
Thanks for the report. Another user had also made a similar suggestion:
http://code.google.com/p/leaflabs/issues/detail?id=42However, I hadn't tested it, and the comments in LiquidCrystal.cpp made me hesitate to include the patch without doing so. Given two reports that faster timing works, I'll move something like this into master.
Looking at the source, it's also pretty unclear to my why the calls to pinMode() are where they are, in write4bits() as well as write8bits().
I've pushed the following commit into master, which incorporates the changes made by you and structuresound:
https://github.com/leaflabs/libmaple/commit/7e887c28df28e41c9974b87dd7d10433480e8c6bThanks to both of you for the reports!
Posted 4 years ago # -
Thanks for the nice move.
I saw you wrote :// Enable pulse must be > 450 ns. Value chosen here is the max<br /> // of the following two reports:<br /> // http://forums.leaflabs.com/topic.php?id=640&page=2<br /> // http://forums.leaflabs.com/topic.php?id=512<br /> digitalWrite(_enable_pin, HIGH);<br /> delayMicroseconds(30);<br />
I just want to confirm that it also work for me with the value of the other report.
delayMicroseconds(12);
18 microseconds is kind of a lot at 72Mhz in a real time process ;-)
18*72 = 1296 cycles !
It even works with 1 micros at this place... wich is more than twice what the spe csuggest... (450ns)...
As i'm trying to optimize my code, i'm sensitive to this waste of CPU power...Xavier
Posted 4 years ago # -
Xavier,
I've made a branch (liquidcrystal-speed) which should take 32 usec off of LiquidCrystal::pulseEnable().
Can you/will someone try it out and report back so I can merge it into master? Thanks!
Just in case:
$ git pull
$ git checkout liquidcrystal-speed
$ ... test it out ...
$ git checkout masteredit: typo, 37 usec -> 32 usec
Posted 4 years ago # -
Great !
Works fine for me... Thanks :-)Xavier
Posted 4 years ago # -
Great; merged.
Posted 4 years ago #
Reply
You must log in to post.