Tweets
Replying to @josecastillo
this is confusing to me though: raising the CPU clock frequency to 8MHz (from 4) increased my power consumption in sleep. which is weird because the CPU clock is supposed to be disabled in standby mode. wondering if the main clock is still running for some reason…
(original)
Replying to @josecastillo
oh wow: moving to the RTC-based interrupt somehow caused my issues with STANDBY mode to go away. 218 µA now.
(original)
Replying to @josecastillo
also my god I need to get a real windows machine… running Atmel Studio in Parallels has had my Mac’s fan running full tilt for days now.
(original)
Replying to @josecastillo
WELL THAT WORKED! I’m ticking at one second per second using just the RTC, and power consumption is down from 650µA to 250µA. still this is not nearly low enough; really have to figure out this standby mode thing.
(original)
Replying to @josecastillo
or PER7, I suppose. either way, let’s give this a shot.
(original)
Replying to @josecastillo
This is promising: to turn the 1,024 Hz clock into a 1 Hz tick, the RTC uses a “prescaler” to divide repeatedly by two. AND it can generate an interrupt when any of the 8 high bits of the prescaler flip. if I set an interrupt on the high bit, PER8, I should get a one second tick.
(original)
Replying to @darianbjohnson
I think the internal RTC is probably going to be the best route for low power, but also I don’t think there’s room in the watch case for another chip. Also part of the goal of this project is to try to wring as much functionality as possible out of this one microcontroller :)
(original)
Replying to @josecastillo
this actually makes sense when you think about it: the RTC is clocked at 1.024 kHz, and the TC is clocked 32,000 times faster. going faster, doing more stuff, it all takes power. so now I’m delving back into the data sheet to see if the RTC can generate the 1 Hz interrupt I need.
(original)
Sunday watch thread: yesterday I set up a timer/counter or TC peripheral to wake the watch up once a second. but then in reading some documentation about the similar SAM D series, I realized that I’d shot myself in the foot: the TC is apparently not all that power efficient.
(original)
Replying to @josecastillo
“This sort of subversive crypto art is very emblematic of 2020s style, but unfortunately it’s also quite common. You say you have a private key to prove ownership and provenance, but frankly there were so many NFT pieces made back then, no one can keep track anymore.” ✨ $15-$25
(original)
quick, someone take this to antiques roadshow https://twitter.com/KWF/status/1388332495288995840
(original)
Replying to @av1d508
The F-91W does something with an inductor to shove current to the piezo. Ran out of room for that, but found that connecting an output right to the buzzer yields decent sound. I read I should model it as a capacitive load, which I don’t quite grok; but as long as it beeps I’m ok!
(original)
Replying to @frivolous_circs
This is the way.
(original)
Replying to @frivolous_circs
Harness the crystal!
(original)
Replying to @av1d508
I know right? Like at some point I’m going to get to work on PWM’ing the piezo buzzer, and it basically involves zatzing a rock until it freaks out.
(original)
it’s kind of wild to me how accurately the crystal oscillator keeps time. you’re a piece of quartz. I’ve literallly found rocks like you on hikes. what business do you have oscillating at 32.768 kilohertz exactly.
(original)
Replying to @kfury
the most bonkers part of this whole situation is how uproariously easy it would be for @dhh fo fix the whole thing even now. it takes not even a third of a tweet: “I was wrong on this one. I realized this after listening more. We will do better by our people in the future.” Done.
(original)
Replying to @jason_sweeten
dare reasonable (but nice!) things
(original)
Replying to @jason_sweeten
i haven’t seen an airport in years.
(original)
Replying to @josecastillo
reading list:
• AT04296: Low Power Features of SAM L Series Devices
• AT06549: Ultra Low Power Techniques
http://ww1.microchip.com/downloads/en/AppNotes/Atmel-42412-Low-Power-Features-of-SAM-L-Series-Devices_ApplicationNote_AT04296.pdf
https://www.microchip.com/content/dam/mchp/documents/OTH/ApplicationNotes/ApplicationNotes/Atmel-42411-Ultra-Low-Power-Techniques-AT06549_Application-Note.pdf(original)
Replying to @josecastillo
…and still I’m chewing through 650µA while asleep. sad face :( but then again, I never did master the STANDBY sleep mode the other night; I’m still idling in IDLE. And I haven’t done much in terms of thinking about low power modes. Yet. So maybe that’s the second half of my day.
(original)
Replying to @josecastillo
ok! Turned out to be easier: the timer driver can fire an interrupt at any count, so I’m dividing the 32768 Hz clock by 2, and asking for an interrupt every 16,384 ticks. when I get that tick, I’m flashing the LED ever *ever* so briefly, just to simulate consuming some power…
(original)
Replying to @josecastillo
I have my issues with the IDE for sure, but I do appreciate how Atmel START offers a very visual description of how my clocks run my peripherals under the hood. I sense that it’s reasonably comprehensible, even if you don’t know all the minutiae of the clock system.
(original)
Replying to @supersat
That could work! but for now my plan is to use a timer/counter peripheral and see if it can generate interrupts for me.
(original)
Replying to @josecastillo
* asterisk from earlier: technically you can configure the TC to count to either 255 or 65535, or you can group two together to count even higher. there’s also a fancier TCC peripheral that can count to 16 million or so; I plan to use that one to PWM the watch buzzer, eventually.
(original)
Replying to @josecastillo
So the plan: feed the input from the 32768 Hz crystal into a spare TC. Divide it by 64 which gives me 512 ticks per second. Tell the timer to count to 256. Then it should overflow and cause an interrupt twice a second. (I’d prefer to divide by 128, but it’s weirdly not an option)
(original)
Replying to @josecastillo
this is called PWM, or pulse-width modulation, and it’s a useful use of the TC! But we can also just use it to count things. The thing is: it can’t count forever. It can only count to 255*. When it counts too high, it needs to let us know. It does this by generating an interrupt!
(original)
Replying to @josecastillo
enter the timer/counter. unlike the RTC, the TC doesn’t count real time like seconds. it counts ticks. this is how I’m dimming the LED’s: it turns them on for some number of ticks, then off for some number of ticks. it happens faster than the eye can see so the result is dimming.
(original)
Replying to @josecastillo
but the RTC interrupt can only fire when it matches a given hour, minute or second. this is how my test code is updating the display: once a minute, when the seconds tick from 59 to 0, the watch wakes up, I update the screen, and we wait again. I need a more frequent interrupt.
(original)
Replying to @josecastillo
I can’t repeatedly refresh the display in main() because that would kill the battery; I need to do it in an interrupt. basically the system sleeps most of the time, and only wakes up when something pokes it. right now, the only interrupts are the buttons, and the real-time clock.
(original)
I love that working in electronics I can say things like this and it’s totally not a shitpost. I harnessed the crystal, and now the watch is keeping perfect time, at least one day in. today though I think the goal is going to be to get the seconds display working. ideas thread! https://twitter.com/mattk/status/1388285786760499201
(original)
Replying to @mr_rythom
Heck yeah! Drop me a line whenever, I’m around.
(original)
_dayjob gave me the day off, and I did not work on side projects at all. Today was a good day.
(original)
Replying to @josecastillo
Or maybe it’s that you can’t reach the summit without leaving basecamp? There’s some clever wordplay in here, I just know it.
(original)
shower thought: if you want to reach a summit, you have to leave basecamp.
(original)
Another member of the team shot this photo of me and others helping with the install. I love the way Liberty’s face at the right almost looks like a glitch.
(original)
Replying to @josecastillo
She’s coming together! (tho I appreciate the little kid that came by asking, “Why is she broken?”)
(original)
Basecamp’s foolish, inhumane policy change (and subsequent doubling down) has now cost them a full quarter of their employees, including heads of customer support, design & marketing, as well as their entire iOS team. One could start a company with the talent Basecamp lost today. https://twitter.com/CaseyNewton/status/1388212468510380034
(original)
Helping a colleague with an art installation in Morningside Park today. “Reclining Liberty” by Zaq Landsberg. It’s quite a sculpture, check it out if you’re in the city next month! 🗽 https://gothamtogo.com/zaq-landsberg-reclining-liberty-finally-coming-to-morningside-park-in-harlem-april-2021/
(original)
Replying to @josecastillo
Woke up to find the watch had drifted a minute slow overnight, which is not great. Then realized I still had the RTC hooked up to a low power (ie not high accuracy) clock source. So, trying again. Code is up; gonna try to figure out sleep before tonight 😬 https://github.com/joeycastillo/Sensor-Watch/blob/68bada3006a627e704680c0161f597e585b37e7f/Smol%20Watch%20Project/My%20Project/main.c#L9
(original)
Replying to @josecastillo
(no seconds for this one because the display gets updated in a calendar interrupt callback that only runs once a minute; once I do figure out sleep modes, I sense this would be an extraordinarily low power way to operate)
(original)
watch progress: calendar & external interrupts work, and I moved the mars clock over; alas, now my math is calculating mars time wrong. for now tho just running the earth clock to see about accuracy over time. (tho I haven’t untangled sleep yet, so it might just die over time 🤷🏽♂️)
(original)
Replying to @josecastillo
still wrestling with the sleep functions — mostly the waking up part, really — and I’m realizing that if the universe were trying to send me a sign that I should call it a night, this would be about the most literal way to do it.
(original)
Replying to @_nitz
ha, I can pun quick but thought it was a bit crass 🙃
(original)
Replying to @_nitz
I mean sex blimps are cool but I’m mostly stoked that we’re funding blimp travel again
(original)
Replying to @TrentonEmory
not gonna lie, I clicked that link and did a Ctrl+F “owl” because I honestly wasn’t sure.
(original)
RT @michaelharriot: When Tim Scott said “America isn’t a racist country” I bet MLK turned over in his grave.
Not because of Tim Scott’s li…
(original)
watching Biden’s speech and hacking the mars clock demo onto the watch. irony of ironies: staying up late while calling a function named _go_to_sleep()
(original)
adventures in autocorrect
(original)
Replying to @ElectronVillage
They are such cool designs, y’all should be proud of what you’ve created! (/cc @sofiessketches with the Ingenuity artwork!) I’m also totally cribbing PCB-art-making notes from these, just so you know :)
(original)