[Dude] Running SAMD21G18 at 1.8v - Page 1
Forum section: electronics / projects

author: grafi
author_rank: Contributor
timestamp: March 16, 2020, 02:18:57 pm
content: Hi, i am working with SAMD21G18 and a custom board based on sparkfun design and i am using VSC + PlatformIO.Actually i want to run at 1,8v instead of 3,3v. Now, the hw works well at 3,3v but when i use 1,8v don´t work.I have disabled the fuse BOD33 using Atmel Studio, but the microcontroller don´t work. How i could change the fuses in platformio?Do i need set any other option to work at 1,8v?Thanks for your time.Regards,PD: My platformio.ini file is:;PlatformIO Project Configuration File;; Build options: build flags, source filter; Upload options: custom upload port, speed and extra flags; Library options: dependencies, extra library storages; Advanced options: extra scripting;; Please visit documentation for the other options and examples;https://docs.platformio.org/page/projectconf.html[env:samd21g18a]platform = atmelsamboard = samd21g18aframework = arduinobuild_flags = -D CRYSTALLESSboard_build.variant = SparkFun_SAMD_Mini; SWD interfaceupload_protocol = jlinkdebug_tool = jlink

author: ataradov
author_rank: Super Contributor
timestamp: March 16, 2020, 04:34:02 pm
content: How exactly it does not work? Can you still program it and it does not run? Or you can't even program it?At 1.8V it should be able to work even with BOD enabled, with the level set appropriately low. It should also work with BOD disabled, of course.Also, make sure that code in the platformio does not switch it back in run-time.

author: grafi
author_rank: Contributor
timestamp: March 16, 2020, 04:45:33 pm
content: I am uploading a simple code that put in high/low one pin and send Hello world message using UART interface. Simple code. When the VCC is 3.3v, the code works well. When i change the VCC to 1.8v, the code not work (before connect 1.8v i unplugged the VCC of the hardware).The code can be uploaded when i set VCC at 1.8v and 3.3vIt is weird, i think that the microcontroller could be run in both vcc.I have solder the ucontroller and neccesary passive electronic components. Rest of them are not soldered.Thanks,

author: ataradov
author_rank: Super Contributor
timestamp: March 16, 2020, 04:59:27 pm
content: Again, double check that platformio does not override BOD settings from the firmware. Your MCU would start, hit that part of the code and reset.Also, platformio code may not set flash wait states correctly for the lower voltage. See Table 37-42. "Maximum Operating Frequency" for correct values. To run at 48 MHz at 1.8 V you need to configure 3 wait states.If the code was designed with 3.3 V supply in mind, then it is likely only sets 1 wait state.

author: grafi
author_rank: Contributor
timestamp: March 16, 2020, 05:14:58 pm
content: I check the fuses after upload few times the code and the fuses not change.I will check the 3 wait states. i dont know what is it and where could be changed in platformio.Thanks,

author: ataradov
author_rank: Super Contributor
timestamp: March 16, 2020, 05:16:48 pm
content: The fuses that you read with the programmer will not change. They are just the values used to initialize registers. The software can go and overwrite those registers. Those changes are not permanent.

author: grafi
author_rank: Contributor
timestamp: March 16, 2020, 05:39:03 pm
content: I have checked the wait states and i modified the clock speed to 28mhz. The table 37-42 that you suggested to me. the results are the same, with 3.3v works but with 1.8v not work.

author: grafi
author_rank: Contributor
timestamp: March 16, 2020, 05:40:09 pm
content: Quote from: grafi on March 16, 2020, 05:39:03 pmThe BOD33 fuse can be modified with the programmer.

author: ataradov
author_rank: Super Contributor
timestamp: March 16, 2020, 05:40:32 pm
content: Well, you need to debug then. Run it under the debugger and see what does not work.

author: ataradov
author_rank: Super Contributor
timestamp: March 16, 2020, 05:41:23 pm
content: Quote from: grafi on March 16, 2020, 05:40:09 pmI know. But the values can be also modified from the software in registers. You will not know about that unless you actually look at the code.

author: grafi
author_rank: Contributor
timestamp: March 17, 2020, 12:50:25 pm
content: My programmer can not work at 1,8v. The interface works at 3.3v. When i set the vcc to 1.8v the debug interface not run (in 3.3v works well and i can debug).

author: ataradov
author_rank: Super Contributor
timestamp: March 17, 2020, 04:27:49 pm
content: Can you vary voltage slowly? What is the voltage at which it stops working?I would starts with a very simple project that does not initialize anything fancy. My starter project would workhttps://github.com/ataradov/mcu-starter-projects/tree/master/samd21. Just change the LED pin assignment.

author: grafi
author_rank: Contributor
timestamp: March 18, 2020, 09:36:43 am
content: At 2.1v works well and when i set 2.0v not work. I have used my code, running a 48mhz and i havent modified any wait state value. Datasheet said that the ucontroller can work at 1.65v.I will test your code later.thanks,Regards.

author: ataradov
author_rank: Super Contributor
timestamp: March 18, 2020, 03:59:50 pm
content: There are a couple more things you can do:1. When running from 3.3 V where you have ability to debug, have a look at the value of the SYSCTRL.BOD33 register. Is ENABLE bit set? This register is loaded from the Use Row on reset, but may be later overwritten by the firmware.2. See if your debugger works at 2 V, you may be able to debug thew "stuck" case this way.

author: grafi
author_rank: Contributor
timestamp: March 18, 2020, 04:23:49 pm
content: Register BOD33 with VCC=3.3v and code paused after execute few lines. BoD33 register is set to 0 (disabled).

author: ataradov
author_rank: Super Contributor
timestamp: March 18, 2020, 04:27:22 pm
content: So it is not BOD. Something else is not working. I don't really know what it could be. The part itself works fine at 1.8V, this was tested many times.So you will have to figure out a way to debug at voltages where it is stuck. Probably starting with my simple application would be a good first step.

author: ajb
author_rank: Super Contributor
timestamp: March 18, 2020, 07:32:15 pm
content: Could it be part of your other circuitry? Are you actually using a Sparkfun SAMD Mini and trying to use the onboard regulator? That could be the problem right there. Are you measuring the 1.8V at the MCU pins or somewhere else?

author: grafi
author_rank: Contributor
timestamp: March 18, 2020, 07:38:33 pm
content: i am design a custom board based on sparkfun samd mini. When i set the vcc=1.8v i can measure the same vcc in all pins that they are connected to vcc.Regards,