SAM L11 working with peripherals - Page 1
Forum section: electronics / general

author: Dajgoro
author_rank: Frequent Contributor
timestamp: January 15, 2019, 03:26:57 pm
content: HiI got the SAM L11 X PLAINED PRO devboard with the QT7 touch module to evaluate the platform.I need to make a demo, for which I need fancy fading leds and some timers.I got the examples to work no problem, but I'm going nuts trying to figure out how to get it to do anything else.For the PWM I took the PWM example code, and went copy-pasting the useful bits into the touch example, but all of the include files would fail to build saying its an unknown library.I don't know how to set up the compiler to build them.Later I found that I could add them in advance when building the project, which I did, but now the issue is I can't figure out the pin mapping.I just have a empy function called void PWM_0_PORT_init(void). In the PWM example I have this line in it: gpio_set_pin_function(IO1_LED, PINMUX_PB12F_TCC0_WO6); but when I copy paste thatPINMUX_PB12F_TCC0_WO6 is marked as unknown.Googling leads nowhere, there is very few material about this MCU family, and the only thing I found is about the ASF Wizzard, which does not work. The project is not ASF, and the tool for making it ASF is just missing in the IDE.I did not even try to set up a periodic timer yet, and I can't even find an example code on how to set it up.Where can I find info on how to set up things in this MCU?

author: ataradov
author_rank: Super Contributor
timestamp: January 15, 2019, 06:09:07 pm
content: It looks like you are using Atmel Start. And with Atmel Start you are specifying all the pins at the time of project creating in Atmel Start.There is no PB12 pin on those device. How did you get that code?PS: There is no ASF3 for this device, only ASF4, which is the same as Atmel Start located at start.atmel.com .

author: ataradov
author_rank: Super Contributor
timestamp: January 15, 2019, 06:10:12 pm
content: And if you are interested in simple bare-metal code, then I have sample projects for that herehttps://github.com/ataradov/mcu-starter-projects/tree/master/saml11But integrating QTouch into a bare-metal project may be a bit of a challenge.

author: Dajgoro
author_rank: Frequent Contributor
timestamp: January 16, 2019, 09:42:18 am
content: I'm using atmel studio.Yes, its all a lot of automagic done in the background.But I can't figure out how to do the pinmux in atmel studio.The code I got was when I clicked on new example project, and there I selected SAML11 and found the pwm example. I have no idea why it uses non existing pins.I know in MPLABX its rather simple to get things going for lower end pic mcu, and I usually use that, but now I really need the SAML11 touch features.How do I do the pinmux and adding more drivers after I have already created the project?Edit: I got it to load up atmel start with the current project, and assing the pinmux, now I just need to figure out how to get things going with this.Still need to figure out how to set up a timer interrupt.

author: ataradov
author_rank: Super Contributor
timestamp: January 16, 2019, 06:15:12 pm
content: I can really only help with bare-metal code, and the code in my links has the timer initialization example. Frameworks is not my thing.

author: Dajgoro
author_rank: Frequent Contributor
timestamp: February 04, 2019, 03:43:52 pm
content: I'm trying to get a simple periodic timer interrupt working, but nothing I tried so far works.I tried copying the code from the github mentioned above, but the startup is not the same so it never sets up the event.I tried fiddling with atmel start but I can't figure out where my event function is supposed to go or how I'm supposed to implement it.When I google saml11 I basically get no results.In the examples I can't find a simple straightforward example on how to use the timers.

author: ataradov
author_rank: Super Contributor
timestamp: February 04, 2019, 05:31:10 pm
content: Even if startup is different, all you need to do to make my example work is change the name of the interrupt handler to whatever is used in your startup.