#avr Logs

Aug 05 2017

#avr Calendar

01:58 AM Emil: Casper: >using streams and printfs...
02:00 AM Casper: you missed float and log
02:00 AM Casper: https://paste.pound-python.org/show/URkyZtsxCRkhDnJv7eMR/ latest code
02:00 AM Casper: if you have a better, working way to do it... let me know...
02:01 AM rue_more: #define SetBit(BIT, PORT) (PORT |= (1<<BIT))
02:01 AM rue_more: #define ClearBit(BIT, PORT) (PORT &= ~(1<<BIT))
02:01 AM rue_more: #define IsHigh(BIT, PORT) (PORT & (1<<BIT)) != 0
02:01 AM rue_more: #define IsLow(BIT, PORT) (PORT & (1<<BIT)) == 0
02:01 AM rue_more: #define NOP() asm volatile ("nop"::)
02:02 AM rue_more: UARTTXPORT |= (1 << UARTTXBIT); -> SetBit(UARTTXBIT, UARTTXPORT);
02:02 AM rue_more: WHAT IS MORE READABLE!?
02:03 AM rue_more: I'll just repost those macros every week till someone figures it out...
02:04 AM rue_more: data >>= 1; I can contradict myself
02:05 AM rue_more: for(i=7; i != 0; i--) is faster than for(i=0; i <=7; i++)
02:06 AM rue_more: because its always faster to test for zero than some random number
02:06 AM rue_more: yes...
02:06 AM * rue_more holds his head in shame
02:06 AM rue_more: I optimized my delay function..
02:06 AM rue_more: you can also do this for transmitting bits,
02:08 AM rue_more: for(i=0x01; i !=0; i<<=1){ if(data&i){Setbit(...)}else{ClearBit(...)} make sure i is only 8 bits, and unsigned
02:08 AM Casper: and yes, I used 8n2
02:09 AM rue_more: msb first? for(i = 0x80; i!=0; i>>=1){
02:09 AM Casper: the second stop bit will help since it run on RC, for the receiver to get the data...
02:10 AM Casper: where do you see msb?
02:10 AM rue_more: no, just adding an option to the plate for that trick
02:11 AM rue_more: its all more relivent when your trying to push the data out as fast as you can
02:11 AM rue_more: so, at 9600 buad...
02:11 AM rue_more: 8Mhz cpu...
02:12 AM rue_more: 833 cycles
02:13 AM rue_more: I suppose if your not doing anything else, there is no point if worrying about making it irq driven.
02:13 AM Casper: I was planning earlier
02:13 AM Casper: but it's nothing time critical for the rest
02:13 AM Casper: so I didn't bother to do it
02:13 AM rue_more: yep
02:13 AM Casper: you know, play with timers and fight for the proper speed...
02:14 AM rue_more: didn't need recieve for that one?
02:14 AM Casper: no just transmit
02:14 AM rue_more: dont know if that was you working on it a few days ago
02:14 AM rue_more: cool
02:14 AM Casper: maybe it was
02:15 AM Casper: I got some small issues, fighting with gcc
02:15 AM rue_more: ?
02:15 AM Casper: that insist on doing math with integer
02:15 AM rue_more: ah
02:15 AM Casper: and few other bugs here and there
02:15 AM rue_more: did you get it to do proper floating?
02:15 AM Casper: yes
02:16 AM rue_more: is the cap for a startup delay?
02:16 AM Casper: somehow there is an issue with my printf for the temperature, but it's not a big deal
02:16 AM Casper: yes
02:16 AM Casper: basically it's a fridge thermostat
02:16 AM rue_more: howcome not just on the reset pin?
02:16 AM Casper: so it's a power failure delay
02:17 AM rue_more: ah
02:17 AM Casper: when the compressor goes on, it charge the cap
02:17 AM rue_more: let the motor reset
02:17 AM rue_more: aaah, I see
02:17 AM rue_more: you just wrote the replacement fridge controller I'm gonna need
02:17 AM Casper: and when off/power failure the RC will make about a 4 minutes delay since the turn off
02:17 AM Casper: lol
02:18 AM rue_more: I can put a pot on the pullup of the NTC to change the set temp? :)
02:18 AM Casper: just implement it on something bigger than a tiny85 and you can actually do proper setting?
02:18 AM Casper: 4:52:26 Temperature: 23.645�°C Status: 4: On Since: 17480 secs Reset: None
02:18 AM Casper: see the issue at the temperature
02:19 AM rue_shop3: why not clock it out to a 447880?
02:19 AM Casper: actually, the output on this one was mostly for debugging purpose
02:20 AM Casper: and diagnostic
02:20 AM Casper: hence the reset source display
02:20 AM Casper: if anything else than "none" is there, then a problem occured
02:24 AM Casper: rue_shop3: I'll write the RC I used in the file eventually
02:36 AM Casper: WTH.. I broke something
02:36 AM Casper: 0:01:34 Temperature: 65.18°C Status: 4: On Since: 28 secs Reset: External
02:37 AM Casper: one part is fixed, one part is broken
02:37 AM rue_shop3: if I use an lm75 I can put it into high res mode
02:37 AM rue_shop3: I think low res is 0.5 degrees C
02:39 AM Casper: fixed...
02:41 AM rue_shop3: so is that a reprap ntc or a computer power supply ntc?
03:07 AM Casper: brand new, there is even the datasheet linked in the code
03:14 AM Casper: rue_shop3: you know what's funny? the reference voltage for the ADC is not important. Not only that, but the supply voltage is also not critical. It can also vary and it won't matter!
06:33 AM hetii: Hi :)
06:45 AM hetii: Any clue how accurate crystal generators should be? I check one that should be 25MHz and got value like 24.999108 MHz
06:46 AM hetii: So wonder now if something is worng with it or with my frequency counter.
06:46 AM LeoNerd: That's 1kHz out of 25MHz... one part in 25000
06:46 AM LeoNerd: 40 ppm
06:46 AM LeoNerd: That's usually about what to expect
06:47 AM hetii: this crystal generator looks like: http://circuits.datasheetdir.com/460/LXOM-AT-pinout.jpg
06:47 AM hetii: so you think that all is fine with it?
06:49 AM antto: do you need uber accuracy?
06:49 AM cehteh: 3nines are pretty good
06:50 AM cehteh: other question is how accurate is your frequency counter? :D
06:50 AM hetii: Well, I plan to build own multitool device where I will have frequency meter and I wonder how many digits are important on every frequency range (i.e. KHz/MHz/GHz)
06:50 AM hetii: and also when I can assume that it counts right
06:51 AM hetii: with proper accuracy
06:52 AM cehteh: it all depends on how accurate your reference is
06:52 AM hetii: cehteh, currently I use this code: https://github.com/dword1511/stm32-freqmeter for STM32F103C8T6
06:52 AM cehteh: local standalone clocks with very high accuracy get very pricy
06:53 AM LeoNerd: Some of the oven-controlled xtals aren't too bad
06:53 AM cehteh: but expensive
06:54 AM cehteh: i'd rather try to avoid that and use some external time reference, gps or dcf receiver or somesuch
06:54 AM cehteh: but for measureing equipment that may not be a proper solution
06:54 AM cehteh: you can get this atomic clock on a chip for $$$
06:55 AM LeoNerd: Take a look on ebay for "OCXO" - can usually find a 10MHz one for under $100 if you look enough
06:55 AM cehteh: compared to a 'normal' osc that is expensive
06:55 AM LeoNerd: I usually find I don't need frequency anywhere near there though
06:56 AM LeoNerd: Ohyes, it's the sort of thing you use as a transfer standard for calibrating equipment usually
06:56 AM LeoNerd: You wouldn't use it standalone
06:56 AM hetii: for testing purpose I probably will stick with regular two pin crystal and maybe will change it to some external crystal generator.
06:56 AM cehteh: https://www.microsemi.com/products/timing-synchronization-systems/embedded-timing-solutions/components/sa-45s-chip-scale-atomic-clock
06:57 AM antto: i still wonder whether you really need that accuracy
06:57 AM cehteh: are there programmable OSC's with very fine resolution?
06:57 AM cehteh: if yes, using such one and constantly calibrate it with some external signal like gps might be a good choice
06:58 AM LeoNerd: Usually you use a 10MHz thing as a reference to check the frequency meter with
06:58 AM LeoNerd: Then knowing its accuracy, you can measure other frequencies with that
07:00 AM hetii: Ok probably I will need at the end of the day find someone who have such accurate professional frequency meter and check my generators there and then compare its values with my device
07:00 AM LeoNerd: That's usually the way forward
07:00 AM LeoNerd: I have a list of UK cal labs that I need to get some of my stuff measured in also
07:00 AM LeoNerd: Might do that next week
07:32 AM hetii: I found such circuit of transistor tester and wonder if be able to migrate it on stm32https://www.eevblog.com/forum/testgear/$20-lcr-esr-transistor-checker-project/?action=dlattach;attach=188455
07:32 AM hetii: Also any clue what could be maximum frequency range of it?
09:32 AM Emil: Wtf
09:32 AM Emil: Is my module broken
09:33 AM Emil: Why is there a 26MHz (exact, sounds like a crystal) connected to my gpio0
09:48 AM lemm|ngs is now known as lemmings
10:20 AM Lambda_Aurigae: http://hackaday.com/2017/08/04/bespoke-processors-might-soon-power-your-artisanal-devices/
10:24 AM learath: Lambda_Aurigae: someone needs a slapping
10:27 AM Lambda_Aurigae: oh?
10:27 AM Lambda_Aurigae: lower power processors for lower power requirements?
10:27 AM Lambda_Aurigae: heck, I liked the4004!
10:28 AM enh: nice article
10:52 AM _ami_: https://developer.sony.com/2017/08/03/sony-introduces-smart-sensing-iot-board-arduino-compatible/ Sony's arduino board. - that comes from nowhere! surprised!
10:55 AM antto: o_O
11:05 AM Lambda_Aurigae: am ardweeny with 8MB flash and 1.5MB of ram
11:05 AM Lambda_Aurigae: almost enough
11:05 AM Lambda_Aurigae: looks like a 6 core cortex m4f
11:17 AM MrFahrenheit: on an attiny, can I use both A and B CTC modes at the same time on one timer, or is it just one or the other?
11:17 AM LeoNerd: The "mode" applies to an entire timer unit
11:17 AM LeoNerd: not just to one or other compare channel
11:18 AM MrFahrenheit: so why do they have two? just so switching between two configurations is faster or..?
11:19 AM LeoNerd: Two compare channels is good for two independent LEDs of brightness, for example
01:26 PM MrFahrenheit: well I found the reason for my confusion, there's a bug in simavr's handling of timer compare channels
01:44 PM antto: i looked at simavr, and there were just a few chips available in it
01:44 PM antto: like.. very very few
01:55 PM MrFahrenheit: https://github.com/buserror/simavr#emulated-cores-very-easy-to-add-new-ones
05:44 PM Emil: https://en.wikipedia.org/wiki/Name-letter_effect
09:05 PM dan3wik is now known as dan2wik