#avr | Logs for 2016-03-19

Back
[03:31:41] <rue_house> copper?
[06:01:39] <NicoHood> if i write a flash page with exactly the same data, will the flash lose a life cycle? or only if i write different data?
[06:06:10] <cehteh> raw writing .. yes the bits will loose a life cycle
[06:06:20] <cehteh> there are libs which handle that
[06:06:53] <cehteh> read flash first, compare if erase/rewrite is necessary, and possibly only write the bits which are needed
[06:07:44] <cehteh> otherwise with normal writing you have to erase the page first
[06:07:57] <cehteh> bits can be only flipped in one direction
[07:10:13] <h4x0riz3d> cehteh is that for avr's built-in flash?
[07:10:59] <cehteh> pretty all flash work that way
[07:11:10] <cehteh> only page sizes differ
[07:11:40] <cehteh> dunno if all are 0xff in erased state or if there are some which are 0x00 ...
[07:14:25] <cehteh> so gotcha, even less jitter now on the clock calibration
[07:14:36] <cehteh> i am done with that now
[07:15:51] <h4x0riz3d> for eeprom ICs, my impression is that you can't write less than a page
[07:25:03] <theBear> traditional parallel eeproms are whatever the parallel allows at a time, which i'm pretty sure was a byte wide, if not 2
[07:25:20] <theBear> that's 26 and err, 25? series for ee and e respectively
[07:25:45] <theBear> for newer serial stuff i forgot years ago
[07:25:51] <theBear> things move too fast to remember these days :)
[07:26:28] <theBear> maybe ee and e were 26 series, just with some different letters/specs
[07:48:04] <h4x0riz3d> but it would still kinda suck if you have to wait 5ms for writing a byte
[08:25:23] <theBear> everything will have some amount of time to write the minimum amount writable, tho older parallel (e(e))proms definately ain't fast
[08:40:04] <Lambda-Aurigae> remember when writing flash that you are writing zeros...to write a 1 you have to erase the flash...and erasing is usually done page at a time only.
[09:06:07] <liwakura> Lambda-Aurigae: nice info. Link on this?
[09:51:39] <Lambda-Aurigae> liwakura, umm...any datasheet on flash.
[09:51:51] <liwakura> okay....
[09:52:35] <cehteh> Lambda-Aurigae: not the other way around writing 0's?
[09:52:49] <Lambda-Aurigae> when you erase flash it sets to all 1s
[09:52:56] <cehteh> yes
[09:52:58] <Lambda-Aurigae> when you write data you flip those to zeros
[09:53:07] <cehteh> ah
[09:53:09] <cehteh> so :)
[09:53:10] <cehteh> correct
[09:53:11] <Lambda-Aurigae> you can't just write a 1 to flash
[09:53:20] <Lambda-Aurigae> you have to erase it..and that's done by page
[09:53:24] <Lambda-Aurigae> for MOST flash
[09:53:41] <cehteh> apropos over there on #arduino someone pointed me to http://www.atmel.com/devices/ATMEGA328PB.aspx
[09:53:57] <Lambda-Aurigae> yup..it's in the datasheet
[09:54:02] <cehteh> 5 timers (3x 16bit), 2 UART, 10 PWM
[09:54:05] <cehteh> *want*
[09:54:10] <Lambda-Aurigae> oh..new 328
[09:54:16] <Lambda-Aurigae> been out a while
[09:54:28] <cehteh> didnt know that yet
[09:54:39] <Lambda-Aurigae> I'm still liking the pic32mx270f256b
[09:55:27] <Lambda-Aurigae> 5 16bit with two pairs that can go 32bit
[09:55:34] <Lambda-Aurigae> timers that is.
[09:56:38] <Lambda-Aurigae> and able to execute code from flash or sram
[09:59:49] <Lambda-Aurigae> and something else I want to see come to AVR
[10:00:08] <Lambda-Aurigae> pll sync of system clock to usb clock so you can do usb without any external crystal or clock source.
[10:00:56] <cehteh> heh i just made that in software with OSCCAL setting
[10:01:07] <cehteh> but would be nice when one could hardware sync the clock
[10:01:37] <Lambda-Aurigae> yeah...that's a new standard on pics with usb hardware.
[10:01:51] <Lambda-Aurigae> I've seen it done on avr with v-usb and the attiny85 built in pll.
[10:02:06] <Lambda-Aurigae> but that is a very slow limited usb implementation.
[10:02:11] <cehteh> for atmels with external osc i'd wish there would be a assembler instruction to drop n cycles on the floor
[10:02:25] <cehteh> i mean completely also for hardware/timers
[10:02:39] <Lambda-Aurigae> like a prescaler?
[10:03:10] <cehteh> no just single instruction "skip a beat" like
[10:03:18] <Lambda-Aurigae> aahh.
[10:03:23] <Lambda-Aurigae> I can see how that would be handy.
[10:03:29] <Lambda-Aurigae> can't see it happening though.
[10:03:34] <cehteh> possibly not
[10:03:53] <cehteh> anyway my OSCCAL thing works nicely now, still some jitter but that unavoid able
[10:04:09] <cehteh> tinys PLL's might be useful too
[10:04:14] <Lambda-Aurigae> yeah..whenever you do live tuning you get jitter.
[10:04:18] <cehteh> ah moment
[10:04:27] <cehteh> the PLL cant be triggered externall iirc
[10:04:37] <Lambda-Aurigae> use an attiny85 with built in pll to drive the clock for another avr maybe?
[10:05:04] <cehteh> the pll is iirc hardwired to the internal RC oscillator
[10:05:05] <Lambda-Aurigae> yeah..it's tied to the internal clock only as I recall...never really looked at how they tune it though.
[10:05:08] <cehteh> but i can check the datasheet
[10:05:30] <cehteh> would be nice if it could be external driven
[10:06:18] <cehteh> and execute code from ram .. will never happen on AVR ..
[10:06:54] <Lambda-Aurigae> yeah.
[10:07:00] <Lambda-Aurigae> unfortunately.
[10:07:01] <cehteh> thats some drawback but the architecture is made around harward and execute from flash
[10:07:18] <cehteh> no much faster avrs either
[10:07:24] <cehteh> flash is the limit
[10:07:28] <Lambda-Aurigae> the pic32 is a mips32 core too.
[10:07:42] <Lambda-Aurigae> which means it's a hybrid architecture.
[10:08:03] <cehteh> i'd just go stm32 when i need something beefier
[10:08:03] <Lambda-Aurigae> can be either von-newman or harvard...and a mixture.
[10:08:25] <cehteh> its cheap and has shitloads of features
[10:08:33] <Lambda-Aurigae> yeah...
[10:08:41] <Lambda-Aurigae> arm core is the way of the future apparently.
[10:08:57] <Lambda-Aurigae> just wish someone would put out a decent arm in a dip package.
[10:09:06] <cehteh> and really feature/cores isnt that much of a selling point .. toolset is
[10:09:11] <cehteh> and PIC sux there
[10:09:20] <Lambda-Aurigae> pic32 uses gcc
[10:09:27] <cehteh> yes pic32
[10:09:30] <Lambda-Aurigae> you can get the source and recompile it yourself without the limitations.
[10:09:38] <Lambda-Aurigae> I don't mess much with any pic other than pic32
[10:09:58] <Lambda-Aurigae> except for a couple of them that make good usb-serial adapters.
[10:10:08] <cehteh> are there no good breakouts for STM32 to dil?
[10:10:21] <Lambda-Aurigae> oh, I'm sure there are.
[10:10:38] <cehteh> ok the 3.3V and weaker drives suck
[10:10:42] <Lambda-Aurigae> but then you gotta buy the chip, buy the board, solder them together,,,or,,,buy chip and board together already...and is much more expensive.
[10:10:47] <cehteh> thats why i still prefer arm
[10:11:01] <cehteh> nah i meant all togehter available
[10:11:37] <cehteh> http://abusemark.com/store/index.php?main_page=product_info&cPath=5&products_id=48&zenid=dnsr79og71d1gf58ts3dlodfq3 i have one of those, unused yet
[10:11:42] <Lambda-Aurigae> buy chip on a board is considerably more expensive than a 28pin dip chip sampled....
[10:11:53] <cehteh> but simpler breakout would be nier
[10:11:58] <cehteh> yes
[10:12:28] <cehteh> are there any 32 bit, 3.3V µC with DIL form factor?
[10:12:33] <cehteh> pic32?
[10:13:04] <Lambda-Aurigae> yup.
[10:13:07] <cehteh> ok
[10:13:10] <Lambda-Aurigae> pic32mx270f256b
[10:13:25] <Lambda-Aurigae> pic32mx250f128b little brother...same specs but half the flash and ram.
[10:13:31] <Lambda-Aurigae> 28pin dip available.
[10:13:40] <Lambda-Aurigae> 50MHz/83DMIPS
[10:14:04] <cehteh> and sometimes i'd wish for a half pitch breadboard :D ..
[10:14:12] <Lambda-Aurigae> hehe.
[10:14:33] <Lambda-Aurigae> 0.05inch pitch rather than 0.1 inch?
[10:14:41] <cehteh> does that exist somewhere . 1.27mm pitch
[10:14:43] <cehteh> yes
[10:15:14] <Lambda-Aurigae> not that I've ever seen.
[10:15:23] <Lambda-Aurigae> I've seen adapters but never a solderless breadboard.
[10:21:06] <Lambda-Aurigae> dag-nabbit! can't find any oaktek video cards in my pile.
[10:21:21] <Lambda-Aurigae> or old trident video cards either.
[10:21:39] <Lambda-Aurigae> some of those had zip package dual port sram chips on them.
[11:50:35] <LeoNerd> https://youtu.be/zm_ZBT4t4dA?t=22m53s Hah! What was I saying? Those AD584 acrylic cases _do_ use an ON semi 3406x chip :)
[12:04:15] <daey> does anyone here have experience with Freescale 8-bit uCs?
[12:06:15] <julius> hi
[12:06:43] <Lambda_Aurigae> I looked at freescale but the toolchain wasn't linux friendly at the time.
[12:06:57] <cehteh> LeoNerd: i'd rather get a naked reference and build my own than using that :D
[12:08:02] <daey> Lambda_Aurigae: that was the direction my question was going at. Ive got access to an essentially unlimited supply of 8bit freescale uCs. but i cant figure out the toolchain
[12:10:38] <LeoNerd> cehteh: Yah... only trouble is, these units are /cheap/ when you consider the parts inside them. Plus, the thing is nicer than I thought - it's not 5V powered. It has an onboard LiPol battery, and is 5V (I.e. USB) charged. It will standalone for power for a moment.
[12:10:50] <Lambda_Aurigae> daey, when I last looked it was before nxp bought freescale.
[12:10:57] <LeoNerd> Considering this entire unit costs about the same as buying the reference chip /alone/, I'm not sure I can see much argument against it
[12:11:15] <LeoNerd> Even at worst case, you rip out the battery and the boost circuit and feed +15V directly into the board by your own means.. you're still better off :)
[12:11:29] <daey> Lambda_Aurigae: currently trying to figure out the name jungle..so NXP bought freescale. but motorola seems to be involved with them as well>
[12:11:32] <daey> ?
[12:12:37] <cehteh> LeoNerd: but how much references do you need? ,, if a single reference chip does the job already and you can put it behind your lab power supply then its the more trustfulk solution
[12:12:50] <Lambda_Aurigae> In 2004 Motorola divested its whole semiconductor business to form Freescale Semiconductor.
[12:13:10] <LeoNerd> cehteh: Sure but you still have to buy that reference chip. This one comes in a case.:)
[12:13:33] <cehteh> i'll be happy when it lives on a mini breadboard forever
[12:13:54] <Lambda_Aurigae> NXP bought Freescale lock stock and barrel in December 2015 for 11.8billion
[12:14:38] <Lambda_Aurigae> at the time freescale was 4.9billion in debt too.
[12:15:14] <daey> i think once the price crosses a certain amount no one cares anymore, nor is able to really judge the worth
[12:16:47] <cehteh> anyone of you actually used the int24_t types in gcc/avr-libc?
[12:17:30] <cehteh> i have some usecase here but dont know if its worth it :D .. will save some memory and possibly a little bit faster
[12:17:57] <Lambda_Aurigae> cehteh, I seldom go beyond 16bit on avr..but I seldom have a need for such either.
[12:18:03] <cehteh> but possibly pulls a shitlore of code into the flash
[12:18:53] <cehteh> i need some sub microsecond timing which may also handle timespans longer than a few seconds
[12:20:08] <cehteh> 16 bit overrun in 32ms ... 24bit last more than 8 secs ...
[12:28:33] <phinxy> Will this low pass filter work or should the resistor be in series with the inductor? http://i.imgur.com/J32Egxw.png
[12:31:37] <daey> phinxy: why did you put it in parallel?
[12:31:54] <phinxy> i was told to do that in #kicad
[12:31:59] <phinxy> might have been a typo
[12:32:21] <cehteh> why resistor at all?
[12:32:53] <phinxy> to stop the inductor from resonance i was told
[12:32:59] <daey> without it you could get resonance
[12:33:02] <cehteh> ah right
[12:34:33] <phinxy> Not sure about the resistor value either. right now its supposed to be 3dB at 300khz
[12:34:40] <cehteh> but .. how big is the coil=
[12:34:45] <phinxy> 10uF
[12:34:51] <cehteh> H
[12:34:52] <phinxy> uH*
[12:35:16] <cehteh> i wonder if it ever can come into resonance with 100nF caps
[12:35:49] <phinxy> i guess it could resonate with the noise
[12:36:11] <cehteh> whats its value? 1K?
[12:36:53] <cehteh> just fire up a simulator and test :D
[12:36:54] <daey> i would put the resistor in series, to me it looks counter productive to put it parallel
[12:37:11] <cehteh> in series will affect the voltage
[12:37:18] <daey> no
[12:37:19] <cehteh> depending on the current you draw
[12:37:41] <daey> wasnt it just a voltage sens input?
[12:37:58] <cehteh> no
[12:38:04] <cehteh> AVCC .. supply
[12:38:20] <daey> my bad
[12:38:28] <cehteh> when it is a sense input i'd leave the coil out
[12:38:36] <cehteh> http://www.falstad.com/circuit/circuitjs.html .. go try :F
[12:42:56] <cehteh> sim says lots of noise
[12:45:35] <cehteh> my gut feeling says one want biggier caps
[13:40:56] <LeoNerd> My FY3224 arrived. :)
[13:41:04] <Lambda_Aurigae> sounds kinky.
[15:48:48] <julius> ive got a 10w led attached to a old intel fan (fan not running) but the cpu cooler is not that small and its still like 30+C
[15:59:10] <Casper> julius: sound normal
[15:59:35] <Casper> 10W is alot to dissipate passivelly, specially on an heatsink designed for active cooling
[16:04:28] <julius> looks so innocent the led
[16:06:05] <julius> and what kind of spice do you guys use on linux, hopefully someone does?
[16:06:07] <inkjetunito> heh
[16:06:36] <julius> ive started ngspice and its just a text input....i would prefer a graphical input to place the components
[16:08:15] <Lambda_Aurigae> I prefer garlic pepper...but don't use it on my computers, just on food.
[16:08:41] <Lambda_Aurigae> kids and your graphical interfaces.
[16:09:00] <Lambda_Aurigae> why, in my day we drew in autocad by typing in coordinates,,,,and LIKED IT!
[16:22:32] <julius> i like to have a "look" at the circuit
[16:22:44] <julius> even if the rest of the program ist mostly in text lines
[16:26:08] <wesley-chan> cehteh, hey
[16:26:14] <wesley-chan> I heard you made an OS for AVR or something
[16:33:30] <cehteh> os is a bit overstating, scheduler more
[16:34:07] <wesley-chan> I see
[16:34:10] <wesley-chan> Is it public?
[16:34:18] <wesley-chan> I'd like to play with it a bit
[16:34:44] <cehteh> git://git.pipapo.org/muos
[16:34:52] <cehteh> not doc'ed yet
[16:35:48] <wesley-chan> Im on my Chromebook do you have a like
[16:35:52] <wesley-chan> web link for it
[16:36:52] <cehteh> only gitweb http://git.pipapo.org/?p=muos;a=summary
[16:38:08] <wesley-chan> Well would you be willing to put it in a .tar or .zip and upload it? If not thats fine but it'd make my life a lot easier
[16:38:17] <wesley-chan> Since I have to reboot into Mint and I have a bunch of tabs open
[16:38:20] <cehteh> gitweb has tar export
[16:38:35] <cehteh> well dunno if that works
[16:38:47] <wesley-chan> Dont see it
[16:38:48] <wesley-chan> Where?
[16:39:03] <cehteh> http://git.pipapo.org/?p=muos;a=snapshot;h=c6be97403595691ab9aaa5f26af95f5a7e830f91;sf=tgz
[16:39:12] <cehteh> what mpu do you want to use?
[16:39:35] <wesley-chan> AVR/Arduino
[16:39:42] <cehteh> devel branch is at 328p / arduino nano .. but i am now working on the tiny branch playing with attiny85
[16:41:03] <wesley-chan> I see
[16:41:18] <wesley-chan> So what is your scheduler capable of?
[16:41:58] <wesley-chan> Is it practical or just a novelty?
[16:42:07] <cehteh> depends on configuration, by now there are 3 queues, one by timer for soonish events, one high prio and one low prio queue
[16:42:52] <cehteh> i started around chrismas and having fun with it, evolving as much i go/need something
[16:42:56] <wesley-chan> Is it possible to load "programs" without a reboot?
[16:43:22] <cehteh> just starting the first small project as proof of concept with it now (or rather working on things to make that work)
[16:43:30] <cehteh> nah
[16:43:50] <cehteh> its meant to be small, not featureful
[16:44:05] <cehteh> goal is that it is useable on attinys as well
[16:44:12] <wesley-chan> Nice
[16:44:14] <Lambda_Aurigae> loading programs on the fly is not something normally done on an avr.
[16:44:18] <cehteh> scheduling is about scheduling functioncalls, not threads
[16:44:31] <wesley-chan> Lambda-Aurigae, is it even possible
[16:44:34] <cehteh> that should be *doable*
[16:44:39] <Lambda_Aurigae> possible, yes...
[16:44:44] <cehteh> but i never thought i need/want it
[16:44:52] <cehteh> but i would accept patches :D
[16:44:55] <wesley-chan> so how would you do it?
[16:45:04] <Lambda_Aurigae> you would have to use the bootloader section to load your "program" into a section of flash then jump to it.
[16:45:14] <wesley-chan> Like I got a hack running that edit the on-board flash memory during runtime but
[16:45:16] <Lambda_Aurigae> on an avr, I wouldn't do it.
[16:45:20] <cehteh> or on tinys w/o bootloader .. flash pages on the go
[16:45:22] <wesley-chan> that proved to be highly impractical
[16:45:26] <cehteh> yeah
[16:45:36] <cehteh> better use a bootloader
[16:45:39] <wesley-chan> Though I wonder if you could use it to create some "self-modifying code" and load at runtime that way
[16:45:40] <Lambda_Aurigae> I am doing it with a pic32mx270f256b however.
[16:45:46] <wesley-chan> oh
[16:45:48] <wesley-chan> thats what you just said
[16:45:49] <wesley-chan> isnt it
[16:46:00] <Lambda_Aurigae> but that can run programs from sram so I'm not overwriting flash.
[16:46:08] <cehteh> what i once thought about is storing the state into eeprom, then one can shutdown and restart where left of
[16:46:15] <wesley-chan> I was about to say
[16:46:28] <wesley-chan> Could you possible load a program from an external EEPROM?
[16:46:39] <Lambda_Aurigae> yes,,,a bootloader could do that.
[16:46:40] <cehteh> avr's can only execute code from flash
[16:46:53] <cehteh> so everything has to be written to flash somehow
[16:46:58] <Lambda_Aurigae> I've done it even...loading from sd card even.
[16:47:19] <cehteh> other archs can load programs to ram
[16:47:35] <cehteh> if you have plenty of ram then you can have module loading/unloading/updating
[16:47:44] <Lambda_Aurigae> yup.
[16:47:44] <wesley-chan> I hate to dis AVR but
[16:47:51] <Lambda_Aurigae> I've done it with 8052 and pic32mx both.
[16:47:52] <wesley-chan> the chips are super limited in what they can do
[16:48:02] <Lambda_Aurigae> and with 6502 but that's not really a microcontroller.
[16:48:16] <Lambda_Aurigae> AVR has its strengths and weaknesses.
[16:48:22] <Lambda_Aurigae> just like every other platform.
[16:48:31] <cehteh> debugwire debuggin hotpatches flash :D
[16:48:34] <Lambda_Aurigae> for ease of use, I feel the AVR blows everything else away.
[16:48:52] <cehteh> exactly
[16:49:04] <cehteh> wesley-chan: what do you intend to do?
[16:49:08] <wesley-chan> Do they intentionally lock it down so much or is that just a side-effect of the design
[16:49:10] <Lambda_Aurigae> it's about mid range for feature set
[16:49:13] <wesley-chan> cehteh, with what?
[16:49:20] <Lambda_Aurigae> and mid to low range for overall processing power.
[16:49:22] <cehteh> avr/ my OS
[16:49:40] <wesley-chan> oh I just wanted to toy around with it
[16:49:43] <wesley-chan> thought it sounded neat
[16:49:58] <cehteh> i maybe was thinking about a very (very!) simple script interpreter, something forth alike or so
[16:50:04] <cehteh> someday
[16:50:08] <Lambda_Aurigae> hehe
[16:50:19] <cehteh> but really the simplest form
[16:50:21] <Lambda_Aurigae> I'm working on both basic and c interpreters on and off.
[16:50:39] <Lambda_Aurigae> and have written a few simpler scripting thingies for avr over the years for special purposes.
[16:51:42] <cehteh> yes .. actually i came to the conclusion to never do it and implement ad hoc things whenever needed
[16:52:04] <Lambda_Aurigae> I'm having fun with the C subset interpreter currently.
[16:52:14] <cehteh> like for led blinking i once made a sequencer which works along strings "rrgg rrgg " .. etc
[16:52:28] <cehteh> or my oven controler also parse strings for temperature curves
[16:52:50] <cehteh> thats simple and one can edit things from commandline
[17:03:10] <cehteh> http://public.pipapo.org/d4r_signal.png .. so now parsing that signal :D .. RC transmitter
[17:24:10] <cehteh> pinchange interupt with more than one pin is urgs
[17:25:29] <cehteh> store state, xor which pins have changed ....
[18:00:42] <LeoNerd> Beware debounce logic
[18:13:51] <lorenzo> cehteh: if you used a PIC instead of an AVR, you could have used one of its configurable logic cells to perform a XOR on the input, and wire the output to an interrupt
[18:13:57] * lorenzo runs far away
[18:20:54] <cehteh> some AVR's have more than one pinchange isr
[18:21:04] <cehteh> but for now one is good enough for me
[18:22:59] <cehteh> done for today
[18:23:45] <cehteh> µC clock sycned with remote control receiver, parsing output singnal .. testing that tomorrow
[20:53:23] <Evidlo> Is bitshifting an int16 particularly slow compared to an int8, or just about 2x slower?
[20:57:21] <Lambda_Aurigae> well, the assembly code for it works in 8 bits.
[20:57:33] <Lambda_Aurigae> so, to do 16 bits it requires assembly commands.
[20:57:40] <Lambda_Aurigae> as you have to work with 2 bytes.
[20:57:48] <Lambda_Aurigae> so it will take twice as long.
[20:58:54] <Evidlo> I was just wondering if it took more than 2x as long, since it has to copy a bit from one byte to the other
[20:59:53] <Lambda_Aurigae> the bitshift should shift the top bit out to a status register I think...would have to look at the command.
[21:00:09] <Evidlo> I'll just try it and see if it's fast enough
[21:03:05] <Lambda_Aurigae> use lsl or lsr
[21:03:09] <Lambda_Aurigae> then use rol or ror
[21:03:34] <Lambda_Aurigae> the rol/ror command will use the carry flag to roll a bit into the empty space.
[21:03:52] <Lambda_Aurigae> so it can be done with just 2 commands.
[21:04:20] <Lambda_Aurigae> both are single word and single cycle commands.
[21:12:00] <Casper> there is 3x 16 bits registers... does the shifting work on those? if so I hope gcc use it :D
[21:23:58] <Lambda_Aurigae> I'm not seeing a command to do so.
[21:25:26] <Lambda_Aurigae> lsl, lsr, rol, and ror all only work on single 8bit registers.
[21:26:08] <Casper> :/
[22:54:34] <Evidlo> Can someone explain what (foo >> 8) * (foo >> 8) is doing?
[22:54:42] <Evidlo> foo is an int16
[22:54:45] <learath> bitshift, not sure what the * is doing.
[22:54:55] <Evidlo> I think its some kind of absolute value function
[22:59:22] <Casper> (foo/256)² ?