Author Topic: [Dude] Running SAMD21G18 at 1.8v  (Read 1953 times)

0 Members and 3 Guests are viewing this topic.

Offline grafiTopic starter

  • Contributor
  • Posts: 23
  • Country: es
[Dude] Running SAMD21G18 at 1.8v
« on: March 16, 2020, 02:18:57 pm »
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 = atmelsam
board = samd21g18a
framework = arduino
build_flags = -D CRYSTALLESS
board_build.variant = SparkFun_SAMD_Mini

; SWD interface
upload_protocol = jlink
debug_tool = jlink
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11905
  • Country: us
    • Personal site
Re: [Dude] Running SAMD21G18 at 1.8v
« Reply #1 on: March 16, 2020, 04:34:02 pm »
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.
Alex
 

Offline grafiTopic starter

  • Contributor
  • Posts: 23
  • Country: es
Re: [Dude] Running SAMD21G18 at 1.8v
« Reply #2 on: March 16, 2020, 04:45:33 pm »
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.3v

It 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,

 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11905
  • Country: us
    • Personal site
Re: [Dude] Running SAMD21G18 at 1.8v
« Reply #3 on: March 16, 2020, 04:59:27 pm »
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.
Alex
 

Offline grafiTopic starter

  • Contributor
  • Posts: 23
  • Country: es
Re: [Dude] Running SAMD21G18 at 1.8v
« Reply #4 on: March 16, 2020, 05:14:58 pm »
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,
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11905
  • Country: us
    • Personal site
Re: [Dude] Running SAMD21G18 at 1.8v
« Reply #5 on: March 16, 2020, 05:16:48 pm »
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.
Alex
 
The following users thanked this post: Someone

Offline grafiTopic starter

  • Contributor
  • Posts: 23
  • Country: es
Re: [Dude] Running SAMD21G18 at 1.8v
« Reply #6 on: March 16, 2020, 05:39:03 pm »
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.
 

Offline grafiTopic starter

  • Contributor
  • Posts: 23
  • Country: es
Re: [Dude] Running SAMD21G18 at 1.8v
« Reply #7 on: March 16, 2020, 05:40:09 pm »
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.

The BOD33 fuse can be modified with the programmer.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11905
  • Country: us
    • Personal site
Re: [Dude] Running SAMD21G18 at 1.8v
« Reply #8 on: March 16, 2020, 05:40:32 pm »
Well, you need to debug then. Run it under the debugger and see what does not work.
Alex
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11905
  • Country: us
    • Personal site
Re: [Dude] Running SAMD21G18 at 1.8v
« Reply #9 on: March 16, 2020, 05:41:23 pm »
The BOD33 fuse can be modified with the programmer.
I 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.
Alex
 

Offline grafiTopic starter

  • Contributor
  • Posts: 23
  • Country: es
Re: [Dude] Running SAMD21G18 at 1.8v
« Reply #10 on: March 17, 2020, 12:50:25 pm »
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).
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11905
  • Country: us
    • Personal site
Re: [Dude] Running SAMD21G18 at 1.8v
« Reply #11 on: March 17, 2020, 04:27:49 pm »
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 work https://github.com/ataradov/mcu-starter-projects/tree/master/samd21 . Just change the LED pin assignment.
Alex
 

Offline grafiTopic starter

  • Contributor
  • Posts: 23
  • Country: es
Re: [Dude] Running SAMD21G18 at 1.8v
« Reply #12 on: March 18, 2020, 09:36:43 am »
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.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11905
  • Country: us
    • Personal site
Re: [Dude] Running SAMD21G18 at 1.8v
« Reply #13 on: March 18, 2020, 03:59:50 pm »
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.
Alex
 

Offline grafiTopic starter

  • Contributor
  • Posts: 23
  • Country: es
Re: [Dude] Running SAMD21G18 at 1.8v
« Reply #14 on: March 18, 2020, 04:23:49 pm »
Register BOD33 with VCC=3.3v and code paused after execute few lines. BoD33 register is set to 0 (disabled).

 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11905
  • Country: us
    • Personal site
Re: [Dude] Running SAMD21G18 at 1.8v
« Reply #15 on: March 18, 2020, 04:27:22 pm »
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.
Alex
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2786
  • Country: us
Re: [Dude] Running SAMD21G18 at 1.8v
« Reply #16 on: March 18, 2020, 07:32:15 pm »
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?
 

Offline grafiTopic starter

  • Contributor
  • Posts: 23
  • Country: es
Re: [Dude] Running SAMD21G18 at 1.8v
« Reply #17 on: March 18, 2020, 07:38:33 pm »
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,
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf