Fabigode Posted October 1, 2011 Report Share Posted October 1, 2011 Hi guys! I want to capture the frequency of a square wave signal, using LPC core. But MIOS system doesn't have this "peripheral module" avaiable. How can I directly access these hardware feature of LPC, mixing a MIOS application with these need that I have? Do I need to turn off some MB module on mios config? Will I have some conflict problem between this directly hardware access and MIOS access? Thanks in advance! Quote Link to comment Share on other sites More sharing options...
TK. Posted October 1, 2011 Report Share Posted October 1, 2011 Hi, I can give you a working example soon, because porting the CV Autotune application from STM32 to LPC17 is on my TODO list :) -> http://svnmios.midibox.org/listing.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fexamples%2Fcv_autotune%2F Do I need to turn off some MB module on mios config? this won't be required. Timers LPC_TIM0, LPC_TIM1 and LPC_TIM2 are not allocated as long as they haven't been initialized via MIOS32_TIMER_Init() Will I have some conflict problem between this directly hardware access and MIOS access? no, but you have to take care that the application doesn't use these timers (there is no automated conflict detection/reporting) Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
TK. Posted October 1, 2011 Report Share Posted October 1, 2011 Addendum: I remember that the IRQ handler has to be disabled via the mios32_config.h file, otherwise you won't be able to create an own. And I noticed that the names of the IRQ handlers were taken from STM32 in LPC17xx/mios32_timer.c - I corrected the names! E.g.: #define MIOS32_DONT_ALLOCATE_TIMER0_IRQ 1 Please update your repository. Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
TK. Posted October 3, 2011 Report Share Posted October 3, 2011 I adapted the CV Autotune application to LPC17 and it's working fine! :) -> http://svnmios.midibox.org/listing.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fexamples%2Fcv_autotune%2F Even if you haven't connected an AOUT module (btw.: you haven't mentioned for which purpose you are planning to use frequency measurements...), the current frequency at the J18.CAN pin will be displayed periodically in MIOS Terminal, which is nice for debugging. Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
Fabigode Posted October 4, 2011 Author Report Share Posted October 4, 2011 I adapted the CV Autotune application to LPC17 and it's working fine! :) -> http://svnmios.midibox.org/listing.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fexamples%2Fcv_autotune%2F Even if you haven't connected an AOUT module (btw.: you haven't mentioned for which purpose you are planning to use frequency measurements...), the current frequency at the J18.CAN pin will be displayed periodically in MIOS Terminal, which is nice for debugging. Best Regards, Thorsten. Hi Thorsten! Thank you for your personal attention!! hehe! :thumbsup: I'm not working on my application yet, because I don't have the LPC module yet. But it is coming!! Postal service here in Brazil is terrible! So for now, I'm just studying the system... My project is completely different from the musical world. I'm developping a digital speedometer and tachometer for use with experimental cars. Then, to capture these sensors, I will need that feature you well showed. I plan to use AOUT to send an analog signal to the ECU (electronic control unit), with some crucial information to the engine operation. I already developed an application with MIOS8, 5 years ago, "midifying" a guitar valve amp. Basicaly, the MB controlled a bunch of relays and opto-couplers that routed the signal for different paths inside the preamp, changing the tone, gain and other things... Lately, I have developed automotive applications. As an off-topic (hehe) my last project was a drive-by-wire controller, using a PIC18F4431: http://www.youtube.com/user/fabigod Now, I'm returning to MIOS world... hehe! :frantics: Thanks again Thorsten... As soon my module arrive, I will start programming... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.