#avr Logs

Feb 26 2018

#avr Calendar

12:06 AM Tom_L: now how do you start the damn simulator
12:09 AM Tom_L: it included the m328def.inc file automatically
12:13 AM Tom_L: it's not needed in the asm file
12:24 AM Tom_L: it appears to work in sim too
12:24 AM Tom_L: z999
12:25 AM Tom_L: the port values change anyway
12:25 AM Tom_L: the delay loops like it's supposed to
12:26 AM Tom_L: it's an issue with your studio install
12:32 AM nuxil: https://www.youtube.com/watch?v=HDMkw6lnzmI :D
12:38 AM z999: are you sure that is the right video
12:39 AM z999: monster something
12:39 AM z999: ok hold on let me look at the manual again
12:39 AM nuxil: its just a cool thing
12:40 AM nuxil: not related
12:41 AM _ami_: ok, i ordered Rigol one 1054Z :D
12:41 AM nuxil: :)
12:41 AM nuxil: how much did you end up paying for it ?
12:42 AM _ami_: 457$
12:42 AM nuxil: o.O
12:42 AM nuxil: amazon or ebay?
12:42 AM _ami_: including shipping + import duty
12:42 AM _ami_: Amazon USA
12:44 AM nuxil: i want a digital scope too.
12:45 AM nuxil: i just finishing making the asm for the reverse sawtooth table for my dds. https://i.gyazo.com/61e4c31d58aaf95ca24abbb6149d2208.jpg would be nice to look at it with a digital scope.
12:46 AM z999: Tom_L maybe it is the settings
12:46 AM z999: i don't think it was the install
12:47 AM _ami_: nuxil: send me your code when i have my DSO :) i will send you the screenshot :D
12:47 AM z999: i hate to think that i have to reinstall amtel
12:48 AM nuxil: _ami_, hehe. sure thing but you need to build a resistor network 1st to look at the output :p
12:50 AM nuxil: z999, backup your settings. then delete the setting in your user/document or wherever it stored. then start the studio again, it should make new settings for you, unless its written like crap. :p
12:50 AM _ami_: nuxil: :)
12:52 AM _ami_: nuxil: it has hard to decide between Siglent SDS1202X-E and Rigol one.
12:52 AM _ami_: 457$ is still cheaper for me.
12:53 AM _ami_: if i compare with the local price (~600$)
12:54 AM _ami_: http://item.gmarket.co.kr/Item?goodscode=873269640
12:55 AM nuxil: if shipping from usa is as slow as it is from china.. you get it in 1 month or so :p
12:57 AM nuxil: anyway. i think you will be happy with a proper scope
12:58 AM nuxil: "proper" for hobby use and more.
01:03 AM nuxil: also you should consider getting a differential probe aswell. handy if poking around a psu or some other stuff, protects your from creating magic smoke in your scope :)
01:12 AM _ami_: yeah, lets see.. i am hopeful it get it by march 9th
01:12 AM _ami_: its mainly for hobby purpose.
01:31 AM _ami_: nuxil: i do need to learn about probes and do's/don't's for scope
01:31 AM _ami_: don't want to blow it up
01:31 AM _ami_: :P
01:31 AM nuxil: :D yea you dont want to do that. eevblog has a video on "how not to blow up your scope" you should watch it.
01:32 AM nuxil: that https://www.youtube.com/watch?v=xaELqAo4kkQ
01:33 AM Haohmaru: buy another scope and use that to probe the voltage between your main scope and the point in the circuit you want to probe ;P~
01:34 AM _ami_: nuxil: i did watch that. i did not understand why would you connect GND point of probe to Voltage pin in case of ur device is powered via usb?
01:36 AM Haohmaru: when i was more n00b, i wanted to probe a biased signal (i was doing that in ltspice) relative to the bias voltage
01:36 AM Haohmaru: and a wise man told me that "btw, if you probe like that with a real scope - you may blow things up"
01:37 AM Haohmaru: i sad "o_O", then he showed me a link to eevblog's video
01:37 AM nuxil: :D
01:38 AM nuxil: _ami_, rewind a bit and watch the part before the arduino stuff again then.
01:45 AM nuxil: alternative. isolation transformer as suggested at the end. something i been thinking about as a diy project.
01:47 AM _ami_: i am scared of AC source.
01:47 AM _ami_: because of the accident i had with AC source when i was kid. almost died.
01:48 AM nuxil: yea its dangurus stuff.
01:48 AM * Haohmaru starts humming at 50Hz
01:55 AM Casper: so Haohmaru is in east japan...
01:55 AM Haohmaru: you're not even close
01:56 AM Casper: yeah I know, bulgaria isn't japan
03:24 AM nohitzwork: morning
03:25 AM nohitzwork: nuxil you here?
03:25 AM nuxil: yes
03:25 AM nohitzwork: i'll send you the stk500 next monday
03:25 AM nohitzwork: its my payday then
03:26 AM nohitzwork: but it doesnt have power supply or case or anything
03:26 AM nuxil: :) oki cool. tell me how much you want for the shipping. and i'll send you some $ on paypal
03:26 AM nuxil: when time comes.
03:27 AM nohitzwork: yeah
03:31 AM Haohmaru: half a bucket of bitcoins.. only half, cuz ur a friend ;P~
03:31 AM polprog: morning
03:32 AM polprog: a bitbucket of bitcoins
03:32 AM Haohmaru: no, a real one, preferably metal one with a strong handle
03:33 AM Haohmaru: so you can hear the bitcoins
03:33 AM Haohmaru: ring-a-ding-ding moneyz
03:58 AM nuxil: im trying copy a table from progmem to memory then to pass the memory address of a table to a asm function. but i keep getting errors. not sure what im doing wrong. :\
03:58 AM nuxil: polprog, up for some morning exercise :p https://pastebin.com/tsykMPrL
04:00 AM Haohmaru: what is "SIGNAL_BUFFER_SIZE" ?
04:00 AM nuxil: 266
04:00 AM nuxil: err
04:00 AM nuxil: *256
04:02 AM nuxil: the 2nd address_h is ofc a typo and named address_l
04:02 AM Haohmaru: hm? oh, i'm not even looking at the asm
04:03 AM Haohmaru: why do you try to pass the address of the signalBuffer as an uint16_t ?
04:03 AM Haohmaru: why not a pointer
04:03 AM nuxil: soi change to extern void SigalGen1(uint32_t acc, uint16_t *address); ??
04:04 AM Haohmaru: uh, no
04:04 AM Haohmaru: your table is made out of 8bit sample values, right?
04:04 AM nuxil: or yes
04:05 AM Haohmaru: then your pointer is uint8_t*
04:05 AM nuxil: yes . 256 samples. each 1 byte
04:05 AM nuxil: ahh
04:05 AM nuxil: hold on lemme try that
04:05 AM Haohmaru: but i've no idea how you'll glue that with the asm
04:06 AM nuxil: umm. how can a uint8 hold a address ? arent they 16 bit ?
04:06 AM Haohmaru: uint8_t* is a pointer
04:06 AM Haohmaru: to a uint8_t
04:07 AM Haohmaru: the address it points to can be 16 bit, 32bit, 64bit, or who knows how big
04:07 AM Haohmaru: i meant the size of the pointer.. is as big as the platform/compiler tells you
04:07 AM nuxil: silly me. yes your right ofc. let me try change that and see what the compiler says
04:08 AM nuxil: 2 errors.
04:09 AM nuxil: no. 1 error 1 warning.
04:09 AM Haohmaru: tell me just le first one
04:09 AM nuxil: warning: passing argument 2 of 'SigalGen1' from incompatible pointer type [enabled by default]
04:09 AM nuxil: sig.h:15:13: note: expected 'uint8_t *' but argument is of type 'uint8_t (*)[256]' || extern void SigalGen1(uint32_t acc, uint8_t* address);
04:10 AM Haohmaru: your function argument should be changed probably to const uint8_t* address, and then you'd just throw signalBuffer to the function
04:11 AM Haohmaru: without any & or *
04:11 AM Haohmaru: "signalBuffer" written like that *is* a pointer to uint8_t
04:12 AM nuxil: jup. that works. now i get errors only related to asm :)
04:12 AM Haohmaru: how wonderful ;P~
04:12 AM nuxil: 1 step forward :p
04:14 AM nuxil: hmm.
04:16 AM nuxil: by spesifying a pointer as the argument. it will not follow the normal convetion, normaly args starts from left to right starting at r25
04:16 AM nuxil: this is not the case now.
04:17 AM nuxil: (uint32_t acc, const uint8_t* address); the mix of int and a pointer confuses the asm i think and puts the data on x,y, or z register or something. idk.
04:19 AM Haohmaru: *shrug*
04:44 AM polprog: nuxil: lol not today
04:45 AM polprog: im walking dead :D
04:45 AM nuxil: get a cup of coffee
04:46 AM nohitzwork: im too
04:46 AM nohitzwork: i wish i could just got home to sleep
04:47 AM polprog: they only have that instant crap here
04:47 AM polprog: :(
04:48 AM * Haohmaru pushes polprog into the olympic-size swimming pool of coffee
06:35 AM polprog: Haohmaru: <3
08:06 AM grog_n is now known as grog
09:09 AM chat is now known as Guest83894
09:59 AM polprog: i popped into the printshop on my way back home, printed the PDF of the x86 asm wikibook
09:59 AM polprog: nice to have a hardcopy and it was cheaper than i expected
10:34 AM Haohmaru: someone should carve those things in stone >:)
10:34 AM * Haohmaru runs
10:37 AM polprog: someone finds a hello world program in C carved in stone :PP
10:37 AM polprog: in the era of javascript and Scratch :D
10:37 AM Haohmaru: on the pyramids
10:40 AM polprog: http://i.imgur.com/PDh1D4w.jpg
10:40 AM polprog: i kinda want to get a spray can and write that somewhere
10:40 AM polprog: or a marker
10:40 AM polprog: :S
10:41 AM Haohmaru: you little angel of vandalism you
10:42 AM polprog: so far ive only written save the rave in some places with a pen, :x
10:43 AM Haohmaru: i have a few graffiti from around 2002 to 2003, but i think they've faded away almost completely ;P~
10:45 AM polprog: i have this super thick black marker. i guess ill put it in my coat and wait for an opportunity
10:46 AM Haohmaru: ;]
12:27 PM chat is now known as Guest60542
01:09 PM lemm1ngs is now known as lemmings
01:23 PM Tom_L: sux to be late on a school project and have to fight the tools while you're trying to learn a language
01:24 PM polprog: school project?
01:24 PM Tom_L: z999
01:24 PM Tom_L: it's all in the log
01:24 PM polprog: ah
01:25 PM Tom_L: i broke down last night and installed studio 7 just to make sure
01:25 PM Tom_L: i was trying to help her but all i had available was studio 4
01:25 PM Tom_L: and she was getting hundreds of errors
01:26 PM Tom_L: funny nobody close to her figured that out.. like the instructor maybe?
01:28 PM polprog: yeah im surprised as well
01:29 PM polprog: id expect my tutor to help me
01:29 PM polprog: in such a case
01:29 PM Tom_L: the student would have no way in hell to know the ide was screwed up
01:30 PM polprog: reminds me how i fought different assemblers when i was trying out assembly
01:30 PM polprog: not that long time ago really
01:31 PM Tom_L: i think studio uses gasm doesn't it?
01:31 PM polprog: now ill have to go through this again on x86
01:31 PM polprog: never used studio. but if they went with gcc they would use gnu as i believe
01:32 PM Tom_L: what are you doing on x86?
01:32 PM polprog: leatrning
01:32 PM polprog: learning*
01:32 PM polprog: same as i did on stm8 last two weeks
01:33 PM Tom_L: i've got a bunch of old asm cookbooks for pc
01:33 PM polprog: on x86_64: print a string, done but ill do it again
01:33 PM polprog: i got really stuck on FPU
01:33 PM polprog: if you can share some of the literature id be happy to take it :) in digital ofc
01:33 PM Tom_L: i mostly used it way back when to compliment other languages
01:34 PM Tom_L: everything was paper back then
01:34 PM polprog: not sure if you scrolled up but i printed out the x86 asm wikibook, just to have it
01:34 PM Tom_L: all the dos function calls etc
01:34 PM polprog: maybe i can find some scans by the title
01:35 PM polprog: remidns me there was this polish FTP server with tons of programming and comic books, "Fantastyka" mags,
01:35 PM Tom_L: i've got one that stuffs the keyboard and runs a program for me
01:35 PM Tom_L: .com file
01:35 PM Tom_L: those were easy
01:35 PM polprog: there was this tutorial book focused on learning C and then writing simple game with it. DOS times
01:36 PM polprog: winder if i can find the server with archie
01:39 PM polprog: http://grandis.nu/ the ftp was somewhere here. username plmag
01:39 PM Tom_L: advanced assembly language on the ibm pc, bluebook of assembly routnes for the ibm pc (waite group), peter norton's assembly language book for the ibm pc, undocumented dos to name a few
01:39 PM polprog: damn. password requested
01:39 PM polprog: i had that somewhere
01:42 PM polprog: damn, bad pass
01:42 PM polprog: what the hell are they hosting this archie on... some 386?
01:43 PM polprog: i met the admin of that place once. should have asked
01:45 PM polprog: so.. generally im learning x86 assembly to get a feeling of it.
01:46 PM polprog: for fun
01:46 PM Tom_L: on linux or dos?
01:46 PM polprog: maybe... i once read a tutorial on BIOS programming
01:46 PM polprog: on linux
01:47 PM polprog: i think ive seen real dos on real computer ever, except some old cash register setups
01:47 PM polprog: although they seem to run windows or BSD here
01:47 PM Tom_L: there's a bunch of function calls; i don't know how much was dos and what was bios
01:47 PM Tom_L: i probably still have dos 2
01:47 PM Tom_L: :)
01:48 PM polprog: iirc that tutorial shown how to write a putchar version for bios
01:48 PM polprog: i imagine i could write some super low level functions in assembly and use C/C++ for the rest
01:48 PM Tom_L: just a sec..
01:49 PM polprog: but again this would be only for fun and experiments
01:49 PM polprog: :)
01:50 PM polprog: i could bring this pentium 4 back to use then :) booting a compiled image over PXE!
01:50 PM Tom_L: it's so short i'll paste it here
01:50 PM Tom_itx: ROM_BIOS_DATA SEGMENT AT 40H ; BIOS & KEYBOARD BUFFER
01:50 PM Tom_itx: ORG 72h
01:50 PM Tom_itx: Reset DW ?
01:50 PM Tom_itx: ROM_BIOS_DATA ENDS
01:50 PM Tom_itx: BIOS SEGMENT AT 0FFFFH ; DUMMY SEG FOR ES:SEGMENT
01:50 PM Tom_itx: ORG 0H
01:50 PM Tom_itx: BOOT LABEL FAR
01:50 PM Tom_itx: BIOS ENDS
01:50 PM Tom_itx: Code_seg segment para public
01:50 PM Tom_itx: ORG 100h
01:51 PM Tom_itx: assume cs:code_seg, ds:code_seg
01:51 PM Tom_itx: reboot:
01:51 PM Tom_itx: assume ds:rom_bios_data
01:51 PM Tom_itx: mov bx,rom_bios_data
01:51 PM Tom_itx: mov ds,bx
01:51 PM Tom_itx: mov ax,0FFFFH
01:51 PM Tom_itx: mov reset,ax
01:51 PM Tom_itx: jmp BOOT
01:51 PM Tom_itx: code_seg ends
01:51 PM Tom_itx: end
01:51 PM Tom_L: soft boot
01:51 PM polprog: hmm
01:52 PM polprog: thanks
01:53 PM polprog: taht looks like some old assembler but i could probably "translate" it to GAS
01:53 PM polprog: that*
01:55 PM polprog: waht assembler was that?
01:56 PM polprog: ive got so many qemus i could try and learn any modern assembly i want...
01:59 PM polprog: int $0x10
01:59 PM polprog: that
02:00 PM polprog: https://github.com/cirosantilli/x86-bare-metal-examples/blob/master/bios_hello_world.S
02:00 PM polprog: this would be cool
02:02 PM Tom_L: i don't even remember what assembler i used
02:02 PM Tom_L: came with dos i bet
02:02 PM polprog: yet yove pulled the snippet in seconds :D
02:03 PM Rez is now known as LoRez
02:03 PM polprog: was that a book? a printout? or a backup
02:03 PM Tom_L: i had one that captured a serial port, logged it and put it back out another serial port
02:03 PM Tom_L: backup
02:03 PM Tom_L: :)
02:04 PM polprog: i should move some data as well
02:04 PM Tom_L: one does the caps lock on the keyboard
02:05 PM Tom_L: keyboard stuffer
03:08 PM Tom_L: polprog do you know what linux has as far as function calls?
03:09 PM polprog: you mean syscalls?
03:10 PM Tom_L: yeah
03:10 PM Tom_L: whatever they call em nowdays
03:10 PM Tom_L: basic bios calls should be similar
03:11 PM polprog: i found a site with basic bios calls
03:11 PM polprog: osdev wiki
03:11 PM polprog: but i feel it might be difficult to find where to put the start of the code
03:11 PM Tom_L: not for me so much, just thought you had interest
03:11 PM polprog: sure im interested :P
03:11 PM Tom_L: back then with .com files it was simple
03:12 PM Tom_L: but limited to a specific size
03:12 PM Tom_L: or you had to do a bunch of other stuff and make an exe
03:12 PM Tom_L: basically all the calls were near not far
03:13 PM Tom_L: so you didn't need much overhead at all
03:13 PM polprog: hmm
03:13 PM polprog: what i imagine it as
03:13 PM polprog: is that i put an .org somewhere
03:13 PM polprog: and bios loads it (say a qemu machine)
03:13 PM polprog: and starts running it
03:13 PM Tom_L: org 100 iirc
03:14 PM polprog: this looks promising
03:14 PM polprog: https://gist.github.com/YouriAckx/a52010a05a430496ae11
03:14 PM polprog: uses nasm
03:15 PM polprog: i guess ill try to blindly compile it and run as a floppy on qemu or bochs
03:15 PM polprog: and if it works... ill rewrite it in gnu as and later add some C magic
03:16 PM Tom_L: alot of times we wrote a function in c and used the asm output to start what we wanted
03:17 PM polprog: if i did volatile asm(".org 0xabcd"::); before a function def in C, would it put it at 0xabcd?
03:17 PM Tom_L: i'm not sure
03:17 PM Jartza: it wouldn't
03:18 PM polprog: id have to use a linker script?
03:18 PM Jartza: well
03:18 PM Jartza: not exactly
03:19 PM Jartza: volatile const tagsu_control tagsusequence[42] __attribute__ ((section (".tagsusequence"))) = { ... };
03:19 PM polprog: i see
03:20 PM polprog: okay, that gist works
03:20 PM polprog: under qemu
03:20 PM Jartza: you can then give gcc linker an address to the section
03:20 PM Jartza: -Wl,--section-start=.tagsusequence=0x802000
03:20 PM Jartza: for example
03:52 PM polprog: im getting closer
03:52 PM antto: no son, that's actually the train getting closer to you. get off the rails!
03:53 PM * polprog gets killed by a flying diskette due to fat-fingering a bios interrupt call
04:32 PM polprog: niters
04:32 PM antto: snickers, eat a snickers
04:41 PM Emil: polprog: good night
08:55 PM dehuman: you should just link to the th AVR035 appnote in the topic
08:56 PM Tom_L: what one is that?
08:56 PM nuxil: appnote ?
08:56 PM Tom_L: i used to know a few of em
08:56 PM nuxil: link
08:57 PM Tom_L: i've got most of them
08:57 PM Tom_L: before atmel pulled them offline
08:58 PM dehuman: its the one with the macros
08:58 PM dehuman: they are still on microchip.com but hard to find
08:58 PM dehuman: i thought there was an associated header file but i guess not
08:58 PM nuxil: oh. i dont use thouse macros
08:58 PM nuxil: i use Jartza's macros
08:58 PM Tom_L: dehuman on purpose
08:59 PM dehuman: on purpose there is no .zip on microchip.com or on purpose no reference to avr035 efficient coding for 8-bit avr microcontrollers
09:00 PM nuxil: dehuman, https://gist.github.com/Jartza/56d006504316ef5fe5a3db1b3e438ca9 i like this better than clearbit |setbit because you can set multiple bits with one command.
09:00 PM Tom_L: hard to find
09:00 PM Tom_L: makes you hunt their website
09:00 PM Tom_L: i've got most of them if you need a particular one
09:00 PM dehuman: thanks for the link
09:00 PM dehuman: tom: i think i have all of them
09:01 PM dehuman: way back when i downloaded them all
09:01 PM dehuman: thougth it was dumb at the time - 'why would i need a local copy'
09:01 PM Tom_L: i've got the 'cd' that has all the data sheets, app notes etc bundled
09:01 PM dehuman: i've only been back in the real world since october
09:01 PM dehuman: i was shocked to see microchip bought atmel
09:02 PM Tom_L: techlib from way back in 2013
11:25 PM day__ is now known as day
11:50 PM nuxil: all the basic signas's done https://i.gyazo.com/7a3a7f4bfdc20f748c711a6be9f1f90b.jpg.
11:50 PM nuxil: the asm was a nightmare to get working.
11:51 PM nuxil: and now time for some horror.. start working on a sweep function
11:54 PM polprog: lol
11:54 PM nuxil: :)
11:54 PM polprog: nice waveforms :D
11:55 PM nuxil: yea. im impressed myself how nice waveforms it generates
11:55 PM Casper: the last waveform, I'm surprised that it detect the right frequency
11:55 PM nuxil: why?
11:55 PM Casper: often it's a zero cross detector
11:56 PM polprog: its a bit non standard
11:56 PM Casper: this mean they used a peak detector and put the threshold just bellow it
11:56 PM nuxil: its just software
11:56 PM nuxil: checking the peeks
11:56 PM polprog: im not sure you if they designed that meter to measure pulse :D
11:57 PM polprog: in other news yesterday i made seabios in Qemu display a single 'U' character
11:57 PM polprog: and i think ill pass on x86 because its atrocious
11:57 PM nuxil: its just a normal puls with short on time and lots of noise :p
11:58 PM * Casper wonders...
11:58 PM Casper: that minix thing on the pc... if google succede to remove it... would it actually make the pc run faster?
11:59 PM polprog: another reason to buy amd /s
11:59 PM nuxil: no.
11:59 PM nuxil: amd has it too.
11:59 PM polprog: hence s