#avr Logs

Apr 03 2020

#avr Calendar

05:47 AM matthias_arch: Hello everyone, why is the compiler not inlining the millis() method when using -Os?? It yields shorter and faster code because of the skipped uint32_t transfer. https://godbolt.org/z/bQepsB
06:01 AM ggonzalez: Hello
06:02 AM ggonzalez: is there anyway while using internet oscillator on a ATMEGA8 to get the system clk routed to a PIN?
06:05 AM nohit: ?
06:05 AM nohit: some of the atmegas have CKOUT pin
06:06 AM ggonzalez: yeah I don't see that on the datasheet for this one
06:06 AM nohit: but whats internet oscillator ?
06:06 AM ggonzalez: s/internet/internal/
06:07 AM nohit: yeah mega8 doesnt seem to have that
06:07 AM nohit: CKOUT pin
06:09 AM ggonzalez: so there is no other way to get the signal on a PIN?
06:10 AM nohit: i dont think so
06:10 AM ggonzalez: the closer I can get is using SPI on Master mode a get CK/2
06:10 AM ggonzalez: right?
06:11 AM nohit: why do you need that clk signal ?
06:12 AM nohit: where is it connected to ?
06:12 AM nohit: you can make your own clk signal with a regular io pin
06:13 AM ggonzalez: The thing is that I need to run the system at 1Mhz but I don't have any external one. I would also need to have two chip using the same CLK so they are synched for some tests I am doing
06:14 AM ggonzalez: I think I might need to generate the CLK with an FPGA or similar and then source it to the atmega8
06:15 AM nohit: do you need the clock for SID chip ?
06:16 AM nohit: just guessing here, SID takes 1MHz clk signal
07:00 AM Fuchikoma: markasoftware: The average power is fine but something about the module gulps power under certain conditions, causing audio distortion. Peak current can be as high as 200mA depending on what's playing and at what volume
07:00 AM Fuchikoma: If the AA batteries are near the end of life, especially if using rechargable NiMH, then the voltage is also critically low (under 3V) which causes its own problems
07:03 AM Fuchikoma: ggonzalez: I can't imagine you'd need an FPGA just to generate a 1MHz clock. Pretty sure you can get a 1MHz crystal oscillator as a stock item...
07:03 AM ggonzalez: nohit: no, is for some other thing
07:04 AM ggonzalez: Fuchikoma: I will try to look for old equipments around my house. Not something I can get easily while quarntined ; D
07:05 AM Fuchikoma: How critical is it that it's exactly 1MHz?
07:05 AM ggonzalez: The FPGA thing would just take me 5 min to put the clk on a pin... checking old pcbs is probably going to take more than that
07:05 AM ggonzalez: hehe
07:05 AM ggonzalez: Not exactly 1MHz
07:05 AM ggonzalez: it could be less it could be slightly more
07:05 AM ggonzalez: I have a bunch of 16MH`
07:05 AM ggonzalez: but that's too fast
07:06 AM Fuchikoma: I guess if you have an FPGA already but that's a silly hack not a solution
07:06 AM ggonzalez: yup, it's a hack of course. i would only use for taking measurument
07:07 AM Fuchikoma: Fair enough then!
07:07 AM ggonzalez: i was hoping to get the CLK signal from the ATMEGA itself hehe
07:09 AM Fuchikoma: Can the other device provide the clock?
07:10 AM ggonzalez: there are two ATMEGA8 but wanted to get the same clock for both
07:10 AM Fuchikoma: I'm assuming this is for synching the actual code execution and not just for communications, 'cause there are better ways if it's just serial comms
07:10 AM ggonzalez: yup it's about execution
07:11 AM Fuchikoma: k
07:18 AM ggonzalez: thx for the help
12:59 PM rue_bed: so there is gonna be a nick purge on the servers eh?
01:00 PM rue_bed: anyone know if #avrs is gonna have a freakout and move to another network?
01:02 PM Fuchikoma: Nicknames that haven't been used in 120 days or more yeah
01:03 PM rue_bed: I'm betting on a freakout
01:03 PM Fuchikoma: I'm not seenig it
01:03 PM Fuchikoma: Presumably, if someone is logged in and idling with a nick, it's in use and won't be purged
01:04 PM rue_bed: so about this clock thing
01:04 PM Fuchikoma: The only thing that's really notable is if you have nicks linked to your accoutn that you haven't used, those will be pruned
01:04 PM rue_bed: if you have an avr running at 16Mhz, you can set a timer to output 1
01:05 PM Fuchikoma: ?
01:05 PM rue_bed: you set the timer to divide the cpu clock by 16, and output that to a pin
01:05 PM rue_bed: all hardware
01:06 PM Fuchikoma: Ah ggonzalez's clock problem
01:06 PM rue_bed: not sure why there is such a long conversation about it, seems easy?
01:06 PM Fuchikoma: I don't think that will work for him as he wants both AVRs to be clocked together
01:06 PM Fuchikoma: So having one running faster than the other is a non-starter
01:07 PM Fuchikoma: (Fuck if I know why they need to be clocked together but that's what they want...)
01:07 PM rue_bed: so tie the clock togethor
01:07 PM Fuchikoma: Right the question was how to best accomplish that
01:07 PM rue_bed: you can have one be an oscillator and the other use an incomming
01:08 PM Fuchikoma: I wasn't sure that would work; having one drive a crystal and both using the output
01:08 PM rue_bed: _I_ would set up one with an external 16Mhz crystal, and take the clock out side to the clock in side of the other avr
01:08 PM rue_bed: yes
01:09 PM rue_bed: if he needs them specicially running at 1Mhz, I'd use the divider fuse
01:09 PM rue_bed: (or is that /8) regardless, yes
01:09 PM Fuchikoma: I'd just use a self contained oscillator unit
01:09 PM rue_bed: $$
01:09 PM Fuchikoma: Really?
01:09 PM rue_bed: if you can use one of the existing chips as an osc with just a crystal
01:10 PM rue_bed: not much of a difference, but cheaper (no diff for a hobby project)
01:11 PM Fuchikoma: I guess pennies count a lot if you're building shitloads of them, but how prone to interference would the clock be if you have multiple chips on the same crystal?
01:11 PM Fuchikoma: Aren't they fairly sensitive to capacitance and noise?
01:12 PM nohit: Fuchikoma: i did wav playback on stm32 recently
01:12 PM rue_bed: there IS a fanout rating
01:13 PM rue_bed: nice, I was going to once, I tried some of the libraries online and found that EVERY one of them did something stupid
01:13 PM rue_bed: concluded I'd have to write my own
01:13 PM rue_bed: one of them played the header
01:14 PM rue_bed: one of them assumed all files used the same sample rate
01:14 PM Fuchikoma: nohit: I'll probably write my own in assembly just for education's sake, though I might cheat and use a "custom" data format to eliminate the header based on assumed parameters
01:14 PM rue_bed: one of them ditched the last non-complete buffer
01:16 PM nohit: im now trying to do real time signal generation with the I2S codec
01:16 PM Fuchikoma: https://i.imgur.com/zB3Eh48.jpg <-- My one experience with crystals. I fucked round with that for weeks trying to get it working (including buying a bunch of different crystals and caps). Turns out the device needs to be told to start the oscillator after power-up :/
01:16 PM nohit: i just ordered this scope https://www.batronix.com/shop/oscilloscopes/Siglent-SDS1202X-E.html
01:17 PM Fuchikoma: It never actually *says* that the clock is disabled by default, only how to enable it
01:18 PM Fuchikoma: nohit: Nice. That's scope is a real competitor to the Rigol 1054Z's hobbyist market share
01:18 PM Fuchikoma: They also have a 4-channel version IIRC
01:19 PM nohit: yes
01:19 PM nohit: i first thought of buying that
01:19 PM nohit: its only 510e shipped
01:20 PM Fuchikoma: It's a good scope for the price. If it was available at the time I might've gotten one of those instead of a 1054z
01:22 PM cehteh: looks nice
01:22 PM nohit: btw can you recommend any lab equipment ? i just recently got a "lab" in my home
01:23 PM Fuchikoma: Scope is a good start. A basic logic analyzer is also a good buy
01:23 PM nohit: i need a power supply
01:23 PM nohit: i have logic analyzer, analog discovery 2
01:23 PM Fuchikoma: nice nice
01:23 PM cehteh: i have only cheap stuff :D
01:23 PM nohit: any good PSUs you know ?
01:24 PM cehteh: still the owon scope is useful as well, while that siglent looks better
01:24 PM Fuchikoma: The only dedicated power supply I have is a moderately crappy analog Velleman unit, 3A/32V. Not super happy with it but it's linear and CC/CV capable
01:25 PM twnqx: a friend of mine recommended a rigol to me yesterday
01:25 PM Fuchikoma: My power supply needs are not that great so it's ahrd to justify spending money on them. Since I do mostly uC stuff I just use USB power (PC or battery pack)
01:25 PM cehteh: i have a linear transformerb ased psu as well .. efficiency is crap, but those are rock solid and produce clean output voltages for cheap
01:26 PM Fuchikoma: Yeah a linear supply is really needed for *clean* power
01:26 PM twnqx: he says the rigol has <350µV jitter
01:26 PM twnqx: and every decent supply has a swithicng primary and linear postregulator - pure switching would be crap
01:26 PM Fuchikoma: twnqx: Keyword: Decent :)
01:26 PM cehteh: yes but that adds to the prices and more components that can fail
01:26 PM cehteh: thus the cheap switchers are rather crappy
01:27 PM Fuchikoma: I've kinda had my eye on one of those front end modules that you add your own input on
01:27 PM twnqx: he was complaining about the Rohde & Schwarz (formerly Hameg) supplies
01:27 PM cehteh: haha
01:27 PM twnqx: super slow current limit ("LED Burns off before current limit trigger") and much noise
01:27 PM cehteh: https://www.youtube.com/watch?v=cuxWcBWPEPI get that scope :D
01:28 PM cehteh: 16GHz bandwith ... :D
01:29 PM Fuchikoma: I don't even have to click play to know I could buy a new house for the price of that scope
01:29 PM cehteh: would be a cheap house
01:29 PM cehteh: but still its insane
01:30 PM twnqx: the scope says "C:" in the file selector
01:30 PM twnqx: i won't buy a scope running on windows
01:31 PM cehteh: there was some attempt to run linux in the owon i have ... but never got into really usful state
01:31 PM Fuchikoma: https://www.aliexpress.com/item/32821185351.html These are really neat but you need an input supply for them, so that's like another $50 at least
01:33 PM cehteh: http://blog.weinigel.se/2016/05/01/sds7102-hacking.html someone at least troed really hard :)
01:37 PM twnqx: but yeah, rigol like dp831a are 600€ :P
01:39 PM Fuchikoma: Which ain't too bad for a triple output linear PSU
01:40 PM twnqx: yeah, they currently give 20% discount on the list price
01:40 PM twnqx: also, might be 600 before tax...
01:43 PM nohit: is that windows on that R&S scope ?
01:43 PM nohit: seems like it
01:43 PM twnqx: must be
01:43 PM twnqx: else c:\usere\... makes nos ense
01:43 PM twnqx: else c:\users\... makes no sense
01:43 PM Fuchikoma: Not uncommon to use an emedded OS
01:44 PM Fuchikoma: Didn't some old Techtronix scopes have Win3.1 on them or someshit?
01:45 PM nohit: this clearly has linux + Qt Quick https://www.youtube.com/watch?v=Q-gi_jfXhg0
01:45 PM nohit: i made a sililar project few months ago
01:46 PM nohit: *similar
01:46 PM Fuchikoma: https://www.tek.com/support/faqs/what-operating-system-used
01:46 PM twnqx: hm 1000V/20A programmable precision power supply
01:46 PM Fuchikoma: "Prior to September of 2003 the OS was Windows 98 Second Edition"
01:46 PM Fuchikoma: wew
01:47 PM twnqx: now it's windows 10, transmitting every button push to ms, needing internet every other week to not deactivate and a microsoft account to boot up?
01:47 PM nohit: https://usercontent.irccloud-cdn.com/file/gqbCjEst/IMG_0025.JPG
01:48 PM nohit: Qt Quick is nice
01:49 PM nohit: you do the backend with C++ and then the GUI with qml which is like html
01:55 PM nohit: and there's also this porgram called Qt Designer Studio, a gfx designer can design an UI with it and the program outputs QML so it can then be used by a programmer
02:16 PM nohit: those new stm32 MPU chips are great, they have cortex-a7 for linux and cortex-m4 for real time stuff
02:17 PM nohit: NXP have similar parts
02:21 PM nohit: ST provides their own linux distribution, OpenSTLinux, but i just rolled my own with Buildroot, its super easy
02:26 PM rue_mohr: rememebr that if you make it with QT, you have to rewrite it every year when they change the QT interface
02:26 PM nohit: nah
02:27 PM rue_mohr: I dont regreat buying that used tek scope
02:27 PM rue_mohr: its awesome
02:33 PM nohit: but Qt 6 is coming, that most certainly will change some things
02:33 PM nohit: its been Qt 5 for a long time
02:35 PM nohit: i have done desktop C++ gui and command line and embedded development with Qt and i have nothing bad to say about it
02:36 PM nohit: great free tool(s)
02:40 PM nohit: they recently released the Qt for MCUs which lets you use Qt on microcontrollers with help of a blitter
02:40 PM rue_mohr: no, my point is that apps made for qt5 wont likley just work with at6
02:40 PM rue_mohr: qt6
02:40 PM rue_mohr: cause they completely change the qt interrface
02:41 PM rue_mohr: so if you use qt for your program, then every time a new qt comes out, you need to rewrite your program
02:41 PM rue_mohr: and if you persist in writing all your programs with qt, you have a steady growing mountian of program you have to rewrite evey time a new qt comes uot
02:41 PM rue_mohr: its being the death of librecad
02:41 PM rue_mohr: they cant keep up
02:41 PM vmt: as if c++ isn't insane enough already, throw qt on top
02:42 PM rue_mohr: agreed
02:42 PM rue_mohr: part of why I write my programs in C
02:43 PM rue_mohr: I was really surprised when I tried to build some simple C++ stuff and it didn't work cause they changed c++
02:43 PM nohit: ok i'll report problems when i encounter them
02:43 PM rue_mohr: its not verry often they make a change to gcc that trips up general code
02:43 PM vmt: c has its quirks, ideally i'd write asm
02:43 PM rue_mohr: it doesn't matter if you report things
02:44 PM rue_mohr: the only quiks I know of are during inter-type things, and honestly, I'v not studdied it close enough to know if its a problem with me
02:44 PM vmt: but it's a huge pain in the ass, and cross-platform becomes a nightmare
02:44 PM rue_mohr: yup
02:44 PM rue_mohr: target a platform, stick with it
02:45 PM vmt: well, no. target a range, and make it realistic
02:45 PM rue_mohr: if you want it to be cross platform, write it in javascript (snicker snicker)
02:45 PM vmt: it's not like you run the same shit on a 6502 and a 16 core x64
02:47 PM rue_mohr: has anyone done a C compiler for 6502?
02:47 PM rue_mohr: I mean, if we have C for an avr...
02:54 PM nohit: yes they have
02:55 PM nohit: its the same compiler that now support that 8bit guy's new computer
02:56 PM nohit: https://www.cc65.org/
02:58 PM nohit: 8bit guy designed a new computer with 6502
07:15 PM rue_mohr: k
07:47 PM nohit: this https://www.c64-wiki.com/wiki/Commander_X16
07:48 PM nohit: i should learn 6502 assembly
09:28 PM rue_shop2: learning 6502 assembly is really about learning to use instructions for things other than what they were intended for so that you can do what you wanted to
09:28 PM rue_shop2: using the stack to transfer values between registers is just the start
09:28 PM rue_shop2: were talking self modifying code
11:16 PM day__ is now known as day