#avr Logs

May 19 2020

#avr Calendar

12:11 AM day_ is now known as day
01:17 AM rue_mohr: low
06:24 AM sergche1991: Hello. I am trying to use a 32KHz crystal with 328P. My program is stuck at ASSR update check, until I touch the crystal with my finger. Ofc counter doesnt work. Any tricks here? The crystal is soldered right upon the mcu pins.
06:25 AM sergche1991: I tried two more crystals I have atm, didnt help.
06:27 AM cehteh: wrong caps?
06:27 AM cehteh: wrong fuses?
06:30 AM sergche1991: Should caps be used for 32KHz? All schematics say just crystal is needed. On Atmel docs they solder a crystal straight to smd mcu's pins, so nothing else can be connected.
06:31 AM cehteh: i havent checked just a guess
06:33 AM cehteh: eh the datasheet i am looking at says caps
06:34 AM cehteh: very small values the capacitance of the pins is already in that range
06:35 AM cehteh: next things are fuses, better programm the slowest startup time to give the clock some time to stabilize
06:37 AM cehteh: and of course correct fuses for the low freq crystal
06:40 AM LeoNerd: Breadboard capacitance
06:42 AM cehteh: not when you solder directly to SMD pins
06:43 AM sergche1991: I use DIP 328 and soldered directly to its pins.
06:43 AM cehteh: but its possibly viable to create tiny capacitances by traces only
06:44 AM cehteh: what cacpacitance does the crystal you use need?
06:44 AM cehteh: The low-frequency crystal oscillator provides an internal load capacitance of typical 6pF at each TOSC pin. The external capacitance (C) needed at each TOSC pin can be calculated by using
06:45 AM cehteh: C= 2CL-Cs
06:45 AM cehteh: Crystals specifying load capacitance (CL) higher than 6pF, require external capacitors applied as described inFigure 8-2 on page 26.
06:45 AM cehteh: .. there you go
06:45 AM LeoNerd: 6pF would be -tiny- for a crystal.. usually I recall them being around the 18pF mark
06:46 AM cehteh: LeoNerd: even the 32khz watch crystals?
06:46 AM cehteh: i dont know but seems reasonable that you need some small capacitances there
06:50 AM cehteh: other question: why do you want to run it from a 32khz crystal? lowest speed isnt always the most power saving and you can drive one counter async from a watch crystal or RTC or add an external rtc
06:51 AM cehteh: https://www.reichelt.de/uhrenquarze-smd-gehaeuse-c4005.html from what i see, 7-12.5pF are needed
06:57 AM sergche1991: I use 32K for RTC. The core works from built in 8 MHz RC with 8 divider.
06:59 AM cehteh: ah ok
06:59 AM cehteh: anyway you likely need caps .. for which ones refer to the crystal datasheet
07:04 AM sergche1991: Should I solder the crystall's hull to gnd?
07:04 AM sergche1991: ASSR check's just worked after I simply swung a breadboard in the air.
07:08 AM cehteh: ASSR?
07:09 AM cehteh: you may want to contact the hull to gnd, not necessary soldering because of heat stress (datasheet!) but some conductive pad/wire/clamp whatever could be nice
07:10 AM cehteh: usually its left floating, often above a groundplane
07:10 AM sergche1991: The ASSR register of Timer 2
07:11 AM cehteh: ah
07:11 AM cehteh: did you add caps now?
07:11 AM cehteh: did you read the crystals datasheet?
07:13 AM cehteh: what you describe is exactly what happens when the capacitance isnt right, it wont swing reliably (and not in the correct freq)
07:31 AM sergche1991: I dont have datasheets for crystals, they are taken from some modules or boars a long time ago. I will delay doing this, until I get some new crystalls or maybe a standalone rtc module, dont have anything atm. I will focus on other functions of my device.
07:31 AM sergche1991: Thanks for advices :-)
02:08 PM rue_mohr: about 18pf
02:08 PM rue_mohr: each side
02:08 PM rue_mohr: is a typical value
02:08 PM rue_mohr: sometimes 8pf, sometimes 20pf, 18 seems a good one tho
02:11 PM cehteh: he left already
02:12 PM cehteh: and i think 32kHz clock crystals need smaller caps, and possibly more exactly matched than just guessed for more accuracy
02:25 PM rue_mohr: oh
02:25 PM rue_mohr: 32khz is totally different yea
02:25 PM rue_mohr: trimming on those is crazy
02:26 PM cehteh: i'd only use a 32k crystal if space requires that and no accuracy is needed, otherwise rtc modules are way better
02:27 PM rue_mohr: yea, pre-tuned module
02:27 PM rue_mohr: I used a cmos one for my wall clock