#avr Logs

May 30 2017

#avr Calendar

02:34 AM Jartza: rue_bed: no need, the GW has 2/4-wire switch :)
03:00 AM Smasher816: is there anything special about the ~SS0 pin vs just using any other digital pin for selecting spi slaves?
04:39 AM specing: rue_bed: linky?
04:40 AM specing: I realized that I have a massive shortage of DC-DC modules and its impeding my work
04:40 AM specing: and by that I mean both step-downs and step-ups
06:02 AM nardev: hey guys, i use dtostrf to get const char from long , however, i see it's main purpose to convert floats, is there some other function just for int/long to const char?
06:04 AM Emil: neceve: no
06:04 AM Emil: neceve: it converts a number to a string
06:05 AM Emil: wait
06:05 AM Emil: I'm a retared
06:05 AM Emil: anycase
06:05 AM Emil: neceve: converting an int/long to a char is pretty easy.
06:06 AM Emil: I don't know what the holy grail of that is, though
06:06 AM skz81: printf("%d") maybe ?
06:06 AM Emil: no
06:06 AM Emil: fuck that
06:06 AM Emil: pls no
06:08 AM specing: > to get const char from long
06:08 AM specing: wut
06:08 AM Emil: ah yeah you also can't get const from it
06:08 AM specing: you can't fit a long into a char
06:08 AM Emil: specing: number to ascii presentation
06:08 AM specing: ah then
06:08 AM Emil: he probably means a pointer
06:08 AM Emil: and that's what the documentation says, also
06:08 AM specing: nardev should use Ada and simply use Integer'Image (number) for that
06:09 AM Emil: what I do want to know if compound literals are stored in ram or in progemm
06:09 AM Emil: >including that whole shit
06:09 AM Emil: >ttett
06:09 AM nardev: hmm
06:09 AM nardev: please,could you help more...
06:10 AM nardev: the thing is that i use mqtt lib which i don't wish to make.. and for publishing the function only accepts const char
06:10 AM skz81: Emil, (s|f)printf ARE the prefered way on "heavy" system... On AVR itoa maybe the prefered way ;°) http://www.avrfreaks.net/forum/convert-integer-string
06:11 AM nardev: i'm sorry for insulting smart guys with a stupid question
06:12 AM specing: you didn't insult us, you caused Emil to totally flip out, hit the railing and then fall down the canyon
06:13 AM day is now known as daey
06:14 AM nardev: specing, i see...i'll commit harakiri if that helps
06:14 AM specing: ^_^
06:16 AM Lambda_Aurigae: itoa() is the general method if the printf suite is too much for the system
06:16 AM Lambda_Aurigae: but it won't give a const char
06:17 AM Lambda_Aurigae: to my knowledge, const can not be generated on the fly. It must be defined at compile time.
06:17 AM Emil: specing: :D
06:17 AM Emil: skz81: yeah for actual computers sure, they are absolutely good
06:18 AM nardev: itoa worked
06:18 AM Lambda_Aurigae: harikari is too good for mortals...you have to smash your thumb with a hammer,,,twice!
06:18 AM Emil: but yeah, like Lambda_Aurigae also said, you can't have "const" while running
06:19 AM nardev: Lambda_Aurigae, i'll let him do simple o'sotogari on me... i hope he likes Judo
06:21 AM Emil: I'll karate your ass yo
06:21 AM Emil: :D
06:23 AM Lambda_Aurigae: or, could get really curel
06:23 AM Lambda_Aurigae: you could listen to my jokes!
06:24 AM Lambda_Aurigae: What's a werewolf's favorite dessert?
06:24 AM Lambda_Aurigae: Donut Howls!
06:52 AM skz81: Why one would want a const here ? If it is because the display function takes a const /thingy/ pointer, you can still feed it a pointer to a /thingy/. /thingy/ is garanteed to be left unmodified.
06:53 AM skz81: is there any runtime/performance advantage to pass a const char or const int on AVRs ? I would bet not, but maybe with optimization the compiler can optimize out the value ? Unsure.
06:55 AM Emil: no
06:55 AM Emil: wait
06:55 AM Emil: const char yes
06:55 AM Emil: obviously
06:55 AM Emil: skz81: char is a byte, int is two
06:55 AM Emil: if you meant the const keyword
06:55 AM Emil: no that's compile time
07:00 AM specing: you can make ints 8-bit with -mint8 flag to gcc
07:00 AM specing: but I wouldn't rely on any sizes
07:00 AM Emil: Fuckken mint
07:00 AM Emil: that's the most idiotic thing I know that one can do ;9
07:00 AM specing: use [u]intX_t from stdint.h
07:00 AM Emil: ;)
07:00 AM specing: its not, its C
07:00 AM specing: ok, C specifies that ints should be 16 bits at minimum, but ints are naturally processor word size to me
07:00 AM specing: meaning 8 bit on AVR
07:01 AM Emil: no
07:01 AM Emil: ints are 32 bit on mostly everywhere
07:01 AM Emil: even if your native register size is 64 bits
07:01 AM specing: I'm talking about what the standard requires
07:01 AM specing: and what common sense says
07:01 AM specing: it is not unusual for C to be in conflict with common sense
07:13 AM skz81: <Emil> if you meant the const keyword >> Yup i hoped the compiler could infer some optimisation. But after some thinking... No that do not work.
07:17 AM day is now known as daey
07:17 AM Emil: skz81: oh yeah it can do optimisations on it
07:17 AM Emil: runtime it doesn't make a difference
07:18 AM Emil: and mostly const is used for semantics and protection
07:20 AM skz81: Emil, I know what const is for, thanks :D
07:22 AM shifttymike is now known as Guest85163
07:23 AM skz81: <Emil> runtime it doesn't make a difference >> I mean, a difference with an optimized binary. It should save time by executing less instruction, space by optimizing out variables (or using registers) or both.
07:23 AM skz81: a difference between an optimized binary and a one that's not*
07:29 AM day is now known as daey
09:10 AM hetii: Hi :)
10:08 AM CipherWizard is now known as CWiz
11:46 AM polprog: hi
02:09 PM hetii: When 5,6 bit uart mode is useful? simple 'a' char is encoded by 7 bits.
02:11 PM Emil: Yo
02:11 PM Emil: LeoNerd:
02:11 PM Emil: what bootloader do you use with m328pb?
02:11 PM Emil: or anyone else using m328pb
03:12 PM polprog: hetii: can't think of anything else thank this: https://en.wikipedia.org/wiki/Six-bit_character_code
03:13 PM polprog: it says here about BCD and STUFF
03:13 PM polprog: stuf*
03:13 PM polprog: stuff*...
03:13 PM polprog: also, you can get chips which have weird serial protocols
03:13 PM hetii: polprog, ok I see.
03:14 PM hetii: I try to have software uart in esp8266 that handle all common modes
03:14 PM hetii: thats why ask when it can be useful
03:14 PM Smasher816: is there anything special about the ~SS0 pin vs just using any other digital pin for selecting spi slaves?
03:14 PM polprog: it's nice they added hardware uart for those weird modes
03:15 PM polprog: you dont have to use soft uart
03:16 PM hetii: polprog, the point is that I need to have software uart as well cause have already a board that use for other uC hardware uart.
03:17 PM polprog: the software uart remark was specifically about avrs
03:17 PM polprog: if you do poroper soft uart, in theory you can go any bit length
03:17 PM hetii: yep
03:17 PM polprog: like, 32 or something
03:18 PM polprog: you could also try adding an optional clock line
03:18 PM polprog: although that would be more of an USI than UART
03:18 PM polprog: :P
03:18 PM polprog: like for all those LED PWM drivers, which have 32 bit shift and data regs
03:18 PM polprog: have fun anyway, gtg
03:19 PM hetii: polprog, currently this is what I have: https://pastebin.com/JBFEuzcV
03:19 PM hetii: I extend softuart that already exist for esp-open-rtos
03:20 PM hetii: but not fully sure about line 259, why there is +1 in (uart->bit_time * (i + 1)
03:20 PM polprog: very nice that you added custom baudrates
03:20 PM polprog: how fast can it go in practice?
03:21 PM hetii: well sending works in 115200, receiving as I tested something about 19200
03:22 PM polprog: line 259 looks like it's checking if the sys timer wont overflow mid-byte
03:22 PM polprog: gtg, supper :P
03:22 PM hetii: ok next point what is not fully clear is a stop bit, there is: (uart->bit_time * 9) so I assume that 9 is mount of bits that was send?
03:23 PM hetii: so to have two stop bits do I need change that 9 to 18 ?
03:36 PM polprog: hmm
03:37 PM polprog: let me look
03:37 PM polprog: it just says top bit
03:38 PM polprog: stop bit*
03:38 PM polprog: i dont know ehy they use while there
03:38 PM polprog: why*
03:39 PM polprog: oh, then it pull the tx high
03:39 PM polprog: pulls*
03:39 PM polprog: damnit, im sleepy
03:39 PM polprog: so yeah, that loop again checks for timer overflow and if it did not happen it sends the stop bit
03:40 PM polprog: so yeah, after you change the for loop max value, you have to change line 277 too
03:42 PM polprog: it is a nice piece of code, im saving it
03:42 PM polprog: o/
03:43 PM polprog: mentiom me if you need anything
03:48 PM Emil: Smasher816: yeah
03:48 PM Emil: Smasher816: if you are in slave mode
03:48 PM Emil: or if it is input and goes low(?) while in master
03:50 PM Jartza: evening
03:51 PM Smasher816: Emil: My avr is going to only ever be a master
04:18 PM hetii: polprog, hmm as I think about this second while loop its a delay before stop bit, but its again something not clear,
04:19 PM hetii: in the uart frame we can have few option for stop bits
04:19 PM polprog: i am not sure about it too
04:19 PM hetii: but for what purpose if this bit is always high
04:19 PM hetii: so its unlimited stop bits in idle state
04:20 PM polprog: i dunno
04:22 PM polprog: i cant think of a reason to use a while there
04:23 PM hetii: polprog, well you need it to latch last bit of data or parity if used
04:23 PM polprog: probably
04:24 PM polprog: im on mobile now, not really comfortable to browse code :P
04:24 PM polprog: and im trying to sleep too :P waiting for the song to end
04:27 PM hetii: polprog, ok I will not bother you :) good nigh and till tomorrow I hope to clear this uart lib:)
04:27 PM polprog: oh ,its ok :P good luck ;)
05:39 PM day___ is now known as daey
08:48 PM day is now known as daey
09:00 PM day__ is now known as daey
09:12 PM day is now known as daey
09:46 PM day__ is now known as daey
09:56 PM day__ is now known as daey
10:02 PM day__ is now known as daey
10:11 PM day__ is now known as daey
10:16 PM day__ is now known as daey
11:41 PM day___ is now known as daey
11:57 PM day__ is now known as daey