#avr Logs

Jul 02 2017

#avr Calendar

12:20 AM day_ is now known as daey
01:56 AM xMopxShell is now known as xmopxshell
06:15 AM JanC_ is now known as JanC
08:48 AM julius: hi
08:49 AM julius: after using the ds1307 successfully i tried some code on a ds3231 chip. but i cant make my led blink the ammounts of seconds that have passed :( i modified the testcode to not output data via uart but to simple blink a led for the seconds..... https://bpaste.net/show/4e06df1e729f
08:49 AM julius: any idea what is wrong here?
08:50 AM julius: all that is commented out was in use in the original code.....but im pretty sure that i only deactivated the uart thing
08:53 AM polprog: rue_shop3: intrested in what?
08:56 AM julius: oh wait...i uploaded the elf file
08:56 AM julius: because the default makefile for thar project generates no .hex.....how convenient
09:16 AM julius: why would a avr project compile to a .elf file and not hex which can be copied to the chip?
09:23 AM polprog: you can use a disassembler on the hex
09:23 AM polprog: efl*
09:23 AM polprog: elf* :P
09:24 AM polprog: and probably you could copy back the hex to elf, but having an elf is more conveinient
09:27 AM julius: ah ok
09:39 AM polprog: how can you upload an elf file :D
09:39 AM polprog: by mistake
09:39 AM polprog: atmel studio?
09:51 AM cehteh: avrdude can handle elf
09:52 AM Lambda_Aurigae: julius, because you told it to compile to elf and not generate hex file yet.
11:09 AM julius: Lambda_Aurigae: yes found the problem.....but the author that provided the code thought it would be a good idea to only create .hex when you run "make flash"
11:28 AM kenny: Anyone know off hand what happens if you try to `st` to an out-of-bounds location?
11:29 AM cehteh: st?
11:31 AM kenny: store
11:32 AM Lambda_Aurigae: ST (STD) – Store Indirect From Register to Data Space using Index Y
11:32 AM Lambda_Aurigae: or Z register
11:34 AM Lambda_Aurigae: kenny, I do believe it will try to write it and just go on..and your data will be lost.
11:34 AM cehteh: just try :D .. there is no access violation isr, it may just roll over
11:34 AM cehteh: or lost the write yes
11:38 AM kenny: okay, thanks. I can try it, just have to figure out how to get some useful asm/c mixed code on my device. I was mainly wondering about any type of jump to somewhere else on an access violation, but I guess that doesn't happen
11:39 AM kenny: I'm looking at some asm and trying to figure out how 'st x+, r0' works in a loop.
11:58 AM cehteh: we should implement corewars on a avr :D
11:59 AM cehteh: https://en.wikipedia.org/wiki/Core_War
12:20 PM rue_house: well, I wrote the max7219 library, but... like to change the way I do the serial
12:21 PM rue_house: maybe I'll see if it works first
12:30 PM julius: crap, this i2c code for a rtc does not work out of the box
12:34 PM julius: this is the minimal code (changed the default examples output from uart to a led (blinking once for each second that the rtc shows)) code: https://bpaste.net/show/a4141494c751 the led blinks once (line 26-29) before the code enters the loop. but when i remove the comments on line 23 the led never blinks...code hangs
12:35 PM julius: rtc_init() is here: https://github.com/akafugu/ds_rtc_lib/blob/master/library-gcc/rtc.c
12:35 PM julius: any idea what could go wrong?
12:37 PM Emil: julius: if you compile avrdude with moar options it can also upload .elf directly
12:39 PM julius: moar options = more options?
01:20 PM Lambda_Aurigae: julius, well, what can go wrong...you could write a program that divides by negative zero and causes the universe to implode.
01:21 PM Lambda_Aurigae: worst case scenario.
01:30 PM cehteh: you failed to recognize that we are already living in a parallel universe which i openend in 1985 when i made my first attempts with BASIC :D
01:36 PM Lambda_Aurigae: I've been living in a parallel universe all my life.
01:36 PM Lambda_Aurigae: actually, it's more of a perpendicular anti-parallel universe.
01:44 PM rue_shop3: hows it different
01:47 PM Lambda_Aurigae: it's more perpendicular.
01:47 PM Lambda_Aurigae: it's also located in Iowa.
01:47 PM Lambda_Aurigae: cornfields do nasty things to the space-time flux here.
01:47 PM Lambda_Aurigae: but at least I fixed the electrical problem in my camper.
01:49 PM Lambda_Aurigae: factory defect...one of those inline crimp on power outlets they use because they are cheap and light was not properly crimped and overuse caused it to arc and burn away the blade for the hot wire which made me lose power in half the camper.
01:51 PM julius: ok i found code that works with that module, but its with arduino libs :(
01:51 PM julius: turns out that the i2c part of the rtc code i found was also posted on a german board where i was said to not work
02:04 PM BongoShaftsbury: question about an acronym, rti -> return to interrupt?
02:05 PM Lambda_Aurigae: return from interrupt.
02:06 PM BongoShaftsbury: thanks
02:06 PM Lambda_Aurigae: don't think avr has that as an instruction though.
02:06 PM cehteh: a platform which needs a return TO interrupt would be real pita, close to INTERCAL's 'COME FROM' instead GOTO :)
02:07 PM BongoShaftsbury: i see RETI
02:07 PM Lambda_Aurigae: avr uses RETI
02:07 PM Lambda_Aurigae: RTI was a 6502 instruction...
02:08 PM Lambda_Aurigae: https://sites.google.com/site/6502asembly/6502-instruction-set/rti
02:08 PM Lambda_Aurigae: did basically the same thing.
02:08 PM cehteh: its just names
02:08 PM BongoShaftsbury: yeah was in the PDF i got sent and wanted to make sure i understood what they were talking about
02:09 PM Lambda_Aurigae: helps to have a wide range of knowledge,,,and access to google.
02:12 PM Lambda_Aurigae: I remember, back in the day, many many moons ago, jumping from BASIC to Assembly on the Vic-20 and Apple-II, interrupt system was probably the hardest concept for me to grasp.
02:13 PM Lambda_Aurigae: I was also 15 and entirely self taught and there was no such thing as the internet.
02:14 PM BongoShaftsbury: yeah it was pretty intuitive when it was explained to me but i had the luxury of having someone well versed in the material explain it
02:17 PM BongoShaftsbury: i also had took a bunch of courses in sequence to make sure i had a lot of the fundamental knowledge of things, plus i had the internet
02:22 PM Lambda_Aurigae: taught myself programming in the early 80s.
02:23 PM Lambda_Aurigae: BASIC on several platforms, then 6502 assembly, then took a PASCAL class in 11th grade in high school.
02:25 PM Lambda_Aurigae: kept going from there,,,FORTRAN, C, and Ada in the military, C++ self taught in the early 90s, and everything else I could acquire and/or learn since then. PHP, PERL, JAVA, assembly on 8052, pic, avr, 68000, x86.
02:26 PM Lambda_Aurigae: even played with brainfuck but I think rue_shop3 is the brainfuck master here.
02:33 PM BongoShaftsbury: lots of stuff
02:36 PM Emil: Lambda_Aurigae: it's never that the concepts are particularly hard
02:36 PM Emil: It's that
02:36 PM Emil: how the fuck are people supposed to know how to use and apply them
02:36 PM Emil: Say interrupts
02:36 PM Emil: You just have to either rtfm or have someone tell you how to
02:36 PM Lambda_Aurigae: yeah.
02:36 PM Lambda_Aurigae: I've done a lot of reading.
02:37 PM Emil: The concept of interrupts is super fucking simple
02:37 PM Emil: "Hey so when this happen this code is executed"
02:37 PM Lambda_Aurigae: yeah..it is now, to me anyhow.
02:38 PM Emil: Well
02:38 PM Emil: to me it's super simple
02:38 PM Emil: it's how you actually get to use them on a platform
02:38 PM Lambda_Aurigae: back before I had ever touched on said concept, it took a bit to figure out on my own.
02:39 PM Lambda_Aurigae: specially having nothing but the 6502 manual from MOS which was very poorly written.
02:45 PM BongoShaftsbury: that happens to everyone, something simple is complicated by learning from a bad source
03:49 PM rue_shop3: ok, one max7219 board...
03:50 PM Emil: Easy to control
03:50 PM rue_shop3: one m328 on a dev board labeled UNO
03:51 PM rue_shop3: 5 jumpers....
03:53 PM rue_shop3: plug vcc into vcc...
03:54 PM rue_shop3: gnd to gnd...
03:54 PM rue_shop3: reffer to source code...
03:54 PM rue_shop3: / Bit positions, PORTD
03:54 PM rue_shop3: #define DATA 3
03:54 PM rue_shop3: #define SCLK 4
03:54 PM rue_shop3: #define CS 5
03:54 PM rue_shop3: hmm
03:55 PM rue_shop3: translate the labeling on the protoboard...
03:56 PM rue_shop3: ... @#%@#$^@
03:59 PM Emil: eh?
03:59 PM Emil: Why'd you bit bang it?
03:59 PM Emil: It's SPI
04:10 PM rue_shop3: aaaaand there are a million usb errors...
04:11 PM rue_shop3: get isp programmer...
04:12 PM rue_shop3: ok, no workie....
04:13 PM rue_shop3: ah, I bet the cs polarity it backwards
04:14 PM rue_shop3: hmm, nope
04:21 PM rue_shop3: something is odd, cause on powerup all the leds are on, and their supposed to be off
04:22 PM Emil: Why would you do this like that :D
04:22 PM Emil: If you think about optimising later
04:22 PM Emil: then you obviously implement it with spi first
04:22 PM Emil: and have the api with clear separation of control and usage
04:22 PM rue_shop3: no
04:22 PM Emil: yers
04:22 PM Emil: yes
04:22 PM polprog: i see some point in making it soft spi first
04:23 PM rue_shop3: cause I dont want to have to debug spi
04:23 PM Emil: lol
04:23 PM Emil: wtf
04:23 PM rue_shop3: I want to make the chip work
04:23 PM Emil: :DD
04:23 PM Emil: "I want this to work so I'll do it the stupid way"
04:23 PM Emil: this is why we can't have nice things
04:23 PM rue_shop3: changing it to spi is NOTHING
04:23 PM rue_shop3: so thats not important
04:24 PM rue_shop3: right now, its important to figure out why its not working
04:24 PM Emil: rue_shop3: here's a clue
04:24 PM Emil: rtfm
04:24 PM Emil: and if that doesn't work
04:24 PM polprog: ha ha ha.
04:24 PM rue_shop3: I am, thanks for your help
04:24 PM Emil: read for example the arduino driver
04:24 PM Emil: It showed me the one critical thing I was missing when I wrote mine
04:24 PM rue_shop3: I kinda wonder if the bits are backwards, few other things to check first
04:25 PM polprog: you sure it's right on the bit level?
04:25 PM polprog: also, what did you want yesterday :P ?
04:26 PM Emil: https://emil.fi/jako/koodi/matrixdriver.c
04:27 PM Emil: For when you give up
04:27 PM Emil: it was written at a less sophisticated time
04:27 PM Emil: but it werks
04:28 PM polprog: spit = SPI transmit?
04:28 PM Emil: yeah
04:28 PM Emil: :D
04:28 PM polprog: lol
04:28 PM Emil: It goes well with the jargon we use
04:29 PM Emil: Katotaan mitä se oksentaa
04:29 PM Emil: huudetaan sille
04:29 PM polprog: yeah, we say like that in polish too :P
04:29 PM Emil: whatcha mean?
04:29 PM polprog: actually the polish word for "return" and "vomit" is the same...
04:29 PM Emil: heh
04:29 PM Emil: e
04:29 PM Emil: yeah
04:30 PM Emil: there's also sorts of nice consequential wordings
04:31 PM Emil: s/also/all
04:32 PM polprog: why wont you set up your apache to display a listing on /jako/koodi/ ?
04:32 PM polprog: :(\
04:33 PM Emil: a)
04:33 PM Lambda_Aurigae: so, "Vomit from interrupt"
04:33 PM Emil: because Apache is canser
04:33 PM Emil: and because I use nginx
04:33 PM Emil: secondly b)
04:33 PM polprog: ok, nigninix, whatever
04:33 PM Emil: because I don't want everything visible
04:33 PM polprog: security by obscurity xD
04:33 PM Emil: indeed
04:34 PM Emil: I mean
04:34 PM polprog: illusion of security
04:34 PM Emil: I don't particularly care if you find what's there
04:34 PM Emil: But I don't want to give everything I share just away
04:34 PM polprog: just asking
04:34 PM Emil: it's okay
04:35 PM Emil: asking is fine :D I just answered the question )
04:35 PM polprog: also, i found a nice bitmap font
04:35 PM polprog: gohufont
04:35 PM polprog: looks better than terminus imo
04:35 PM Emil: https://emil.fi/jako/koodi/font.c
04:35 PM Emil: it's shit
04:36 PM Emil: but that's what I made/copied for the 8x8 dot matrix
04:36 PM Emil: polprog: eww, almost undearable at 11px
04:37 PM Emil: it looks cartoony
04:37 PM Emil: http://font.gohu.org/14-code.png
04:37 PM Emil: but I can see the appeal
04:53 PM polprog: yeah, the 11px version doesnt look goof
04:53 PM polprog: good*
05:02 PM polprog: ahh
05:03 PM polprog: sleep time
05:03 PM polprog: o/
05:03 PM polprog: work tomorrow
05:04 PM Emil: good night
05:09 PM julius: anybody got a ds3231 library in pure c? the one i found doesnt work :(
05:13 PM Emil: which part is the issue?
05:13 PM Emil: From earlier I think it is the hardware and signaling part
05:13 PM Emil: not the actualy protocol part
05:40 PM psf: oh man, I wish the toolchain for ESP was as AVR.
05:57 PM rue_mohr: ok, I got an led flashing...
06:04 PM psf: got my first one this week too :)
06:18 PM julius: Emil: more tomorrow...need to get some sleep
08:01 PM rue_shop3: I got it working, I think I hooked it up wrong
08:01 PM rue_shop3: yay
08:04 PM rue_shop3: that or theres a startup delay I still didn't notice
08:09 PM Lambda_Aurigae: minor hour boot time?
08:12 PM absynth is now known as dan2wik
08:16 PM rue_house: ?
08:17 PM rue_house: I put the init code in a loop, ran the logic analizer on it, and it was ok
08:17 PM rue_house: so I hooked the led back up and it was ok
08:17 PM rue_house: so I kept playing and ended up just leaving a startup delay
10:04 PM enhering: hi
10:19 PM Casper: isn't enhering a kind of fish?
10:19 PM enhering: hering is a fish in german
10:19 PM enhering: sardine
10:19 PM enhering: hering is my surname
10:19 PM Casper: that fish that is said to be disgusting
10:20 PM enhering: they eat it rotten...
10:20 PM Snert: surstromming
10:20 PM Snert: pukefish.