So i have a problem ive made myself an PCB to put an 328P on it, to run AD9833 DDS chip.
Now i made a code, i checked it on breadboard with normal Arduino UNO and everything works. I have one of those UNO`s with SMD 328P on them. So my sketch is working perfectly, writing on LCD writing to AD9833 on SPI everything.
Now i bought DIP package 328P and put a bootloader on it usind Arduino as ISP and Burned BOOTLOADER choosing Arduino/Genuino UNO board. Bootloader was burned with success no errors.
Now my scheamtic, which i will add to the end of this post, has an 16 MHz crystal. And i have the 10K resistor for RESET pin and i use the simple approach by shorting RESET to GND until the loading starts and the release RESET short, and Arduino IDE reports UPLOAD DONE. No errors.
But nothing happens, there should be a greating message on LCD nothing, nothing everything draws around 20mA from 8V power supply. Of course i have an 78M05 on board.
Now i know sketch isnt a problem it works. something is wrong with my design, however this is the first time i play with Arduino off board. Im usually used to PIC or TI MCU`s. And to be honest i hate Arduino, but i have some stock of these 328P so i tought i should spend them
Yes i tried different MCU same results, tried several 16 MHz crystal same result.
How are you determining that it's not working? Are you sure it's not a problem with the sketch you're uploading?Do you have an LED connected so you can get some very basic feedback about it's state?
OH GOD, i forgot to correct the schematic, hold on here is the newer schematic with proper values. I just made the scehamtic fast and loaded to create PCB, didnt check the valuse, on board i have 22pF SMD capacitors, and for now i removed the 1M resistor.
Well sketch works on normal arduino ergo sketch is not a problem. I tried sketch on NANO UNO DUE it works no problem.
However there is something i forgot to mention, i have no oscillations on either of OSC pins. Could be somehow fuses got stuck to whatever other state?
I just tried to burn bootloader for NANO with 328P and same problem.
Yes once more im positive sketch works no problem, tested it several times on factory made board all is fine. I am certain, well at least 90% i didnt make a mistake in routing the PCB.
Ok so, yes i did not add anytihing to Aref, hmmm yes a bit stupid from me being an engineer who overlooked that......
I have stable 5.00V no ripple, since im powering from high quality linear lab power supply.
I just did some research, some people had problems with certain crystals not starting at all...but then im confused how i get the sketch and bootloader uploaded?
I am using some older crystals, but i have no reason to believe they are defective, maybe they are but no reason to believe in that. I tried 5 different...in different packages.
Ok i know i know, i shouldnt make two posts in a row, but hear me for a minute, or rather read me
I think i have an idea, i have barely any oscillations on my crystal. Tommorow i will try full swing oscillator. Ill change the low fuse bit to F7 and see what it happens.
I still just dont get it, how the hell does it receives anything correctly from bootloader...... weird....
Are you sure you have your pin-mapping correct?
Your labeling D4..D7 of the portd pins of the 328 does not match Uno "digital pin numbers", for example.
Ive found the solution, this morning i connected my Dynamic Signal Analyzer to the oscillator, and put another arduino to continuously restart my PCB arduino. With some waiting time in between, my DSA recorded the events on oscillator.
Out of about 50 sequences, just 3 times oscillator started. So since it is Saturday, i couldn't go and buy the crystal, so iv`e found an old PLC from Siemens i believe and i took it part and guess what, a nice SMD 16.0 MHz crystal, put it on and voila everything works perfectly.
So it is the problem with crystal, the ones i tried with are old, they do work but im guessing impedance matching isn't very good. So ill stick to buying new for Atmel. Never had that problem with TI or Microchip, but who cares, damn thing are dirt cheap
Thanks for all suggestions, and thanks for the time. Just beware of those older crystals some may not work......