Offline
Jr. Member
Karma: 0
Posts: 66
|
 |
« on: January 11, 2013, 05:15:02 pm » |
Hello,
i made PCB for measuring temperature with some other components (fan, lcd and sd card module). I made two almost the same versions, one with Arduino Nano (for development) and one with ATmega328 stand alone (with arduino bootloader) for long-term use. All the components are basicly the same.
I finished program code and test it on PCB with Arduino Nano.. Everything is working like it should, without any problems. I burned bootloader in new ATmega328 and load exactly the same program on it. On this stand alone version i am getting random resets from time to time, totally without any logical iteration.
Any ideas? I can upload circuit scheme if it will help.
|
|
|
|
« Last Edit: January 11, 2013, 05:16:33 pm by luxy »
|
Logged
|
|
|
|
|
Anchorage, AK
Offline
Sr. Member
Karma: 10
Posts: 492
|
 |
« Reply #1 on: January 11, 2013, 05:22:09 pm » |
I would minimize the code as much as possible. In fact, run Blink on it for a while if you have an LED onboard. Try to separate hardware and software faults any way you can.
Is the BOD set on the mega? Check supply voltages. Can you post a pic of your PCB? Maybe we can see something obvious.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 66
|
 |
« Reply #2 on: January 11, 2013, 05:48:03 pm » |
I uploaded the whole scheme.. What is BOD? I don't know what's that mean. I measured supply voltages and they are fine, stable 5V. https://www.dropbox.com/s/9zl9ygkf4lyvep1/scheme.pdf
|
|
|
|
« Last Edit: January 11, 2013, 05:52:24 pm by luxy »
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 71
Posts: 6625
Arduino rocks
|
 |
« Reply #3 on: January 11, 2013, 05:56:50 pm » |
Brown-out detection. Google would tell you that!
My first guess is decoupling. But a photo and/or schematic are very illuminating usually.
|
|
|
|
|
Logged
|
|
|
|
|
Anchorage, AK
Offline
Sr. Member
Karma: 10
Posts: 492
|
 |
« Reply #4 on: January 11, 2013, 06:36:34 pm » |
I don't see anything obviously wrong from the schematics. An actual photo of the PCB itself might help though.
|
|
|
|
|
Logged
|
|
|
|
|
Anaheim CA.
Offline
Edison Member
Karma: 31
Posts: 2309
Experienced old Whitebeard with a Full head of Hair...
|
 |
« Reply #5 on: January 11, 2013, 07:21:07 pm » |
The schematic was very good well laid out and almost perfect but it can't possibly work as drawn or designed. The CD4050 or 74HC4050 or whatever is a 5V part and I assume that the device was intended as a level shifter for the 3V3 SD card? Most of the ones I've seen are 3V3 interface and your level shifter Vcc is connected to 5 V defeating the level shifting, were it so you could have used one of the remaining 3 buffers for the MISO connection from the card to the controller. In my opinion you need the .1 uF capacitors right at both the display Vcc and on the '4050 as well as the two 'obligatory' caps on the controller's analog and digital Vcc connections and I think that the best method for a multi-chip board as busy as yours (not a nano or pro..) really requires both caps right at the IC for best results.
Bob
|
|
|
|
|
Logged
|
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
|
|
|
|
Offline
Sr. Member
Karma: 9
Posts: 280
|
 |
« Reply #6 on: January 11, 2013, 09:16:04 pm » |
Is the standalone version in a case? case properly grounded?
If not, you may get freezing, hangups, or random resets.
|
|
|
|
|
Logged
|
|
|
|
|
|
|
The Netherlands
Offline
Sr. Member
Karma: 9
Posts: 331
|
 |
« Reply #8 on: January 12, 2013, 04:56:08 am » |
Those caps go as close as possible across pins 1 and 16 of the -595, pins 1 and 8 of the 4050. So it's just like the TC670 you put on that small pcb. You should always use such cap directly at any logic IC.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 66
|
 |
« Reply #9 on: January 12, 2013, 09:07:33 am » |
I will try that and report.. Thanks!
|
|
|
|
|
Logged
|
|
|
|
|
United Kingdom
Offline
Faraday Member
Karma: 131
Posts: 4681
|
 |
« Reply #10 on: January 12, 2013, 09:59:47 am » |
Three possibilities come to mind:
1. Lack of decoupling capacitors. See previous posts. The most important one is between Vcc and Gnd of the atmega328p. I suggest you solder one directly across the Vcc and ground pins of the chip, on the underside of the board, with really short leads.
2. Power supply brownout, e.g. if the peak fan current is too much for either the 7805 or the supply that is providing 12V. Need to know more about the fan and the supply before we can discount this as a possibility.
3. Software problem.
|
|
|
|
|
Logged
|
Formal verification of safety-critical software, software development, and electronic design and prototyping. http://www.eschertech.com
|
|
|
|
Anaheim CA.
Offline
Edison Member
Karma: 31
Posts: 2309
Experienced old Whitebeard with a Full head of Hair...
|
 |
« Reply #11 on: January 12, 2013, 01:29:39 pm » |
Somehow you missed this part... The schematic was very good well laid out and almost perfect but it can't possibly work as drawn or designed. The CD4050 or 74HC4050 or whatever is a 5V part and I assume that the device was intended as a level shifter for the 3V3 SD card? Most of the ones I've seen are 3V3 interface and your level shifter Vcc is connected to 5 V defeating the level shifting, were it so you could have used one of the remaining 3 buffers for the MISO connection from the card to the controller. Before that board is going to work you will have to fix the level shifter Vcc. If the CD4050 is seeing 5V as it's supply it will output 5V.. Not 3V3 as you need for proper operation. {Edit}Bob
|
|
|
|
« Last Edit: January 12, 2013, 01:31:42 pm by Docedison »
|
Logged
|
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 66
|
 |
« Reply #12 on: January 12, 2013, 03:17:53 pm » |
Before that board is going to work you will have to fix the level shifter Vcc. If the CD4050 is seeing 5V as it's supply it will output 5V.. Not 3V3 as you need for proper operation. {Edit} Bob
Oh my.. Hmm. I saw that sd card module have voltage regulator for 3,3V. It uses AMS1117 and it should provide up to 1A current. Is it possible to use this voltage regulator for supplying 74HC4050? I think in my case this would be the easiest solution, if it could work that way of course.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Jr. Member
Karma: 0
Posts: 66
|
 |
« Reply #13 on: January 12, 2013, 04:52:25 pm » |
I think i solved my problem.. Like i said in my previous post, now i am powering 74HC4050 through 3.3V regulator. I also added 0,1uF ceramic caps between VCC and GND of ATmega328, 74HC4050, 74HC595 and LCD. Up till now (after half an hour of testing) everything works fine, without problems.. And i hope it will stay that way Thank you for all guys! 
|
|
|
|
|
Logged
|
|
|
|
|
Anaheim CA.
Offline
Edison Member
Karma: 31
Posts: 2309
Experienced old Whitebeard with a Full head of Hair...
|
 |
« Reply #14 on: January 12, 2013, 09:31:56 pm » |
A Good Job, well Done.
Bob
|
|
|
|
|
Logged
|
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
|
|
|
|
|