EsotericLabs Posted September 26, 2012 Report Share Posted September 26, 2012 Hello, I'm struggling with software control over the SCS hardware on J10 of an LPC17. I get both tutorial 006 (buttons with debouncing thru FreeRTOS task) and tutorial 15b (absolute encoder thru J5) working. I only changed references to J5 to J10 (Init and get routines) and then both work. Easy! But I could not manage to combine the two. in the 006 tutorial the encoder is treated as two separate buttons. But I added the encoder setup of 015b to App_init; the polling of proper pins for an encoder to APP_SRIO_Service_prepare and the response (send a CC with encoder value) to APP_ENC_notifychange. The RTOS task is still there for sending debounced button responses. But it only reacts to the buttons pressed, not to the encoder I also put the encoder polling code in the task -> no improvement. I also added the encoder response code to the Task function -> no improvement. I looked into the SCS code, but this is still far beyond my understanding. I'd like to have the FreeRTOS mechanism sending out e.g. notes for buttons and cc for the encoder. I understand the FreeRTOS taks is called every 1ms and that it waits 20 mS before sending the button response. But I dont understand when the SRIO_Service_Prepared is called and if it is called - why the ENC_NotifyChange code is not run. And why is the encoder code (pin polling and response sending) not in the Task - would not that be easier? Thanks a lot for any thoughts or examples to look into. Quote Link to comment Share on other sites More sharing options...
EsotericLabs Posted September 28, 2012 Author Report Share Posted September 28, 2012 Hello, I'm struggling with software control over the SCS hardware on J10 of an LPC17. I get both tutorial 006 (buttons with debouncing thru FreeRTOS task) and tutorial 15b (absolute encoder thru J5) working. I only changed references to J5 to J10 (Init and get routines) and then both work. Easy! But I could not manage to combine the two. in the 006 tutorial the encoder is treated as two separate buttons. But I added the encoder setup of 015b to App_init; the polling of proper pins for an encoder to APP_SRIO_Service_prepare and the response (send a CC with encoder value) to APP_ENC_notifychange. The RTOS task is still there for sending debounced button responses. But it only reacts to the buttons pressed, not to the encoder I also put the encoder polling code in the task -> no improvement. I also added the encoder response code to the Task function -> no improvement. I looked into the SCS code, but this is still far beyond my understanding. I'd like to have the FreeRTOS mechanism sending out e.g. notes for buttons and cc for the encoder. I understand the FreeRTOS taks is called every 1ms and that it waits 20 mS before sending the button response. But I dont understand when the SRIO_Service_Prepared is called and if it is called - why the ENC_NotifyChange code is not run. And why is the encoder code (pin polling and response sending) not in the Task - would not that be easier? Thanks a lot for any thoughts or examples to look into. Solved! Leave the buttons to the FreeRTOS task and the encoders to Service_Prepare. Dont mix the encoders and the buttons, so leave pin 0 and 1 out of the TASK_J5_Scan function. Newbie learning SOO much. Quote Link to comment Share on other sites More sharing options...
Duggle Posted October 9, 2012 Report Share Posted October 9, 2012 What is the "SCS hardware" ? (I don't know what project you're talking about.) Quote Link to comment Share on other sites More sharing options...
EsotericLabs Posted October 9, 2012 Author Report Share Posted October 9, 2012 What is the "SCS hardware" ? (I don't know what project you're talking about.) It is the Standard Control Surface hardware from tutorial #027. I wanted to make a basic program myself for learning how to work with this hardware. And in the end, I got it working! For serious applications, I would use the full code of tutorial #027 with lots of functionality ready-made. 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.