SAMD21 Stop running

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Everyone,

 

I used samd21g18 to communicate with a machine using RS232. I add converter Uart to RS232 into my board.

The communication is OK but there is certain time when I turn ON the machine or turn OFF it, my board seem hang/not running. I need to reset to make it run again.

I try debug, yes it stopped at random point (no breakpoint). If I click continue it can run again.

 

Then I try to disconnect TX and RX point. I just make it common ground.

The same problem still happen.

Even I add watchdog to reset MCU, it's not solve my problem.

 

I don't think it is because of stack because it only happen when I turn ON/OFF machine(not every time).

Also I have try debugging with empty code, still happen.

 

Is it the internal clock stopped?

 

Anyone have idea how to solve it? Please help.

 

Thank you.

 

 

 

blurserabot

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Interference is coming down the common groung, through your board then out through your computer. Use a star grounding technique.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes correct, but my board still got hang even not connect to the debugger (connection is between board to machine only, no computer).

Why it is not restart?

 

After I go deep to solve it I found that SAMD21 can detect electrical issue and effect certain things.

Refer datasheet,

#page18

#page109

#page115

 

Before this my main clock was based 32khz. Then I change it to 8Mhz and after that it is successful to restart.

 

So now I need to improve my circuit.

 

Thanks.

 

 

 

blurserabot