#avr Logs

Jan 28 2021

#avr Calendar

09:00 AM Sponge5: Does anybody here have any experience with simavr?
09:07 AM cehteh_: yes
09:09 AM cehteh_: just dont use simavr, its not so easy
09:09 AM cehteh_: esp when it comes down to simulate connected hardware
09:09 AM cehteh_: without any hardware connected you can debug your c programs without a simulator
09:11 AM Sponge5: Well I'd like to simulate UART communication and maybe even mangle some bits if that's possible
09:12 AM vmt: well that you can do without a simulator really to test your logic
09:14 AM Sponge5: I'll be probably working on FreeRTOS-related firmware for custom ATmega boards for a while, so I'm open to spending some time learning to use powerful tools
09:14 AM Sponge5: and simavr looked like exactly what I need
09:15 AM Sponge5: Since I'm trying to avoid an IDE setup and write my own makefiles
09:15 AM cehteh_: lol
09:15 AM vmt: freertos on mega? *cough*
09:16 AM Sponge5: elaborate..?
09:16 AM vmt: what do you plan on getting out of it?
09:17 AM Sponge5: from freertos on mega?
09:17 AM Sponge5: or from simavr
09:18 AM vmt: butter on a biscuit? yes, freertos
09:20 AM Sponge5: well, that's my current project at work, not really something I can change
09:21 AM vmt: ah, i hope this came from management and not some guy actually working on atmegas
09:21 AM vmt: curious though, what's the project?
09:21 AM cehteh_: considered to apply for another job?
09:21 AM Sponge5: Dunno how much I can say due to NDA
09:22 AM cehteh_: lol
09:22 AM vmt: Sponge5: but, mgmt or no?
09:22 AM cehteh_: pretty much sounds like "hidden behind NDA for a cause" :)
09:23 AM Sponge5: the ATmega board will communicate with some servos and will be hooked up to a RPi type machine that will run NodeJS interface
09:23 AM vmt: :DD
09:23 AM cehteh_: i'd rather do exactly the reverse, write makefiles and setup an IDE than trying to get things working on simavr
09:23 AM vmt: ladies, gentlemen... :D
09:23 AM cehteh_: hahaa
09:24 AM cehteh_: sounds like bullshit bingo at first
09:24 AM vmt: fadhype bingo
09:25 AM Sponge5: You're not being exactly helpful. I guess AVR culture is different from what I'm used to.
09:25 AM vmt: anyway, i know freertos has a pe scheduler, but does it come with an option for a co-op one?
09:25 AM cehteh_: anyway i in my experience simavr a) works b) isnt a big help
09:25 AM vmt: pe scheduler on an atmega is super 2021 though, so good on you
09:26 AM vmt: Sponge5: what's that culture?
09:27 AM cehteh_: Sponge5: its more technical than culture
09:27 AM Sponge5: IDK, from my reference point, when I ask a question people first try to help and then (optionally) take a piss
09:27 AM cehteh_: sure you can put freertos on your avr .. but that wont leave much for your application
09:27 AM vmt: Sponge5: here's some worth-your-weight-in-gold advice: ditch freertos, it
09:27 AM vmt: it's moronic
09:28 AM cehteh_: and you cant really simulate hardware/timing unless you put shitloads of efforts into it to get it right, by that you programmed and debuged the firmware on real hardware 20 times over
09:28 AM vmt: exactly
09:29 AM cehteh_: you can burn a lot time an money by trying so, evntually it may even work
09:29 AM cehteh_: but wastes so much resurces
09:29 AM Sponge5: cehteh_: interesting, so is it better to put effort into debugging on target?
09:30 AM vmt: a lot of the times, yes
09:30 AM Sponge5: with JTAG/other stuff
09:30 AM vmt: you don't seem like you have a lot of experience with small mcus...?
09:30 AM cehteh_: get a fast ISP programmer, get a prototype of your mega board .. hook it up with real or mock hardware on breadboards (scope, logic analyzer, leds)
09:30 AM cehteh_: and start programming
09:30 AM Sponge5: vmt: pretty much none actually
09:31 AM cehteh_: ah on the big mega you even have jtag
09:31 AM Sponge5: yea JTAG is an option
09:31 AM vmt: yeah, so you can usually get by with very simple debugging. but, honestly, if you're looking into something with OCD, just ditch avrs in general then.
09:31 AM Sponge5: freertos takes 2% on our board
09:31 AM cehteh_: either way getting things on real hardware running without wasting efforts to simulate it would be faster and give more confidence that it *really* works
09:32 AM cehteh_: Sponge5: how about ram/cycles and other resources, i am not talking about the flash
09:32 AM Sponge5: cehteh_: yes but it's limited by the fact that you can setup only so many HW debugging stations
09:32 AM Sponge5: so you can't work remotely for example :D
09:32 AM cehteh_: how many developers working on that thing?
09:32 AM Sponge5: 3
09:32 AM cehteh_: i did worked remote
09:33 AM cehteh_: actually i made a mockup here developed a firmware for a client
09:33 AM cehteh_: then send it there (2000km away) and it worked on the first try on the real hardware
09:33 AM vmt: Sponge5: so, in effet, you need gear for three people
09:33 AM cehteh_: and he himself usually works remote on the machine from home office as well
09:33 AM vmt: in effect, rather
09:34 AM vmt: this is a problem, how?
09:34 AM Sponge5: that takes time and resources to setup too I guess
09:34 AM vmt: err. no.
09:34 AM cehteh_: so dont say it wont work and getting 3 deleopment boards one for each developer would be peanuts
09:35 AM vmt: like, are you actually working with professionals here or nodejs monkeys without opposable thumbs?
09:35 AM cehteh_: even equippin each developer with a logic analyzer and scope and more should still be peatnuts compared to the efforts rigging up a simulator
09:35 AM Sponge5: cehteh_: ram/cycles stuff has been also taken care of, the chip was chosen deliberately
09:35 AM cehteh_: as in "yes we use the biggest one just because" :)
09:36 AM vmt: Sponge5: which part of your application warrants fucking pre-emptive scheduling??
09:36 AM vmt: because developing straight for avr is 150% simpler than freertos
09:36 AM cehteh_: anyway yes your way may eventually work, it just loos extremely wasteful to me. if its mgmt decision and you cant complain, well go with it you'll have some fun in the forseeable future
09:37 AM vmt: like i'm really curious who's in charge of this project
09:37 AM vmt: and/or what does he do
09:37 AM cehteh_: i made my own OS for AVR's which does coop scheduling
09:37 AM cehteh_: (and more importantly runs on a single stack)
09:38 AM vmt: you don't even need co-op scheduling, most of the time. and also, it's dead simple to implement without pulling an rtos framework into it
09:38 AM cehteh_: as soon as multiple stacks and/or dynamic memory allocation comes into the game it gets hairy
09:38 AM cehteh_: yes
09:38 AM cehteh_: anyway i do something else
09:39 AM vmt: also, you should really not do dynamic allocation unless you're really, really starved on memory
09:39 AM vmt: and then it gets hairy by default because you have to be constantly shitting your pants going OOM
09:39 AM cehteh_: i never do
09:39 AM cehteh_: wel lthe 'one stack per thread' could be almost equally evil
09:40 AM cehteh_: you have to add shitloads of safeguards when you want to have that reliable
09:40 AM vmt: sure, but you shouldn't get/implement a scheduler unless you get some tangible gains out of it
09:40 AM vmt: i'd argue, most stuff running on a mega, don't
09:41 AM * vmt wonders if freertos has oomkiller
09:44 AM cehteh_: i wonder if one want to kill things on a RTOS
09:45 AM vmt: "shit, the nodejs interface is going nuts, my heuristics show the pacemaker thread has some available resources"
09:45 AM vmt: *pulls trigger*
09:48 AM Sponge5: It's my job to make sure the mega board doesn't go nuts based on commands coming from the RPi
09:49 AM cehteh_: lol
09:49 AM Sponge5: the FreeRTOS choice was so that I'd have it easy tossing out garbage messages or dealing with too many of them
09:50 AM Sponge5: and extensibility
09:50 AM cehteh_: looks like a afternoon job :D
09:50 AM cehteh_: the not going nuts thing
09:51 AM Sponge5: I think the same way as throwing resources into making simavr work would be the same as creating my own scheduler and communication and bunch of other stuff
09:51 AM cehteh_: just static buffers, parsing/deserialization and drop all crap
09:55 AM Sponge5: There's possibly more functionality from FreeRTOS that we'd like to use, I just don't know about it yet
09:56 AM Sponge5: i2c comes to mind
09:59 AM rue_mohr: but we live in a world where, rather than make things efficiently, we just throw more horsepower at it.
10:00 AM rue_mohr: so it takes a raspberry pi to flash a led at 10Hz cause your using java to do it? people typically dont care
10:01 AM rue_mohr: and hal on hal and virtualiztion
10:02 AM twnqx: hey, i use an avr to generate a 50hz signal
10:02 AM rue_mohr: you could pay an engineer to make something thats cheap to make, or a highschool kid to do the same thing in more expensive hardware, and just pass the costs on to the customer
10:02 AM twnqx: even though i could use an ne555 (with way more external components)
10:03 AM twnqx: i should have used that 8pin ARM LPC though. far less expensive
10:03 AM rue_mohr: did you have an OS, a few HAL layers, and realtime interpreted source code?
10:03 AM twnqx: i had like 15 lines of C
10:03 AM Sponge5: I should have specified that we're making a prototype, not a product (yet)
10:04 AM twnqx: even less reason to use an OS on a platform that is not suitable for it
10:04 AM rue_mohr: If you were using a 555, you probably would have used 2 resistors too I'll bet
10:04 AM twnqx: exactly. the avr needed 0 externals.
10:04 AM rue_mohr: they will just carry it all forward, optimization costs money
10:05 AM rue_mohr: what does a 555 cost anyhow?
10:05 AM rue_mohr: $5/100pcs
10:05 AM rue_mohr: 5c
10:06 AM rue_mohr: huh
10:06 AM twnqx: https://i.imgur.com/Db4nqCP.jpg there's the AVR (deadbugged top right) in all its glory
10:07 AM rue_mohr: what the cheapest avr worth in volumes of 100
10:07 AM twnqx: much more
10:07 AM rue_mohr: about 50c?
10:07 AM twnqx: arms are way cheaper
10:07 AM rue_mohr: ok, how about the cost of an arm then?
10:07 AM rue_mohr: anyone under 50c/chip?
10:08 AM rue_mohr: oh its a car computer
10:08 AM rue_mohr: hah, that took me a while
10:08 AM twnqx: it was :P i wouldn't put it back :D
10:09 AM rue_mohr: but really, what are the arms worth?
10:09 AM twnqx: trying to find the price
10:09 AM rue_mohr: k
10:09 AM rue_mohr: I'd look but if you dont have a part # on ali your up the creek
10:09 AM twnqx: seems the lpc810 isn't made any more or something...
10:11 AM rue_mohr: oh, soic 555 are cheaper
10:11 AM rue_mohr: 4c
10:12 AM twnqx: interesting
10:12 AM twnqx: mouser/digikey are like 50-60 at 500
10:12 AM rue_mohr: I hear dip prices are going up on account of evolution
10:13 AM twnqx: i hear prices go up, period >_>
10:14 AM twnqx: just got a notification from my assembly house
10:14 AM twnqx: 5-50% up
10:14 AM twnqx: and lead times in worst case up to 80weeks
10:14 AM twnqx: e.g. xilinx fpgas are up 25%
10:14 AM rue_mohr: so who should be capitolizing on what?
10:15 AM twnqx: texas instruments can't manufcature sot23-5 PMICs (and a few other cases
10:15 AM twnqx: i assume that's corona related
10:15 AM rue_mohr: and just think, its all out there about 3 years and then its thrown in a landfill
10:15 AM twnqx: the decline of 30% raw silicon production is climate change i guess
10:16 AM twnqx: china: not enough rain -> not enough water for the dam power plants -> raw silicon production interrupted
10:16 AM twnqx: but it's ridiculous
10:16 AM twnqx: confirmed orders being canceled etc
10:17 AM twnqx: corona interrupted production in japan of some films used for IC interposers (on those amd/nvidia) chips
10:17 AM twnqx: raw material shortage for tantalum caps, too
10:18 AM rue_mohr: I suppose were going to be seeing waves from the initial bump for a while
10:18 AM twnqx: worse
10:18 AM twnqx: it is still getting worse right now
10:18 AM twnqx: we aren't even near the top of the bump
10:18 AM rue_mohr: yea
10:18 AM twnqx: and i can't get my precious modules manufactured :(
10:19 AM rue_mohr: and just think, north america has a complete dependence on tech it doesn't make
10:19 AM twnqx: world* :P
10:19 AM rue_mohr: I wonder when the last time this happened was
10:20 AM twnqx: europe is contemplating handing 100B€ to make chips here
10:20 AM twnqx: i should be looking into the details :>
10:20 AM rue_mohr: how interdependent do you think the people of easter island were?
10:20 AM twnqx: do you think they used tech?
10:20 AM rue_mohr: "tech" doesn't have to be chips
10:21 AM rue_mohr: its about a group that needs the group to operate
10:21 AM rue_mohr: and it trying to compensate as bits fail
10:22 AM rue_mohr: I dont think I can fathom how many computers are collectivly disposed of around the world for no reason than getting the newer model
10:22 AM twnqx: i have no idea how many computeres i currently have around me, for suitable low enough definition of computer :P
10:23 AM rue_mohr: I'm talking pc's
10:23 AM twnqx: each of our modules is an arm system with 128MB ram and 32G emmc
10:23 AM twnqx: and i have dozens
10:23 AM rue_mohr: I have 11 24/7 machines at home
10:24 AM rue_mohr: about 4 or 5 that run intermittently
10:24 AM twnqx: i have 1
10:24 AM twnqx: 24/7
10:24 AM twnqx: and two more or less permanent (12-16h/day)
10:25 AM twnqx: but i live in the country with the highest energy cost in the world :/
10:25 AM rue_mohr: I do a lot of electronics recycling, I find it sad how many chips I can only dispose of cause there is no documentation for them
10:25 AM rue_mohr: we used to be the lowest here
10:26 AM rue_mohr: lots of water and mountians
10:30 AM twnqx: norway?:P
10:31 AM rue_mohr: west coast of canada
10:32 AM rue_mohr: bbl
02:27 PM vgtw_ is now known as vgtw
06:59 PM abcminiuser21 is now known as abcminiuser2
09:56 PM Helle is now known as Guest57
10:07 PM Ekho- is now known as Ekho