#avr Logs

Dec 12 2018

#avr Calendar

01:16 AM polprog: rue_: have you tried tk
01:41 AM rue_: does that work from C without embedding a language?
01:41 AM rue_: does anyone even slightly understand what low overhead software is?
01:46 AM nohit: no
01:48 AM polprog: what are you running it on such that tk is overhead
01:48 AM polprog: its not a web abb in chrome/electron
01:55 AM rue_: clueless
01:59 AM rue_: you said a 24M webpage
01:59 AM rue_: who typed 32?
01:59 AM * rue_ looks around
01:59 AM rue_: meh, same point tho
01:59 AM rue_: they just dont get it rue
02:00 AM rue_: I suppose its ok, it drives things to be ludicrusly fast
02:00 AM rue_: well, if it wasn't burning up all its memory and processing on garbage
02:00 AM rue_: I saw this in other things to
02:00 AM rue_: which?
02:00 AM rue_: people just aren't good with garbage collection
02:01 AM rue_: dude its midnight
02:01 AM rue_: so much for sleep
02:01 AM rue_: ugh, killer week
02:01 AM rue_: your starting with writing a report, your ok
02:01 AM vmt: rue you're a bad programmer:(
02:01 AM rue_: you saying I can do it in my sleep?
02:01 AM rue_: hahhaa
02:01 AM rue_: ahhahahaah
02:01 AM Evidlo: rue_: any idea why this seems to repeatedly sample from ADC0 rather than cycling ADC0-2? http://termbin.com/9b2t
02:01 AM rue_: aah....
02:01 AM Evidlo: http://l.termbin.com/9b2t
02:02 AM rue_: sorry Evidlo I need to go to sleep
02:02 AM rue_: I'll look at that in about 6.5 hours
02:02 AM rue_: (2 hours of sleep)
02:02 AM rue_: pesimist
02:02 AM rue_: YOUR the one keeping me up!!!!
02:02 AM rue_: :P
02:02 AM rue_: dont you EVER rest?
02:02 AM Evidlo: hopefully I figure it out by then
02:02 AM rue_: I rest when your awake
02:03 AM rue_: thats just evil dude
02:03 AM rue_: }:)
02:03 AM rue_: oh goodnight
02:03 AM vmt: the idlers in here have finally driven his nuts loose for the last time
02:03 AM rue_: narf
02:06 AM Evidlo: can I change ADMUX after the Timer interrupt triggering the ADC has started? It seems to have no effect
02:11 AM rue_bed: I can set it up for you later, maybe in the morning
02:11 AM Evidlo: seems to be a problem with my boolean logic. doesn't `ADMUX = ADMUX & 0b11110000 + 1` set the first 4 bits to 0001?
02:11 AM rue_bed: generalization: I'm the only one who speaks in the channel and I'm the only one who can help you
02:11 AM rue_bed: why would you do it like that
02:12 AM Evidlo: so I can replace 1 with a variable
02:12 AM rue_bed: ruemohr.org
02:12 AM rue_bed: go to avr
02:12 AM rue_bed: and mega 32 or 328
02:12 AM rue_bed: look at some adc code
02:12 AM rue_bed: my adc code usually loops thru all 8 channels
02:12 AM rue_bed: storing the values in an array
02:13 AM rue_bed: www.ruemohr.org is not ruemohr.org
02:13 AM rue_bed: if you dont get the black page, its the wrong one
02:14 AM Evidlo: well ORing it instead of adding works
04:55 AM polprog: 09:06:32 <vmt> the idlers in here have finally driven his nuts loose for the last time
04:56 AM polprog: >:D
12:00 PM jesseg: Hrm, trying to decide whether my embedded printf() ought to be blocking or not.
12:02 PM LeoNerd: Is this to a UART?
12:02 PM LeoNerd: I usually make those block waiting for the transmitter to be free before they output, so you get a -little- bit of overlapped IO after the final character
12:07 PM jesseg: LeoNerd, yeah it sends out the uart through a 255 byte fifo -- so the question is really only valid if more than 255 bytes are printed suddenly
12:08 PM jesseg: On one hand I don't want to having blocking moments that I don't know about
12:08 PM jesseg: on the other hand it would be nice for it to block sometimes
12:08 PM LeoNerd: It might depend on the filehandle?
12:08 PM jesseg: maybe I'll make it block, but record each time it happens
12:08 PM jesseg: oh, it calls my own charsend function
12:08 PM LeoNerd: E.g. have stderr be a simple blocking output thing for debug console, but stdout be something buffered and backgrounded through interrjupts?
12:08 PM jesseg: I'm just trying to decide which way is better :D
12:09 PM jesseg: the charhandler I use for printf is backgrounded through interrupts and a 255 byte fifo
12:10 PM jesseg: but should the code tell it to suddenly print more than 255 bytes then I have to decide whether I ought to make it block or drop bytes.
12:26 PM jesseg: there... Now if printf tries to add more to the fifo and it's full, it waits till there's room, but records in a status struct that it had to wait.
12:26 PM jesseg: That way I get normal operation, but I can keep an eye on things and if it happens during critical times then I know I need to do something.
12:26 PM LeoNerd: Seems reasonable
12:27 PM LeoNerd: I've debugged things like that before, where I turn on an LED as soon as my scheduler wakes up and schedules a task function, and off again when it goes back to sleep
12:27 PM jesseg: lol yeah
12:27 PM LeoNerd: Then I can tell if any of my task functions are blocking too much because I can see the LED glow. Normally it wouldn't be visible
12:27 PM jesseg: yeah
12:28 PM jesseg: basically this thing has to decode a short binary RS485 message and respond in so many milliseconds or else
12:28 PM jesseg: so I'm cagey about blocking printf
12:28 PM LeoNerd: Mmm... 485
12:28 PM jesseg: but I may put the 485 response code to get called from the ISR so it cannot be blocked by printf
12:30 PM jesseg: and also, I think I'll make a function fifoempty() so my non ISR code can locally block a printf until there's room in the fifo, that way a non-blocking write is guaranteed since no individual call to printf will be more than 255 bytes
12:35 PM LeoNerd: What sort of things are you sending over 485?
12:37 PM jesseg: Short messages for things like controlling motors and reading battery states from the BMS and whatever else is on the RS485 bus
12:38 PM jesseg: This is the PCB https://oshpark.com/shared_projects/5rXQ2iNt
12:38 PM LeoNerd: Mm.. I've done DMX, and separately a stage cueing system
12:39 PM jesseg: it's a general purpose smart bridge to go between TTL RS232 and full RS485 -- for interfacing things like r-pi's and stuff to time-critical 485 buses
12:39 PM jesseg: oh that would be cool, I never done any stage stuff
12:39 PM jesseg: but would love to :P
12:39 PM LeoNerd: It's a fun environment
12:39 PM LeoNerd: Reliability and timing are key
12:39 PM jesseg: yeah exactly
12:45 PM LeoNerd: I keep meaning to write some generic packet-network firmware for my RS485 appboard, for that
12:45 PM LeoNerd: https://www.tindie.com/products/leonerd/rs-485-isolated-application-board/
12:46 PM LeoNerd: It'd probably run as a little SPI or I²C slave, mangaging the lowlevel packet passing bus itself
12:46 PM jesseg: well there! Now printf does block if the fifo gets full, but I can call be smart in my non ISR code and either wait to send a printf or skip a printf whichever makes sense if fifoempty() returns 0, that way I can still prevent blocking if that's the desired results
12:46 PM LeoNerd: I already have a DMX receiver for it :)
12:46 PM LeoNerd: Up to 64 channels, SPI slave
12:48 PM jesseg: that's super cool there LeoNerd
12:48 PM LeoNerd: I've used those boards in stage kit before
12:53 PM jesseg: I've been thinking about developing a branching RS422 net where each node can have a slave node or a downstream node
12:54 PM jesseg: and it would be self addressing
12:54 PM jesseg: so node 4.2 would be the second slave of the 4th node, etc
12:54 PM LeoNerd: Yeah; addressing is a tricky one
12:55 PM LeoNerd: If you can guarantee one "special" node to act as a bus master (which I do), then it can hand out IDs
12:55 PM jesseg: my thinking is that each packet has a hop count that counts up with each hop, and a target address. Whichever node happens to have it when it gets incremented to where the hop count and the address field match, that is the target node
12:56 PM jesseg: well I'm half crazy (at least.) I'm thinking each node has a full 422 upstream port and a full 422 downstream port. Every packet goes through every node on its way to the target.
12:56 PM jesseg: then the response comes back through every node on the return path.
12:56 PM jesseg: Hence why it's RS422 and not RS485, and how it can automatically address.
12:56 PM LeoNerd: Well, 422 is quite a different topology to 485
12:57 PM jesseg: yeah I'm thinking basically a full duplex point to point 422 link between each neighboring node.
12:59 PM jesseg: so each node would have an upstream port, a downstream port, and optionally a side-port.
01:00 PM jesseg: So you could basically just plug them all together, and lets say you might have 4 shops, each with 3 machines, and each machine would have 7 sensors
01:01 PM jesseg: you'd just wire it up in a topology that made sense then the software would autodiscover that there were 4 first level nodes, and each of those had 3 second level nodes, and each of those had 7 third level nodes
01:01 PM jesseg: all automatically addressed
01:20 PM LeoNerd: Mmm.. well the standard problem with '485 is that it's a flat bus of peers...
01:20 PM LeoNerd: So even if one node is decided as the master, it can't individually address the others
01:21 PM LeoNerd: There's various ideas on how to do that, but usually those depend on giving each node a UID, even if just for bootstrapping purposes.. kinda like ethernet MAC addresses
01:27 PM jesseg: yeah
01:28 PM jesseg: that's why I'm so swooned over this 422 bucket brigade topology
01:28 PM jesseg: because it supports inherent automatic n-dimensional addressing
01:29 PM jesseg: which is directly matched to the physical layout
02:18 PM polprog: jesseg: take a look how STP elects a master switch, root of the spanning tree
02:18 PM polprog: that should help
02:19 PM jesseg: Doesn't that involve the mac addresses or some unique identifiers associated with every port and every switch?
02:19 PM jesseg: polprog, ?
02:19 PM polprog: yeah
02:20 PM jesseg: but yes I cannot deny that STP was not inspirational in this concept for me :P
02:20 PM polprog: since you are making a complicated physical topology, an stp like protocol would help
02:20 PM polprog: good :D
02:20 PM polprog: i wanna make some 485 slave boards. but i have no time
02:20 PM jesseg: except I think I can do it without any unique pre-assigned IDs on any nodes because of my bucket brigade topology
02:20 PM jesseg: well mine's open source but umm it doesn't have the kind of AVR you're used to :P
02:21 PM jesseg: it is 32 bits though :D
02:21 PM jesseg: and I already have written the fifo uart drivers for it too
02:21 PM jesseg: which I'd be glad to share :P
02:22 PM jesseg: not that my coding skills are worth sharing. but when the price is zero then the buyer needn't complain excessively :P
02:26 PM polprog: haha, i dont complain
02:26 PM polprog: whats a bucket brigade topology
02:26 PM jesseg: remember like the fire fighters of the early days?
02:28 PM jesseg: polprog, here's how the bucket brigade works. But skip the the middle, the kids are better at it than the grownups.
02:29 PM polprog: so the board are in chain and pass the packet along?
02:32 PM jesseg: yes
02:32 PM polprog: nice. so like dmx
02:38 PM LeoNerd: polprog: see mine :) [re: RS485 boards]
02:38 PM polprog: the isolators?
02:39 PM LeoNerd: Yah
02:39 PM LeoNerd: Oh, mine are isolated ones, admittedly
02:39 PM polprog: seen them, very cool :)
02:40 PM polprog: i wanna get mine driving two bid hd44780 lcds i have
02:40 PM polprog: i could make them display time or stuff
02:41 PM LeoNerd: Mmm.. that'd need more IO lines than mine could do
02:41 PM LeoNerd: I have.. hrm.. I think 6 free
06:43 PM rue_: is the problem solved?
10:29 PM rue_: 000101010001011010101001
10:29 PM rue_: 00100101?
10:29 PM rue_: 10110010010101
10:29 PM rue_: 101?
10:29 PM rue_: 10!
10:37 PM kline: rue_, are you having a stroke?
10:37 PM rue_: 101 11100....
10:37 PM kline: we can call for help if you need
10:37 PM rue_: :P
10:37 PM rue_: 1
10:37 PM rue_: 1?
10:37 PM rue_: 1!
10:37 PM rue_: 10...
10:37 PM rue_: 1!
10:38 PM rue_: 1.....
10:38 PM rue_: 1!
10:38 PM rue_: 0...
10:38 PM rue_: 1!
10:38 PM kline: rue_, > why is everyone going to #avrs ?
10:38 PM rue_: .....1
10:38 PM kline: also rue_, > 0101010101 lol
10:38 PM jesseg: hey what are you calculating crc there rue_ ?
10:38 PM jesseg: I'm this very minute trying to figure out how to calculate crc lol
10:39 PM rue_: he says, I need to make like I'm alive.
10:41 PM rue_: people leave dead channels
10:41 PM rue_: people join channels that look hopefull, for example if they have a member count of 112
10:42 PM jesseg: I join this because I'm crazy and I fit in just fine
10:42 PM rue_: they will join the channel and wait a bit to see whats going on, then ask what they want to know
10:42 PM rue_: jesseg, your not the average person
10:42 PM rue_: have you noticed that the average person has never done _anything_ ?
10:43 PM rue_: well OR badly?
10:43 PM jesseg: I do it badly
10:43 PM rue_: it does not matter
10:43 PM jesseg: or not at all, that's my motto :P
10:43 PM rue_: you do it
10:43 PM rue_: and the more you do the more you learn
10:43 PM rue_: therefore the more you know
10:43 PM jesseg: my grandma awlays said to never put off till tomorrow what you can put off indefinitely
10:44 PM rue_: if you do enough things you get to know so much that your alone
10:45 PM rue_: and the advice you give to people using the knowledge you have attained just seems insane to people
10:45 PM rue_: cause, they never do anything...
10:45 PM rue_: so they dont know
10:45 PM jesseg: lol
10:46 PM rue_: do things,
10:46 PM rue_: do anythings,
10:46 PM rue_: good or bad
10:46 PM rue_: and learn
10:46 PM jesseg: I can't even figure out CRC.. like the best known checksumming system
10:46 PM rue_: learn lots
10:47 PM rue_: and dont let what you know stop you from doing something because you cant do it a way you know is better
10:47 PM rue_: cause not doing something, is always the losing hand
10:47 PM jesseg: I dunno if that's always the case
10:47 PM rue_: sorry, rue needs to watch less japaneese movies...
10:48 PM rue_ is now known as rue_mohr
10:48 PM rue_mohr: hu?
10:48 PM jesseg: I let the temperature in the house get down to 50F for several days straight and one of my room mates was motivated to get some firewood
10:48 PM rue_mohr: less japaneese movies dude
10:48 PM rue_mohr: jesseg, maybe so, but it tricked you, by doing nothing you were doing someting
10:48 PM rue_mohr: the universe is a complex place
10:49 PM rue_mohr: and besides, sometimes the only way to fix something is to have it break more
10:49 PM jesseg: that's for sure
10:49 PM rue_mohr: dude, do someting, specifically supper, its your night...
10:49 PM rue_mohr: awe...
10:49 PM rue_mohr: yea, cmon,
10:50 PM jesseg: one time I had an extension cord with an open circuit somewhere in the middle, but where? so I connected up each end to the output of a 2kv microwave oven transformer. Well that found the bad spot - flames and plasma shot out 3 inches from the side of the cord and I knew right where the problem was.
10:50 PM rue_mohr: jesseg, so, why didn't you go for importing trace layouts from another software package?
10:51 PM rue_mohr: where did it turn out to be?
10:51 PM rue_mohr: end, middle?
10:51 PM jesseg: about in the middle
10:51 PM rue_mohr: dude, supper
10:51 PM rue_mohr: story!
10:52 PM jesseg: I had no need to make any import function for other eda packages. I do have a gerber and gcode importer so I can load existing board files and modify them.
10:53 PM jesseg: or for example I can load a solder paste mask file that's in gerber format and save it as a gcode format for sending to my stencil cutter
10:54 PM jesseg: but anyway my program's file format is simple human readable so it would be easy for anyone to write a converter from whatever EDA package they were dug into
10:57 PM jesseg: rue_mohr, but maybe it didn't trick me. It My lack of action may have encouraged someone else's action, and in a sense you could say that I did something, but one must distinguish that it was another who actually did the do-ing, and there is often meaningful significance to who actually does the do-ing.
10:57 PM jesseg: And besides, if something was tricked, it wasn't I. It would have been the freezing weather which caused the house to drop to 50F, of the shorter days which caused the freezing weather.
10:58 PM jesseg: And it wasn't actually my roommate who got the wood, he got his friend to get it LOL
10:59 PM rue_mohr: sometimes the identification of the puppet and the puppeteer are obscure
10:59 PM jesseg: that's for sure, especially when there are a dozen cascaded each playing both roles :P
11:02 PM jesseg: For example, I'm sitting here making all kinds of faces trying to figure out how to make this cpu do CRC. Is it the puppet, or am I? LOL
11:05 PM rue_mohr: there are a lot of nice crc fuctions availabel off the shelf
11:05 PM rue_mohr: may I show you one I'v used?
11:05 PM jesseg: I think I'm after 8 bit crc
11:05 PM jesseg: because at least the checksum field is only 8 bits
11:05 PM rue_mohr: this still might help
11:06 PM jesseg: is it a loop or a table variety?
11:06 PM rue_mohr: table
11:06 PM rue_mohr: I have a printer to fix, biab
11:07 PM jesseg: here's what I'm staring at https://stackoverflow.com/questions/15169387/definitive-crc-for-c
11:34 PM rue_mohr: wow, I cant find and crc stuff in my old books
11:35 PM day__ is now known as day