#avr Logs

Jun 05 2017

#avr Calendar

12:25 AM Kevin`: jaggz-: real ftdi is expensive because of the windows driver certification and because it's a popular name. small companies create chips that mimic ftdi's driver interface because they can't afford to get approved themselves
12:28 AM day_ is now known as daey
12:32 AM jaggz- is now known as jaggz
12:33 AM jaggz: Kevin`, thanks :)
01:47 AM JanC_ is now known as JanC
02:20 AM day_ is now known as daey
03:11 AM eballetb` is now known as eballetbo
03:34 AM julius: hey guys, happy thanksgiving
03:35 AM julius: now that i tasted oled blood i want a bigger display, this one looks nice: http://www.buydisplay.com/default/blue-1-8-inch-256x32-oled-display-module-serial-i2c-and-ssd1326 but whats with the big flat connector..i dont see SDA / SCL connectors :(
03:35 AM julius: i would like to use i2c
03:55 AM mark4: trying to get to grips with atmel studio 7, have some existing code i wrote in as4 and have copied it into a new as7 project. now i need to select the GNU toolchain but when i go into project properties the ONLY tool thats available to me is the avr assembler. nothing else
03:58 AM Emil: mark4: https://emil.fi/avr and if you want a fresh toolchain, https://emil.fi/toolchain
03:59 AM gnom: https://aliexpress.com/item/2-0-TFT-LCD-Touch-Screen-Breakout-Board-W-Touch-Pen-For-Arduino-RED/32795754130.html
03:59 AM mark4: no. im in windows not linux. avr studio does not work in linux, not even under wine
03:59 AM mark4: im specifically using avr studio version 7 and the gnu toolchain is an option. but... its not avaiable right now and i dont undestand why
04:00 AM mark4: i shouldnt need to build the avr toolchain, it comes packaged with avr studio 7
04:01 AM mark4: its just not an option to use it on this solution and i need to fix that. this code will NOT build with atmel tools, not in a million years, the atmel assembler is a pile of utter garbage
04:02 AM mark4: http://www.atmel.com/webdoc/atmelstudio/avrtoolchain.projects.gcc_projectoptions.compileroptions.html
04:02 AM mark4: this page shows the wizzard for selecting the toolchain for your project. its under project properties
04:02 AM mark4: when i go to this wizzard the ONLY option in the list is the avr assembler
04:02 AM mark4: everything else is missing
04:22 AM Emil: mark4: eh?
04:23 AM Emil: atmel studio uses the gcc toolchain internally
04:23 AM Emil: It can be configured for iar, though
04:29 AM mark4: then why does it not understand GNU assembler syntax
04:29 AM mark4: i have existing macros that ive used on NUMEROUS architectures and they all assemble just fine under the GNU toolchain
04:29 AM mark4: the macros do not work with the avr toolchain
04:30 AM mark4: for an example of the macros in action go to my GitHUB at https://github.com/mark4th and check out the t4 project
04:31 AM mark4: https://github.com/mark4th/t4/blob/master/src/kernel/macros.s
04:31 AM mark4: the avr version of the GCC assembler does NOT accept things that every other version of the gnu toolchain ive ever used does accept
04:32 AM mark4: .set foo, 0 <-- the REAL gnu assembler syntax
04:32 AM mark4: .set foo = 0 <-- the avr syntax
04:32 AM mark4: this is not the GNU toolchain
04:33 AM mark4: this code built just fine under the GNU toolchain shipped with avr studio 4
04:33 AM mark4: what did atmel do? totally butcher the gnu toolchain so that soruces that used to build no longer will using what is theoretically the same tools?
04:36 AM mark4: this code built just fine under avr studio 4
04:36 AM mark4: erm atmel studio 4
04:40 AM noHitW_work: *avr studio 4
04:42 AM noHitW_work: The AVR Assembler, is the Assembler formerly known as AVR Assembler 2 (AVRASM2). The former AVRASM distributed with AVR Studio 4 has now been obsoleted and will not be distributed with current products.
04:43 AM mark4: the assembler thats being used is NOT a gnu assembler
04:44 AM mark4: the macro syntax is totally different. the directives are totally different. there are directives that i need that do NOT exist in this assembler
04:44 AM mark4: its NOT gnu
04:45 AM noHitW_work: well you should use gcc toolchain then
04:46 AM noHitW_work: with avr studio 4 you had to install it separetly, no it's included with the install
04:47 AM noHitW_work: *now
04:48 AM mark4: i go into my project properties and select the toolchain tab
04:48 AM mark4: the ONLY OPTION is the avr assemblert
04:48 AM mark4: notthing else is in the list
04:49 AM noHitW_work: strange
04:49 AM mark4: the assembler thats availabope is utter garbage
04:50 AM mark4: there is no way to translate these gnu sources to be assemblable under this assembler
04:50 AM mark4: it has about 1/10000 the functionality
04:57 AM mark4: available i meant. ive no idea how that came out that bad lol
04:57 AM mark4: i cant type :/
05:44 AM Emil: mark4: lol
05:44 AM Emil: mark4: if you want to stay with deprecated code
05:44 AM Emil: obsolere
05:44 AM Emil: obsolete*
05:44 AM Emil: go ahead
06:34 AM renn0xtk9: I bought that USBASP https://www.amazon.de/gp/product/B00AVRHVPO/ref=oh_aui_detailpage_o07_s00?ie=UTF8&psc=1 I am trying to burn an arduino bootloader using this http://www.instructables.com/id/USBASP-Bootloading-a-ATMega328p-with-a-8mhZ-intern/
06:34 AM renn0xtk9: when burning bootloader in arduino ide it says avrdude: error: could not find USB device with vid=0x16c0 pid=0x5dc vendor='www.fischl.de' product='USBasp'
06:34 AM renn0xtk9: any idea/
06:35 AM cehteh: linux?
06:35 AM Lambda_Aurigae: check your usb devices list and see if that device shows.
06:35 AM cehteh: may need udev rules for setting the device correctly up (permissions etc)
06:36 AM cehteh: lsusb
06:36 AM Lambda_Aurigae: may need to update the firmware on the usbasp to work correctly
06:36 AM cehteh: udevadm monitor
06:37 AM renn0xtk9: ceteh yes linux (ubuntu) lusb does not seems to list it
06:37 AM Lambda_Aurigae: well, if it doesn't show up in lsusb, then there's something wrong with the usbasp.
06:37 AM renn0xtk9: when I plug it i see briefly a blue led lighting up on the device and then finisehd
06:38 AM Lambda_Aurigae: it is possible your computer is not compatible with it.
06:38 AM cehteh: dont connect the target
06:38 AM Lambda_Aurigae: try it on another computer.
06:38 AM renn0xtk9: Lambda_Aurigae, do you know if there are some packages to be installed on ubuntu may be (some sort of driver for the USBASP)
06:38 AM Lambda_Aurigae: or another usb port.
06:38 AM dunz0r: renn0xtk9: Tried another cable?
06:38 AM cehteh: maybe he has short the target board
06:38 AM Emil: renn0xtk9: try a different port
06:38 AM cehteh: yes another cable
06:38 AM Emil: Also use sudo
06:39 AM cehteh: but make double sure you dont have any shorts, disconnect the programming side
06:39 AM renn0xtk9: okay when target unconnected, pops up in lsusb
06:39 AM cehteh: and no sudo .. when correctly set up it should work as user
06:39 AM cehteh: maybe your user needs to be added to dialout or plugdev ... udev rulez :D
06:39 AM Emil: cehteh: udev rules
06:39 AM Lambda_Aurigae: then you have something connected wrong.
06:39 AM Emil: cehteh: dialout is only for serial ports
06:40 AM Emil: cehteh: also udev rules are shitty
06:40 AM cehteh: udevadm monitor should display what happens while connecting/disconnecting
06:41 AM cehteh: did you disconnet the programming target?
06:41 AM Lambda_Aurigae: he said it shows in lsusb when target unconnected.
06:41 AM cehteh: just plug the bare programmer in .. does the led stay lit?
06:42 AM renn0xtk9: ceteht yes completely disconnected and know lsusb give me this Van Ooijen Technische Informatica shared ID for use with libusb
06:42 AM cehteh: methinks about a short on vusb ...
06:42 AM renn0xtk9: and light stay blut on the device
06:42 AM cehteh: blut?
06:42 AM cehteh: how do you power your target?
06:43 AM Lambda_Aurigae: blut/blood
06:43 AM Lambda_Aurigae: guessing,,red?
06:43 AM cehteh: you can either jumper 3v3 or 5v from the programmer or not powering it from there when its self powered
06:43 AM cehteh: but you have to choose the right option
06:43 AM renn0xtk9: ceteh. Do I have to power it? I thought from the schematics that by connecting VCC from the device tho the Microcontroller, it will power alone
06:43 AM renn0xtk9: with power ultimately comming from USB
06:44 AM cehteh: yes
06:44 AM Lambda_Aurigae: renn0xtk9, the usbasp can provide some power but not necessarily enough for all circuits.
06:44 AM renn0xtk9: right now it is on 5V
06:44 AM cehteh: thats when you connect power (VCC) and use the switch to select between 5v or 3v3
06:44 AM Lambda_Aurigae: depending on your usb port.
06:45 AM renn0xtk9: Lambda_Aurigae. I only have the ATMEGA328 , nothing else in the circtuis
06:45 AM cehteh: when your target needs too much current or you created some short then the usb port switches off (or blows a fuse, or destroys your computer)
06:45 AM Lambda_Aurigae: if you have a usb-charging port then no problems...it can provide 1A to 2A generaly.
06:45 AM Lambda_Aurigae: if you have standard usb ports then you are limited to 100mA unless your usb device requests more,,which the usbasp does not do.
06:46 AM cehteh: so be careful with powering things from usb, double check everything
06:46 AM Lambda_Aurigae: most usbasp devices do not have current limiting or short circuit protection...in fact, can't say as I've ever seen a usbasp with either.
06:46 AM cehteh: AAAND .. even when you use a bare atmega only, it still needs the obligatory 100nF cap on vcc
06:46 AM renn0xtk9: If I want to just burn bootloader in to the atmega, 100mA is enough no?
06:46 AM cehteh: should be
06:47 AM cehteh: unless you wired something wrong
06:47 AM cehteh: thats why i suggested to try without the target cpu connected
06:47 AM renn0xtk9: cethteh do I need the quartz then as well /
06:47 AM cehteh: then you see the device in lsusb and avrdude will give another error (check cabeling or something like that)
06:48 AM Lambda_Aurigae: renn0xtk9, is your device programmed to use internal RC oscillator or external crystal?
06:48 AM cehteh: that depends on the fuses of the atmega, when it is new then you dont need a quarz
06:48 AM cehteh: default is internal 8Mhz osc divided by 8 running on 1mhz
06:48 AM renn0xtk9: like doing some stuff like that https://www.arduino.cc/en/Tutorial/ArduinoISP but with the arduino board replace by the USBasp
06:48 AM cehteh: arduinos have external oscillator fused
06:49 AM cehteh: when the atmega is from an arduino board then you need to add a external clock
06:50 AM renn0xtk9: Lambda_Aurigae. I don't know so far I am only trying to make a "hello world " in burning bootloader
06:51 AM Lambda_Aurigae: you have fun with the ardweeny.
06:51 AM Lambda_Aurigae: I'm off to work.
06:51 AM cehteh: have fun :D
06:51 AM Emil: Lambda_Aurigae: cehteh wtf
06:52 AM noHitW_work: where do you get that 100mA?
06:52 AM noHitW_work: isnt it 500mA
06:52 AM cehteh: no
06:52 AM Emil: pretty much all computer usb ports have a 500mA current limit
06:52 AM Emil: noHitW_work: by the spec it is 100mA
06:52 AM Lambda_Aurigae: limit, yes
06:52 AM cehteh: limit yes .. but by spec 500mA has to be acknowkedged
06:52 AM Lambda_Aurigae: 100mA is all the computer has to give you unless you request more.
06:52 AM Emil: but it is a stupid limit so no one cares about it
06:52 AM cehteh: by default ist 80mA or something like that
06:53 AM Emil: no it is 100mA
06:53 AM Lambda_Aurigae: this laptop has 3 usb ports..2 of them only provide 100mA max and shut down if I draw more than that without requesting.
06:53 AM cehteh: or 100 something along that . .read the specs
06:53 AM Emil: cehteh: it is 100mA
06:53 AM cehteh: i dont have the spec memoized
06:53 AM Emil: that can be negotiated to 500mA
06:53 AM Lambda_Aurigae: the 3rd port is a charging port and gives out up to 2A without shutting down and no usb power request.
06:53 AM cehteh: many laptops have dedicated charging ports which can supply 1-2A without negotiation
06:54 AM cehteh: but thats not granted
06:54 AM Lambda_Aurigae: anyhoo...time to go scream and put on my shoes with a broken toe...and go install copiers.
06:54 AM cehteh: anyway programming a bare atmega should need (far) less than 10mA iirc
07:11 AM DKordic: BongoShaftsbury: To convert instruction word address, produced by `call' or label, to byte address used by `lpm'.
08:13 AM JanC_ is now known as JanC
08:36 AM renn0xtk9: do AREv and aVCC mus be set to High when you want to burn arduino booloader on AVR?
08:38 AM cehteh: AVCC must be connected to VCC, and all VCC and all GND must be connected
08:38 AM cehteh: AREF should be left open
08:39 AM cehteh: in a real application you may add a LC filter to AVCC see datasheet
08:39 AM cehteh: (arduinos dont use that filter .. suckers)
08:39 AM cehteh: but its only needed when you want to use the analog parts and want noise immunity
08:41 AM DKordic: s/noise immunity/one source of noise reduced/
08:41 AM DKordic: :3
08:42 AM LeoNerd: To be honest I've never trusted the internal ADC to be high-enough precision to make that noise filter matter anyway
08:42 AM LeoNerd: If I needed a nicer ADC I'd use an offchip one, like something I²C or SPI from LT/AD
08:44 AM cehteh: with filtering its not that bad, filter on avcc, cap on AREF, rc filter on the input
08:44 AM cehteh: with only 10 bit you dont get much anyway
08:46 AM cehteh: AVCC noise filter depends on whats on your board, if there isnt much causing noise then no worry, when you drive loads or you power supply is noisy ir should add some improvement
08:46 AM Emil: So I have a double sided board
08:46 AM Emil: Do 0805/0603 stay on when reflowing?
08:46 AM Emil: I should do a test on some diy pcb
08:48 AM cehteh: resistors, coils? ...
08:48 AM Emil: r and c
08:48 AM cehteh: resistors and caps should stay on, heavy components maybe not, but you should handle it carefully anyway
08:49 AM cehteh: just try
08:49 AM Emil: I just learned to put all the chips on one side and all the passives on the other :D
08:50 AM cehteh: there was some glue for mounting heavier things iirc
08:50 AM Emil: Yeah
08:50 AM Emil: but sounds painful
08:50 AM cehteh: dunno i never did that
08:50 AM cehteh: but keeping it simple is a good idea anyway
08:51 AM Emil: Hmm
08:51 AM Emil: perhaps I'll just reflow the other side
08:51 AM Emil: and then hot air the other
08:52 AM Emil: Could I do #define LEDPORT DDRB
08:52 AM Emil: ?
08:52 AM cehteh: why not?
08:52 AM cehteh: i mean i dont know the circumstances, but usually i do some descriptive defines too
08:53 AM Emil: Dunno, something about needing to run the preprocessor twice
08:53 AM cehteh: preprocessor doesnt expand something twice, but otherwise its fine
08:54 AM cehteh: you cant #define FOO FOO and then let it expand FOO in a endless loop
08:54 AM cehteh: (or #define FOO BAR #define BAR FOO) ..
08:55 AM bss36504: You can do other things that will create preprocessor loops though. I never really got the hang of it, but it does work
08:55 AM bss36504: But I would prefer not to do preprocessor metaprogramming as much as possible
08:55 AM cehteh: no preprocessor can not loop
08:55 AM cehteh: but there are some ugly tricks, i used them :D
08:56 AM bss36504: right I realize it doesnt technically loop but there are ways to create looping structures
08:56 AM bss36504: look at the boost preprocessor header files
08:56 AM cehteh: http://git.pipapo.org/?p=dinoheat;a=blob;f=progmem_string_array.h
08:56 AM LeoNerd: One of the really hard ones is working out how you can #define LEDPORT B and then expand that into a DDRx definition
08:56 AM cehteh: thats the way you loop :D
08:57 AM cehteh: LeoNerd: ##
08:57 AM bss36504: exactly
08:57 AM LeoNerd: Mhmm :)
08:57 AM Emil: LeoNerd: how does one do that?
08:57 AM cehteh: i do that on muos config stuff
08:57 AM LeoNerd: The ## paste
08:57 AM Emil: ?
08:57 AM cehteh: but sometimes you need a indirection
08:57 AM bss36504: See, I don't see the point of using defines to do this stuff. I used to be into it, but I'm not anymore. You shouldn't be using defines when you can use inline functions
08:58 AM cehteh: #define concat(a,b) a##b ... is the simple case
08:58 AM Emil: eso
08:58 AM Emil: so
08:58 AM cehteh: but when you need a or b expanded first then you need a proxy
08:59 AM cehteh: #define concat_(a,b) a##b #define concat(a,b) concat_(a,b)
08:59 AM LeoNerd: Yeah that's a fun one
08:59 AM cehteh: lots of fun stuff
08:59 AM Emil: so
08:59 AM cehteh: i also using preprocessor lists a lot, recently learned that it has a name X_Macro
09:00 AM cehteh: https://en.wikipedia.org/wiki/X_Macro
09:00 AM Emil: Please do share how should I do it sanely and compile time :D
09:00 AM cehteh: that one really helps to keep things together defined in only one place
09:01 AM Emil: Hmm
09:01 AM Emil: I'll just do inline functions
09:01 AM cehteh: inline isnt guranteed to be inline, its just a hint
09:01 AM Emil: true
09:01 AM Emil: and actually calling them inline isn't needed either
09:02 AM Emil: the compiler, in this case, is smart enough to do the optimisations
09:02 AM cehteh: esp preprocessor like things which are simple text operations are sometimes not optimized by inline stuff
09:02 AM LeoNerd: If you're doing LTO (which on AVR you really should be), there's basically no point declaring a function to be 'inline'
09:02 AM LeoNerd: avr-gcc is pretty good at agressively inlining things anyway
09:02 AM Emil: like if your function is void led_on(void){DDRB|=(1<<3);}
09:02 AM Emil: yeah
09:02 AM cehteh: gcc is good with arithmetic, but text/code and string operatins are not so sane
09:02 AM Emil: LTO?
09:03 AM LeoNerd: Link-time optimisation
09:03 AM LeoNerd: It can optimise across function-call boundaries even between different .c files
09:03 AM Emil: nice
09:03 AM cehteh: yes LTO is great, when your code has some opportunities for it
09:03 AM Emil: How does one invoke that?
09:03 AM LeoNerd: I.e. any and all of your library code becomes potential candidates for inlining
09:03 AM cehteh: muos size reduces by 60% or more .. but the output is non debugable
09:03 AM cehteh: looks like the whole program put in a blender
09:04 AM LeoNerd: -flto -ffunction-sections
09:04 AM cehteh: non debugable .. i mean by looking at the asm
09:04 AM LeoNerd: The former part does LTO itself; the latter part allows creating a smaller final binary image because now every function has its own linker section and dead functions can be removed
09:04 AM LeoNerd: Without that, dead functions can't be removed; which is often a big thing for library code
09:05 AM cehteh: lto generates a complete mess :) with functions ripped apart, branches inbetween etc
09:05 AM LeoNerd: Oh ..yeah. Don't expect to be able to actually read the generated assembly code after you've done that ;)
09:05 AM Emil: :D
09:06 AM cehteh: and there are still some bugs with LTO .. when your programm doesnt work, turn it off and check
09:06 AM cehteh: most of these bugs can be worked around
09:07 AM LeoNerd: Yah.. usually, turning off LTO just makes your program slower and bigger. But I did have one program that I could only burn onto the chip with LTO+function-sections because without those, the program was literally too big for flash
09:07 AM cehteh: heh
09:08 AM cehteh: i once made a program initially i thought it would fit on a tiny13 .. but it was slightly too large
09:09 AM cehteh: compiled it for tiny45 (have enough around here too) with same options, then it was small enough for a t13 too, i guess the t45 has some more/better instructions and can optimize better
09:09 AM LeoNerd: Hah.. ohdear
09:18 AM Emil: what's it called when you write and read at the same time?
09:18 AM LeoNerd: ?
09:19 AM Emil: spi, for example
09:19 AM cehteh: runnin a program :D
09:19 AM Emil: wondering what I should call my functions
09:19 AM LeoNerd: Duplex
09:19 AM cehteh: bidirectional?
09:19 AM cehteh: ah
09:19 AM polprog: spi is a FIFO shift register
09:20 AM Emil: spi_read_write is quite cumbersome imho
09:20 AM Emil: spi_transceive might be okay
09:20 AM LeoNerd: I call my function readwrite
09:21 AM LeoNerd: spi_readwrite
09:21 AM Emil: yeah, it's very descriptive
09:21 AM polprog: my implementatio was calles spi_tx and just returned the rx'd data :P
09:21 AM Emil: Ah, well, I'll go with that again. Settled on that before, too
09:21 AM LeoNerd: I have some specific wrappers for just-read and just-write in those cases
09:21 AM polprog: called*
09:22 AM LeoNerd: It makes the calling code more obvious when you look at it. "I don't intend to be sending/receiving anything here"
09:22 AM polprog: i think youre right
09:29 AM Emil: write, write_d8, write_d16, write_h, write_b
09:29 AM Emil: missing anything=?
09:29 AM Emil: for uart
09:29 AM polprog: nah
09:29 AM polprog: is ok id say
09:30 AM Emil: Hmm
09:30 AM polprog: what's the difference between write and write d8
09:30 AM Emil: decimal 8 bits
09:30 AM Emil: versus just the raw byte
09:30 AM polprog: also, write_string(char* str, char len)
09:30 AM Emil: ah string yeah
09:30 AM Emil: Good point
09:30 AM polprog: not sure if pointer or addr
09:31 AM polprog: the method would have a * and the invocation an &, amirite?
09:31 AM Emil: to write string?
09:31 AM Emil: >char len
09:31 AM Emil: maaaaateeee
09:31 AM polprog: look, do i know how do you handle strings???
09:32 AM polprog: i HOPE they are null terminated
09:32 AM polprog: xD
09:32 AM Emil: Never seen negative length strings
09:32 AM Emil: ;)
09:32 AM Emil: You might want to use unsigned char length there
09:32 AM polprog: and, i mean unit8_t
09:32 AM polprog: uint*
09:32 AM Emil: write_s(char *string){while(*string){uart_write(*string++);}}
09:32 AM polprog: wait, so if i make char a = 'a' is it signed? wtf
09:33 AM polprog: nice oneliner
09:33 AM Emil: eh?
09:33 AM Emil: matey
09:34 AM Emil: the signedness is determined by the type
09:34 AM Emil: char a is _always_ signed :D
09:34 AM Emil: well
09:34 AM Emil: actually
09:34 AM polprog: what a cluster fsck
09:34 AM Emil: the spec is idiotic
09:34 AM polprog: implicit typedefs 4 lyf
09:34 AM Emil: so in any sane implementation char a is always signed
09:34 AM Emil: eh?
09:34 AM Emil: I don't see the problem here
09:35 AM Emil: If you want unsigned then do unsigned char a :3
09:35 AM polprog: i mean, why would you do -'a'
09:35 AM Emil: eh?
09:35 AM polprog: it's the ascii code. from 0 to 255
09:35 AM Emil: from 0 to 127
09:35 AM polprog: oh
09:36 AM polprog: looks like im still thinking in java way, there's char and byte there
09:36 AM Emil: but yes 'a' is 97 decimal
09:36 AM Emil: polprog: lol
09:36 AM Emil: polprog: wouldn't byte be the one that goes from 0 to 255?
09:36 AM polprog: ye
09:36 AM Emil: And char the one that is signed
09:36 AM julius: now that i tasted oled blood i want a bigger display, this one looks nice: http://www.buydisplay.com/default/blue-1-8-inch-256x32-oled-display-module-serial-i2c-and-ssd1326 but whats with the big flat connector..i dont see SDA / SCL connectors :(
09:37 AM julius: i mean the connections for the i2c interface, where are they?
09:37 AM polprog: char in java is only used for representing characters not 8 bit ints
09:37 AM julius: or is this a display that supports both, serial and i2c?
09:38 AM polprog: julius: i guess you need to find the datasheet for the pinout and protocol support
09:39 AM Emil: polprog: everything is a number
09:39 AM Emil: polprog: cast away your technological baggage
09:39 AM Emil: deny those idiotic types
09:39 AM Emil: see the light
09:42 AM polprog: i mean, in assembly you dont even have pointers
09:42 AM polprog: :D
09:44 AM Emil: you doooo
09:45 AM Emil: well
09:45 AM Emil: the syntax does differentiate between them
09:45 AM polprog: i mean, you can load stuff into the 16bit registers
09:45 AM polprog: and taht's kinda pointer
09:49 AM Emil: What function do you use to print in decimal?
09:49 AM polprog: like call it with FF and output "255"?
09:49 AM Emil: yes
09:50 AM polprog: we did that with itoa, not sure if its on avr
09:50 AM polprog: and if its not it's simple to write
09:50 AM Emil: Yeah but there are multiple ways to do it
09:50 AM polprog: indeed
09:51 AM polprog: id go for itoa and then try to optimize it if it gets too big
09:51 AM Emil: That's like saying "use printf"
09:51 AM Emil: We both know it's not going to happen
09:51 AM Emil: ;)
09:51 AM polprog: yes, but it's one level lighter
09:52 AM renn0xtk9: if on a usbasp 10 pin connector you don't connect all gnd together (see https://www.google.de/search?q=usb+asp+10+pin+connector+layout&tbm=isch&imgil=8J4_WnyY7AteVM%253A%253BCjcvRZ84iCszYM%253Bhttp%25253A%25252F%25252Fwww.electroschematics.com%25252F9412%25252Fusb-asp-programmer-atmega-programming%25252F&source=iu&pf=m&fir=8J4_WnyY7AteVM%253A%252CCjcvRZ84iCszYM%252C_&usg=__hpdtfVdcL2V2NT74f4ARqzVEABU%3D&biw=1920&bih=873&ved=0ahUKEwjq--
09:52 AM renn0xtk9: rv7abUAhUMFiwKHTPLDbUQyjcIMQ&ei=AWM1War3MoyssAGzlreoCw#imgrc=8J4_WnyY7AteVM:)
09:52 AM renn0xtk9: does not matters ?
09:52 AM polprog: srsly, converting from 8 bit hex to a string you need 3 modulos. no way it's gonna be ligher
09:53 AM polprog: renn0xtk9: no it's ok
09:54 AM polprog: if you want to go deeper that itoa that's the part i would personally try to write in assembly.
09:54 AM Emil: polprog: >modulos
09:54 AM Emil: polprog: you do realise that avrs don't have a modulo operation? :D
09:54 AM polprog: yes
09:54 AM Emil: polprog: and that the module is done by the division algorithm here
09:54 AM Emil: and that while modulos produce clean code
09:55 AM Emil: they are absolutely horrible in performance :D
09:55 AM polprog: i suppose so
09:55 AM polprog: division is horrid no matter what device you do it on
09:55 AM polprog: just look at how you divide with pen and paper
09:56 AM Emil: point is that you don't have to use division here
09:56 AM specing: < polprog> srsly, converting from 8 bit hex to a string you need 3 modulos. no way it's gonna be ligher
09:56 AM specing: 768 byte lookup table
09:56 AM specing: in FLASH
09:56 AM Emil: :DDDDDDDDDDDDDDD
09:56 AM polprog: eww. that
09:57 AM specing: its like 5 cycles to get it
09:57 AM Emil: specing: what function do you use?
09:57 AM specing: Emil: for what?
09:57 AM polprog: some of the devices have less than 768 bytes in flash...
09:57 AM Emil: specing: to print in decimal
09:57 AM specing: Emil: Integer'Image
09:57 AM Emil: ah yeah
09:57 AM Emil: _ADA_
09:57 AM Emil: :D
09:57 AM specing: :DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
09:58 AM polprog: specing: are you coding in ada?
09:58 AM specing: polprog: yeah
09:58 AM polprog: on avr
09:58 AM specing: sometimes ;p
09:58 AM specing: not on AVR yet, no
09:58 AM polprog: nice
09:58 AM specing: I have like -1 time to do fun stuff
09:58 AM polprog: :(
09:58 AM cehteh: there is nothing nice about that :D
09:59 AM specing: studying computer science here prevents you from doing computer science
09:59 AM polprog: Emil: unless your goal is to rewrite the itoa id go for itoa and focus on the whole thing
10:00 AM polprog: the first answer is genius in its simplicity: http://www.avrfreaks.net/forum/convert-integer-string
10:07 AM renn0xtk9: In my arduino install folder i have a bootloader ./atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex
10:07 AM renn0xtk9: now I want to make it work using external crystal (16MHz )
10:07 AM renn0xtk9: can i use the same?
10:07 AM polprog: i dont think so
10:08 AM polprog: but im not an expert on arduinos
10:08 AM specing: it will probably work, just uart speed will be x2
10:08 AM specing: or whatever it uses to boot over
10:08 AM cehteh: some people use the arduino IDE only to flash the bootloader :D
10:09 AM renn0xtk9: at least, should not explode the components, should it?
10:09 AM polprog: no, it will be fine
10:10 AM cehteh: ATmegaBOOT_168_atmega328.hex
10:10 AM cehteh: sound right
10:10 AM cehteh: but i dont know exactly
10:11 AM cehteh: i use the arduino bootloaders on some nanos where it is installed, but didnt care any more
10:11 AM cehteh: 8mhz sounds wrong/special for arduinos, most run on 16mhz
10:12 AM polprog: yeah, i feel that too
10:12 AM renn0xtk9: hm I am still left with avrdude: error: could not find USB device with vid=0x16c0 pid=0x5dc vendor='www.fischl.de' product='USBasp although this times It does show up in lususb
10:13 AM cehteh: udev ...
10:13 AM polprog: wow, im messing with gdb now
10:14 AM cehteh: $cat /etc/udev/rules.d/45-avrdude.rules
10:14 AM cehteh: SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05dc", GROUP="plugdev", MODE="0666"
10:14 AM polprog: renn0xtk9: check if lsusb output vid and pid are the same
10:14 AM cehteh: then add yourself to the 'plugdev' group
10:14 AM cehteh: and re-login
10:14 AM cehteh: at least thats for debian
10:15 AM polprog: sudo usermod -aG plugdev <yourlogin>
10:15 AM cehteh: yes
10:15 AM polprog: ive been throught that with the dragon on every linux pc i used for avrin'
10:23 AM julius: polprog: you wanna make you work, dont you
10:23 AM Emil: https://emil.fi/jako/kuvat/2017-06-05_17-47-44_ky56gI1G.png
10:23 AM polprog: Emil: lol
10:23 AM polprog: julius: what do you mean
10:24 AM DKordic: Emil: `spi_xchg', `spi_shift', `spi_fifo'?
10:24 AM Emil: How the fuck has Microsoft accepted such a paypment service provider :D
10:24 AM Emil: Beyond fucking retarded
10:24 AM Emil: I would never fucking ever trust a service like that
10:26 AM Emil: DKordic: xchg?
10:26 AM polprog: hey, avr-gdb looks nice
10:26 AM polprog: gotta play with that
10:27 AM renn0xtk9: regarding udev found this https://andreasrohner.at/posts/Electronics/How-to-fix-device-permissions-for-the-USBasp-programmer/ and did sudo cp 99-USBasp.rules /etc/udev/rules.d/ as instructed, but no progress
10:27 AM polprog: renn0xtk9: did you checkk the vid and pid
10:28 AM renn0xtk9: polprog yep those specfieid in error message of avrdude are same as those from lsusb
10:28 AM polprog: did you log in and log out after adding yourself to plugdev?
10:28 AM polprog: or in case of that post replace uucb in that file with plugdev
10:33 AM DKordic: Emil: You asked about a name for a procedure for a SPI transfer. `xchg' is an abbreviation of `exchange'.
10:34 AM DKordic: I like `SPI.shift' the most.
10:35 AM polprog: id replace that dot with a _
10:36 AM DKordic: Why?
10:36 AM polprog: because it looks like a struct
10:36 AM polprog: or a class
10:36 AM polprog: or whatever
10:36 AM DKordic: It should be :) .
10:38 AM Emil: filthy c++
10:38 AM Emil: begone!
10:38 AM Emil: ;)
10:38 AM polprog: :P
10:39 AM polprog: but, if you have the whole project in OOP c++ then sure, using an object to interface SPI is a good idea
10:41 AM polprog: i need to cook something for myself
10:41 AM specing: an object or a tagged object?
10:42 AM polprog: i dont know. i never did c[++] higer than a struct
10:42 AM specing: C structs are simple objects
10:42 AM specing: C++ structs are tagged objects
10:42 AM specing: tagged in that there is a tag in them identifying the type of structure (so you can call methods on it)
10:44 AM specing: Ada has both and you explicitly define which one it is
11:00 AM julius: polprog: just kidding...that was a comment to your answere a few hours ago where you said that i should find the datasheet
11:01 AM renn0xtk9: polprog so I log in /out use plugdev, still same thing. What is not clear to me is if I should replace {idVendor} by something in
11:01 AM renn0xtk9: SUBSYSTEM=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05dc", GROUP="uucp"
11:03 AM kre10s: Anyone here with epxperience with WISP?
11:20 AM jaggz: I think my little attiny85 board died..
11:21 AM LeoNerd: :/
11:21 AM jaggz: it's been my refrigerator door alarm for a year or so
11:27 AM HighInBC: oh dear
11:27 AM HighInBC: wonder why
11:33 AM renn0xtk9: If i sudo arduino, it will now say avrdude: error: programm enable: target doesn't answer. 1
11:33 AM renn0xtk9: don't know if it is the sayme problem or not
12:03 PM Emil: Check the wires
12:24 PM xentrac: C++ structs do not necessarily contain any runtime type information; you can even define methods on them without runtime type information, and this is a common thing to do
12:25 PM xentrac: you can even do polymorphism without runtime type information in C++, which is a feature it copied from Ada (credit where credit is due!)
12:25 PM xentrac: you just have to do it at compile-time
12:26 PM xentrac: once you define a virtual method, though, your C++ struct gets runtime type information for runtime polymorphism via method dispatch
12:27 PM mark4: emil i want to use atmel studio 7 but i need the GNU tool chain which is not an available option for some reason
12:28 PM Emil: yes it is
12:29 PM Emil: it is the default one
12:29 PM xentrac: I'm not clear on whether specing meant runtime type information (such as a vtable pointer or pointer type tag) when they said "there is a tag in them identifying the type of structure (so you can call methods on it)" but that is my best guess
12:30 PM xentrac: because as far as I know C++ and Ada are exactly equivalent on these axes
12:30 PM xentrac: (that doesn't mean you should use C++)
12:50 PM mark4: ok NOW i know why avr assembler is the ONLY tool available in my project. it needs to be a c/c++ project for me to be able to select the gnu toolchain instead of just avrasm2
12:55 PM xentrac: haha
12:55 PM xentrac: extremely poor user interface design
01:01 PM Lambda_Aurigae: it's based on mickysoft visual studio..what do you expect?
01:02 PM Lambda_Aurigae: renn0xtk9, how do you have the programmer connected to the chip? schematic would help..pictures too.
01:08 PM renn0xtk9: Lambda_Aurigae: yes connectd. Schematic : bottom right of the page https://www.arduino.cc/en/Tutorial/ArduinoISP difference is instead of connecting an arduio board to hte bread board, i connect the usbasp
01:08 PM renn0xtk9: but quartz capacitors and resistors are connected present as on the scehmatcis
01:09 PM polprog: where did you get your atmega (the one you program)
01:12 PM renn0xtk9: I ordered it on internet
01:12 PM renn0xtk9: amazon or reichetl
01:13 PM renn0xtk9: it is an ATMEGA 328 P - PU
01:13 PM polprog: so it's probably configured to use the internal clock
01:13 PM Tom_L: by default they use the lowest internal clock
01:13 PM polprog: no caps and crystal necesary
01:13 PM Tom_L: usually 1 or 2Mhz
01:14 PM renn0xtk9: okay and there is no way to override it ?
01:14 PM polprog: not without a working programmer
01:14 PM Tom_L: sure there is but you need a programmer
01:14 PM renn0xtk9: so I just shall place the atmega on the breaboad without anything else not even the resistor
01:14 PM polprog: id put the resistor
01:15 PM polprog: useful
01:15 PM Tom_L: you need minimal jumpers
01:15 PM polprog: what is the current status of your programming rig?
01:15 PM renn0xtk9: by "programmer" what tdo you mean exactly? i thought usbasp was some kind for "in sytem " programmer ?
01:15 PM polprog: usbasp is a programmer
01:15 PM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/how_to/atmega168/breadboard_basic_side.jpg
01:15 PM Tom_L: there is said minimal jumpers
01:16 PM Lambda_Aurigae: renn0xtk9, so you are not programming an atmega328..you are programming an arduino board.
01:16 PM renn0xtk9: polprog so i can override it
01:16 PM Lambda_Aurigae: with an atmega328 on it.
01:16 PM renn0xtk9: Lambda_Aurigae no no
01:16 PM Tom_L: he just said breadboard
01:16 PM renn0xtk9: I let the arduino board away
01:16 PM Tom_L: as in lunchtime
01:17 PM polprog: can you post a link to a photo of the setup
01:17 PM polprog: ?
01:17 PM Lambda_Aurigae: still think something is misconnected.
01:17 PM renn0xtk9: i just want to burn arduin bootloader onto the atmega
01:17 PM renn0xtk9: yep wait a second
01:17 PM mark4: so i created a new project c/c++ and have renamed the C file to .S file and i have a bunch of includes in there. al the incldued files are in the same dir as the main.S file. cannot include any files, path or file not found
01:17 PM Tom_L: i posted a jpg of a minimal wiring on a breadboard
01:17 PM Lambda_Aurigae: for the arduino bootloader to work you also have to set the fuses to match what the arduino uses...and have a compatible crystal connected.
01:18 PM polprog: yeah
01:18 PM Tom_L: very clear to follow
01:18 PM mark4: do i need to .include "c:\foo\bar\bam\fud\stuff\project\includ_file.s" ?
01:18 PM xentrac: are you #include "file.h" ing or #include <file.h>ing, mark4?
01:18 PM xentrac: oh, right, .include
01:18 PM mark4: not .h and its not #include its .include DOT include
01:18 PM mark4: ya lol
01:18 PM mark4: except path or file not founde
01:18 PM xentrac: I don't remember
01:20 PM mark4: nope. its not even allowing me to specify the full path to the file. path or file not found
01:20 PM mark4: fscking stupid tools
01:20 PM polprog: dont specify a full path
01:20 PM mark4: utter fucking garbage
01:20 PM polprog: fix the path variable and specify the file in <> barckets
01:20 PM Lambda_Aurigae: just renaming a .c file to .s won't change how it's handled I don't believe.
01:20 PM mark4: its not a C file
01:20 PM mark4: its not .s its .S
01:21 PM Lambda_Aurigae: have you told the compiler to run it only through the assembler?
01:21 PM polprog: renn0xtk9: do you have the thing set up in a way you can run avrdude (even if its failing)
01:22 PM mark4: the extension does that
01:22 PM xentrac: mark4: if you're specifying the full path you might need to use / rather than \
01:22 PM polprog: yes, use the proper slash
01:22 PM xentrac: and maybe drop the c: part
01:22 PM mark4: double \ was the problem there
01:22 PM xentrac: well, somewhat improper on Win32
01:22 PM xentrac: oh, now it works?
01:22 PM mark4: i got the full path working but its bad
01:23 PM xentrac: Lambda_Aurigae: generally gcc is smart enough to handle .s files by just handing them to the assembler
01:23 PM polprog: is the problem with the search path for the assembler
01:23 PM mark4: its not good but now its including the files. i should be able to just do .include "foo.inc"
01:23 PM xentrac: yes, you should
01:23 PM polprog: let me tell you something
01:23 PM mark4: where do i set an include path
01:23 PM polprog: something like "project settings"
01:23 PM polprog: i dunno, i dont use that ide
01:24 PM renn0xtk9: http://imgur.com/a/FSUYv
01:24 PM xentrac: yeah, I don't either; I quit using Win32 in like 2001
01:24 PM Lambda_Aurigae: I use sata these days over ide
01:24 PM polprog: first of all
01:24 PM polprog: renn0xtk9: where is the nudge on the 10 pin connector
01:25 PM polprog: ok, i see it's the proper way around
01:25 PM Lambda_Aurigae: as we can't see what is connected where on the 10pin,,,nor can we see what is connected to what on that board,,,kinda,,useless.
01:25 PM polprog: yeah, i see 5 cables
01:25 PM polprog: one is missing
01:25 PM polprog: i bet it's Vcc
01:25 PM mark4: its not letting me edit the command line for the assembler. i need to add -nostartfiles or what ever its called
01:25 PM Lambda_Aurigae: miso, mosi, sck, gnd, vcc
01:25 PM Lambda_Aurigae: and reset
01:27 PM Lambda_Aurigae: polprog, there's 6
01:27 PM Lambda_Aurigae: but, still, no clue what goes where on either the end of the cable or on the circuit board.
01:27 PM polprog: youre right theres 6
01:28 PM polprog: so we need to see the under side of the PCB and the cable end on the photo
01:31 PM renn0xtk9: http://imgur.com/a/uzaDh
01:31 PM renn0xtk9: sorry the PCB make it worse to understand how it is made :S
01:31 PM polprog: thats better
01:32 PM polprog: and whats the error avrdude gives
01:33 PM renn0xtk9: it says that https://pastebin.com/RpjEnbqa
01:33 PM Lambda_Aurigae: pull the chip out of the socket
01:33 PM Lambda_Aurigae: put an ohmmeter between VCC and GND
01:33 PM polprog: warning: cannot set sck period. please check for usbasp firmware update.
01:34 PM polprog: if it was bad chip it would say rsp failed
01:34 PM polprog: thats why my usbasp is stufed in the drawer since i started avring
01:34 PM polprog: you need a programmer to fix your programmer
01:34 PM polprog: ...
01:35 PM Lambda_Aurigae: I told him to update the firmware on the programmer yesterday.
01:35 PM Lambda_Aurigae: one of the first things I said.
01:35 PM polprog: the good news is that if you have a paralell port (wide, pink, many pins) you can make a parport programmer
01:35 PM Lambda_Aurigae: or was that someone else?
01:36 PM renn0xtk9: yesterday i was not there
01:36 PM xentrac: Lambda_Aurigae: with the positive lead on the Vcc pin, or do you want to test the resistance of the input clamping diodes?
01:37 PM renn0xtk9: and after googling i read that it is firmer update would be only the case if very old programmer
01:37 PM polprog: and believe me, they stock them for too long
01:37 PM Lambda_Aurigae: aahh..it was this morning at 0605AM my time.
01:38 PM Lambda_Aurigae: xentrac, no...with the ohmmeter, I wanted him to test the board for a short...with the chip removed from the socket.
01:38 PM renn0xtk9: So chip out , ohmeter VCC-GND : infinite
01:38 PM Lambda_Aurigae: renn0xtk9, very old is 4 days or more depending on what firmware they put on the board when it was made.
01:39 PM Lambda_Aurigae: renn0xtk9, good..no short on the power lines anyhow.
01:39 PM polprog: im telling you it's the old firmware
01:39 PM polprog: ive been through this
01:39 PM Lambda_Aurigae: that's what I said at 0605 this morning!
01:39 PM xentrac: oh, not the Vcc and ground pins of the chip
01:39 PM Lambda_Aurigae: hehe
01:39 PM Lambda_Aurigae: xentrac, no...some of the soldering on that board looked iffy...from the pic there could be a bridge or two.
01:40 PM renn0xtk9: So essentially I should flash with firmware comming from this ?
01:40 PM renn0xtk9: http://www.fischl.de/usbasp/
01:40 PM polprog: yeah
01:40 PM Lambda_Aurigae: but you have to have a programmer to program the programmer.
01:41 PM polprog: yo dawg
01:41 PM learath: it's programmers all the way down?
01:41 PM Lambda_Aurigae: if you have a pc with an IDE port you can build a programmer for that...or some usb 4 port hubs can be turned into a bitbang programmer...or a parallel port.
01:41 PM Lambda_Aurigae: or,
01:41 PM Lambda_Aurigae: if you are a masochist.
01:41 PM polprog: i would say the parport cable is the best idea
01:42 PM Lambda_Aurigae: couple of push buttons, some caps, and a couple of LEDs and resistors.
01:42 PM Lambda_Aurigae: do it manually!
01:42 PM polprog: or dont make the mistake i did and start with basic electronics, caps, transistors, opamps etc
01:42 PM Lambda_Aurigae: polprog, my first programmer, and the one I most use, is parallel port and 74ls244 based.
01:43 PM Lambda_Aurigae: polprog, what's wrong with learning the basics?
01:43 PM Lambda_Aurigae: it's how I teach my students...kids in the range of 12 to 18.
01:43 PM polprog: nothing.
01:43 PM Lambda_Aurigae: I make them read and learn.
01:43 PM renn0xtk9: HM :S so the one I have right now i can threw it to the bin and buy a new one ( hopefully with modern firmware) ?
01:43 PM xentrac: Lambda_Aurigae: do you teach them to use SPICE?
01:43 PM polprog: nobody will guarantee you that it has new firmware
01:43 PM Lambda_Aurigae: xentrac, nope...I give them bits and pieces and books.
01:44 PM renn0xtk9: so how to do ?
01:44 PM Lambda_Aurigae: renn0xtk9, the problem looks like the programmer is going too fast....you either need a chip running at 8MHz or a programmer with updated firmware.
01:44 PM polprog: let me find that instructables link i found 2 years ago
01:44 PM renn0xtk9: If i get a programmer that cann ot programm my chip and cannot programm my programmer
01:44 PM Lambda_Aurigae: find someone else who has a programmer and use that.
01:44 PM Lambda_Aurigae: find a computer with a parallel port.
01:45 PM Lambda_Aurigae: anything that will run linux and has a parallel port will do.
01:45 PM Lambda_Aurigae: or, heaven forbid, windows xp.
01:45 PM renn0xtk9: I thought crystal would mean it run 16Mhz no ?
01:46 PM Lambda_Aurigae: if there is a 16mhz crystal connect
01:46 PM Lambda_Aurigae: AND
01:46 PM Lambda_Aurigae: if the fuses are set to use the crystal.
01:46 PM Lambda_Aurigae: if you can't program it then you can't change the fuses and it's running at 1MHz by default from the factory.
01:46 PM Lambda_Aurigae: 8MHz internal RC oscillator with the DIV/8 fuse set...
01:46 PM xentrac: ±5%?
01:47 PM Lambda_Aurigae: xentrac, yeah...more depending on temperature and VCC voltage even.
01:47 PM Lambda_Aurigae: although, the newer ones have tighter tolerances.
01:48 PM polprog: renn0xtk9: i found the cable
01:48 PM polprog: ill post a pic in a moment
01:49 PM renn0xtk9: are there some "official " programer from avr ideally with avrdude support and latest firmware to do everything i want
01:49 PM Lambda_Aurigae: https://sites.google.com/site/emrirc/avrisp-unbuffered.gif
01:49 PM Lambda_Aurigae: simplest avr programmer I found.
01:49 PM polprog: https://drive.google.com/open?id=0B7nrducTAtMTRTNwV0RxTFVJVlU
01:49 PM Lambda_Aurigae: https://sites.google.com/site/emrirc/avrisp-buffered.gif
01:49 PM Lambda_Aurigae: the programmer I use..and have used for 15+ years.
01:50 PM polprog: the thing is called dapa or paralell port programmer
01:50 PM polprog: go for the design with resistors
01:50 PM xentrac: I was thinking of making an FM radio by putting a resistor on the Vcc pin of an AVR, streaming out SPI data at 8MHz, using the nominally 104MHz harmonic, and adjusting the frequency by varying the CPU duty cycle
01:50 PM xentrac: think it'll work, Lambda_Aurigae?
01:50 PM xentrac: SPI data 0x55 0x55 0x55 etc., with appropriate delays to avoid going out of phase
01:51 PM Lambda_Aurigae: https://sites.google.com/site/emrirc/isp-adapter-circuit.gif
01:51 PM polprog: renn0xtk9: http://www.instructables.com/id/Ghetto-Programming%3A-Getting-started-with-AVR-micro/ , step 4 you need
01:51 PM Lambda_Aurigae: the ones I post all use the stk200 setting in avrdude.
01:51 PM polprog: Lambda's schem is even better
01:51 PM Lambda_Aurigae: xentrac, possibly...I've used an avr to make an AM transmitter.
01:51 PM polprog: youll have to make it on a rasterboard
01:52 PM xentrac: yeah, I should probably try that first
01:52 PM xentrac: did you use an external mixer or was it DDS?
01:52 PM Lambda_Aurigae: recorded input with an ADC through an opamp and mic.
01:53 PM Lambda_Aurigae: mic-opamp-avradc
01:53 PM xentrac: sure, I meant on the output side
01:53 PM renn0xtk9: there is nothing like official kit that i could plug via usb?
01:53 PM Lambda_Aurigae: oh..
01:54 PM Lambda_Aurigae: DDX
01:54 PM Lambda_Aurigae: err
01:54 PM Lambda_Aurigae: DDS
01:54 PM renn0xtk9: parrallel port would mean i need to buy other computer
01:54 PM xentrac: renn0xtk9: you're looking for an Arduino Uno I think
01:54 PM Lambda_Aurigae: renn0xtk9, yes...there are several.
01:54 PM polprog: you can also use an arduino or a raspberry pi
01:54 PM xentrac: I mean Atmel/Microchip also have their own but the Arduino is a lot more popular
01:54 PM xentrac: even though Lambda_Aurigae hates it
01:54 PM Lambda_Aurigae: avrisp MK-II is the latest.
01:54 PM Lambda_Aurigae: ardweeny is a cancer
01:54 PM polprog: just dont buy the pickit because it wont work
01:54 PM xentrac: see?
01:55 PM Lambda_Aurigae: pickit3 works great..for pic...not for avr
01:55 PM Lambda_Aurigae: yet
01:55 PM xentrac: Lambda_Aurigae: the things I'm thinking might not work are that the 13th harmonic of the square-wave output might not be strong enough to detect, or that the frequency variation of the RC oscillator with Vcc might not be predictable enough to use
01:55 PM renn0xtk9: xentrac I have an arduino Uno but when i did try to burn bootloader ono the breadboard
01:55 PM renn0xtk9: but it did not work
01:55 PM xentrac: have you checked the wiring diagrams on the ArduinoISP page?
01:56 PM renn0xtk9: then sombody told me you got to buy a proper ISP like USBasp or whatever because arduino is shit to burn bootloader
01:56 PM Lambda_Aurigae: xentrac, I did everything on solderless breadboard...got about a meter range, give or take.
01:56 PM Lambda_Aurigae: usbasp is NOT a proper programmer..it is a hack.
01:56 PM Lambda_Aurigae: there is a reason they cost 2 dollars.
01:57 PM polprog: ive seen a hackaday post where they reprogrammed those. nice dev board for $2 :P
01:57 PM renn0xtk9: yes that is why what I would like is something I plug to usb with sockets for various ATMEGA and that allow all options thinkable and supported and working.. tired of those hacks slowly
01:57 PM xentrac: Lambda_Aurigae: did you generate the AM signal with a PWM output? how fast could you get that to go?
01:57 PM renn0xtk9: even arduino is a hack since it does not work right
01:57 PM xentrac: or like an R-2R ladder DAC?
01:58 PM Lambda_Aurigae: I was at about 512KHz with a timer output..and generated the audio out with pwm.
01:58 PM Lambda_Aurigae: it sounded like crap.
01:58 PM Lambda_Aurigae: arduino takes a few shortcuts, specially on the adc side.
01:59 PM xentrac: so you ran the timer at 512kHz and modulated the (phase-correct?) PWM thresholds to generate the AM signal?
01:59 PM xentrac: (a 512kHz AM signal I suppose)
01:59 PM Lambda_Aurigae: phase correct? hmmm...OOPS
01:59 PM Lambda_Aurigae: hehe
01:59 PM Lambda_Aurigae: yeah.
01:59 PM xentrac: haha
01:59 PM polprog: from hw side the arduino is nothing more than the thing you'd assemble on a breadboard for crude testing :P from the sotware side it has a terribly bloated library, which you dont have to use
01:59 PM Lambda_Aurigae: I did it in 20 minutes one day when I was bored,,,10 years ago.
02:00 PM polprog: it's up to you if you wanna pay 50 euros for an avr and an usb-uart chip :D]
02:00 PM xentrac: I imagine the phase-correct PWM mode would have helped a bit, and maybe some dithering
02:00 PM Lambda_Aurigae: polprog, I'll have you know I have devices running on solderless breadboard for more than 5 years straight! crude testing...bah
02:00 PM xentrac: since at 512kHz you don't have very many bits to work with
02:01 PM polprog: Lambda_Aurigae: temporary solution is the most permanent solution :D
02:01 PM Lambda_Aurigae: xentrac, my goal, at the time, was to build an avr based receiver too...but never got round to it...ended up doing other things.
02:01 PM polprog: but i think they dont make breadboard like theese anymore :D
02:01 PM Lambda_Aurigae: also didn't understand the whole PLL thing at the time nor did I know anything about DSP.
02:01 PM xentrac: I think you can get knockoff Arduinos for like €10
02:02 PM Lambda_Aurigae: cheaper than that even.
02:02 PM xentrac: including the USB interface?
02:02 PM renn0xtk9: what is a good brand for such things?
02:02 PM polprog: what do you mena
02:02 PM Lambda_Aurigae: xentrac, yeah..there is one that uses v-usb on the main chip as I recall.
02:02 PM xentrac: nice
02:02 PM xentrac: v-usb is very impressive
02:02 PM Lambda_Aurigae: 3M is a good brand for anything.
02:03 PM Lambda_Aurigae: xentrac, it's a hack!
02:03 PM Lambda_Aurigae: hehe
02:03 PM xentrac: yes
02:03 PM polprog: if you want to have non-counterfeit parts buy at mouser/tme/farnell/digikey
02:03 PM xentrac: it certainly is
02:03 PM Lambda_Aurigae: and was stolen from someone else.
02:03 PM polprog: or a local electronics shop
02:03 PM Lambda_Aurigae: and it's only compatible with about 80% of the usb ports around.
02:03 PM renn0xtk9: When looking at programmer on amazon all there seems to be is crap
02:03 PM polprog: yeah
02:03 PM Lambda_Aurigae: depending on how the hardware is done...which, for most of the cheap crap usbasp boards, it's done the cheap easy way.
02:04 PM polprog: every tom dick or harry in shenzen can dowload the usbasp files and make 100k of them before dinner
02:04 PM xentrac: Lambda_Aurigae: once I learned the basics of PLL I did this:
02:04 PM Lambda_Aurigae: can, and did.
02:04 PM xentrac: main(a,b){for(;;)putchar(b+=16+(a+=(b&256?1:-1)*getchar()-a/512)/1024);}
02:04 PM xentrac: comment: /* A PLL in one line of C. arecord | ./tinypll | aplay */
02:04 PM Lambda_Aurigae: now you are going to make me try to decipher that aren't you?
02:04 PM polprog: honestly, get yourself the official programmer
02:05 PM xentrac: no, run it, if you have something that can feed it 8ksps audio on stdin and play it from stdout
02:05 PM polprog: renn0xtk9: avrisp mkII
02:05 PM xentrac: and then sing at it
02:05 PM Lambda_Aurigae: hehe.
02:05 PM Lambda_Aurigae: I need to go back to work now...lunch is over.
02:05 PM Lambda_Aurigae: have fun.
02:06 PM xentrac: arecord and aplay are the ALSA Linux version
02:06 PM xentrac: you too!
02:06 PM polprog: have fun :P
02:08 PM renn0xtk9: don't find anything sensible
02:09 PM polprog: on that cable?
02:11 PM polprog: interesting stuff https://www.youtube.com/watch?v=tCRPUv8V22o
02:11 PM renn0xtk9: I am looking for a full kit now I don't have a parralle port on my computer
02:11 PM polprog: expecially you xentrac
02:11 PM renn0xtk9: nad on internet you find things like that https://www.reichelt.de/?ARTICLE=97200&PROVID=2788&wt_mc=amc141526782519998&gclid=CjwKEAjwgtTJBRDRmd6ZtLrGyxwSJAA7Fy-hF_WF-EBPnu4DMe_XUrVnTZy5RW8PcqWDpyCRJLvloBoC7pvw_wcB but it looks so chinese as well
02:11 PM renn0xtk9: they did not even had money to put the socket on..
02:12 PM polprog: actually dragon is what i use on a daily basis
02:12 PM polprog: its official atmel
02:12 PM polprog: expensive though
02:13 PM kc2uez: the box it comes in is sooo sexy
02:13 PM renn0xtk9: If I have to solder socket on it right after receiving it....
02:13 PM polprog: the box is the bees knees
02:13 PM polprog: you dont have
02:13 PM polprog: it has the 6 pin ISP header
02:14 PM kc2uez: i put a zif socket on mine
02:15 PM polprog: me too
02:15 PM renn0xtk9: yeah and then you are sill of playin with jumper which can disconnect .... it is easier 2 $ USBasp and for that price you play with jumper or you get the quality:S
02:16 PM kc2uez: I 3d printed a case for it from thingiverse.com it came out really cool
02:17 PM kc2uez: https://www.thingiverse.com/thing:213609 that case
02:18 PM polprog: honestly the zif i used twice in a liftime
02:18 PM polprog: for checking which DIP avrs are dead
02:18 PM polprog: and i havent used a DIP avr, maybe in 6 months :D
02:18 PM polprog: but the nice thing about dragon is that it has a 300mA 5V supply
02:19 PM polprog: the second 6 pin header
02:19 PM renn0xtk9: it is not even clear wether it supports linux/avrdure
02:20 PM polprog: it is supported
02:20 PM polprog: if you wanna pay the price, go or it
02:20 PM polprog: go for it*
02:20 PM polprog: it looks nicer in the box
02:21 PM NoHitWonder^: mark4 Toolchain->AVR/GNU Compiler->Directories->Include paths
02:22 PM kc2uez: I would say, if you don't have a programmer and want to buy the last one you need for a long time, go for the atmel-cie
02:22 PM mark4: NoHitWonder^, anything I put in there just gets consigned to /dev/null
02:22 PM mark4: NOTHING gets added to the list of include paths
02:22 PM kc2uez: atmel-ice i mean
02:23 PM mark4: but looking in the .cproj file theres an entry in there for the switch I added. it just is not having any affect
02:23 PM polprog: if you were asking why we dont use ides
02:23 PM polprog: lel
02:23 PM mark4: i have main.S and foo.inc in the same directory. .include "foo.inc" gives path or file not found
02:23 PM mark4: i have no choice
02:30 PM Emil: What am I doing wrong
02:30 PM Emil: http://www.ti.com/lit/ds/symlink/tlv5620.pdf
02:30 PM Emil: Trying to drive this
02:31 PM specing: not using Ada
02:32 PM polprog: honsetly
02:32 PM polprog: it looks like your typical shift-storage register
02:32 PM polprog: ..
02:33 PM Emil: yeah
02:33 PM Emil: I know
02:33 PM polprog: not sure what's rng on the top waveform on p 4
02:34 PM mark4: NoHitWonder^, that would only modify the include path for C files.
02:34 PM polprog: but apart from that i could change a single ldi in my 595 code and drive that :P
02:34 PM Emil: "With LOAD high, data is clocked into the DATA terminal on each falling edge of CLK"
02:34 PM mark4: WHAT C files? there are no c files what so ever in this project and it built just fine under avr studio 4
02:34 PM Emil: This means data is sampled on falling edge, right?
02:34 PM Emil: Not that data is setup on falling edge
02:34 PM polprog: yea
02:34 PM mark4: any include path I add to the assembler just disappears
02:35 PM polprog: id say its not even sampled, just loaded to the shift reg
02:35 PM Emil: https://emil.fi/jako/koodi/tlv5620.c
02:35 PM Emil: shouldn't that fucking werk
02:36 PM mark4: is there a atmel tech support email? because avrfreaks is community based and the community does not seem to be able to help
02:36 PM polprog: you are using spi which is 8 bit
02:36 PM Emil: polprog: hm?
02:36 PM polprog: and the thing wants 10 bit bursts
02:36 PM Emil: no
02:36 PM Emil: it wants 3 bits and then 8 bits
02:36 PM polprog: yeah
02:36 PM polprog: 11 bit bursts
02:37 PM Emil: Figure 3 and 4 demonstrate
02:37 PM polprog: oh
02:37 PM polprog: hmm
02:38 PM polprog: what the hell does it expect before the first 3 bits, the data is any, the clock's pulsing
02:38 PM Emil: any data
02:38 PM Emil: it takes the last 3 bits
02:38 PM polprog: ok then
02:38 PM Emil: It's a shift register :D
02:38 PM polprog: :D
02:38 PM polprog: get a scope
02:38 PM Emil: Or that's what I gather from it
02:38 PM Emil: yeah
02:38 PM polprog: running
02:38 PM Emil: I'll have to
02:38 PM polprog: you havent yet???
02:39 PM polprog: maybe its the hardware issue
02:39 PM Emil: hope not
02:39 PM Emil: Well, I'll debug tomorrow
02:40 PM Emil: Fucking hell
02:40 PM polprog: what you can do now is to take a meter and check if theres anything happening on the line
02:40 PM polprog: ...
02:41 PM polprog: btw, what meter do you have?
02:41 PM Emil: waiiiid a second
02:42 PM Emil: No
02:42 PM Emil: Nothing
02:42 PM Emil: polprog: meter?
02:42 PM Emil: Oh
02:42 PM polprog: yeah
02:42 PM Emil: I have a
02:43 PM Emil: Fluke 111
02:43 PM Emil: but apparently it is shit
02:43 PM polprog: if theres nothing happening at the spi lines id check the init method
02:43 PM Emil: Can't check without a scope
02:43 PM polprog: i something's happening the voltage would jump up and down
02:43 PM Emil: Though I could analyse it with another avr
02:43 PM polprog: no
02:43 PM polprog: measue the voltage on the line
02:44 PM Emil: yes
02:44 PM Emil: with another avr
02:44 PM polprog: if it's steady 0 or Vcc then it's odle
02:44 PM polprog: lol, even my cheap unit backup meter can detect serial traffic
02:44 PM polprog: not even mentoning my brymen with the analog bargraph
02:44 PM polprog: s/unit/uni-t
02:45 PM Emil: I don't have my own scope
02:46 PM polprog: im talking about multimeters
02:46 PM Emil: :D
02:46 PM polprog: if there's traffic the voltage reading jumps up and down !
02:49 PM mark4: assembler-with-cpp <-- is there ann "assembler-without-cpp" switch?
03:16 PM mark4: nvm i understand now. it means assembler with c preprocessor support forgot that cpp meant the pre processor
03:17 PM riscaonderwater: any one point me to how to build my own wave one synth i have repaired synths for years but never dabbled in avr builds want to make a wave 1 avr synth i have a osepp mega 2560 r3 plus arduino compatible card thats new to me and works ...and a old digi 002 rack and a akai mini mpk 25 that is not getting power ,
03:17 PM polprog: id sort out that akai
03:17 PM mark4: lol this is so fucked up its unreal. after fucking with this for over an hour i finally got atmel stuidio to accept my include path. problem is... i still have the same error, path or file not found ;/
03:17 PM riscaonderwater: to play with hope that will get me where i wana go
03:18 PM polprog: Atmel Studio yay
03:18 PM mark4: and i thought Android stuidio was stupid :/
03:19 PM mark4: can't open macros.s for reading: No such file or directory
03:20 PM mark4: i can make it .include "c:\foo\bar\bam\fud\sutff\projects\specific_project]\sub_path\file_i_want_to_include" but thats fucking stupid
03:20 PM polprog: hello avr\
03:20 PM polprog: polprog is a moron
03:20 PM mark4: sorry i need to carm the $(^$* DOWN
03:20 PM NoHitWonder^: riscaonderwater there was one website
03:20 PM polprog: he cant into debouncing
03:20 PM NoHitWonder^: lets see if i can find it
03:20 PM polprog: the cap goes to ground not to signal out
03:20 PM polprog: :PPP
03:21 PM NoHitWonder^: some university professor made youtube videos and they made a synth with avr in one of his courses
03:21 PM NoHitWonder^: i cant remember the name
03:22 PM Emil: polprog: you had a friend visit you? ;)
03:22 PM polprog: no, self sahming
03:22 PM Emil: ah
03:22 PM Emil: NoHitWonder^: Bruce Land?
03:22 PM NoHitWonder^: yeah
03:22 PM Emil: Cornell
03:23 PM Emil: He's pretty cool
03:23 PM NoHitWonder^: he had some code uploaded
03:23 PM NoHitWonder^: for avr synth
03:24 PM polprog: aargh.. the modwire i use to make connections broke :P
03:24 PM NoHitWonder^: http://people.ece.cornell.edu/land/courses/ece4760/Math/avrDSP.htm
03:25 PM NoHitWonder^: http://people.ece.cornell.edu/land/courses/ece4760/Math/GCC644/DDS/DDS_sine_noise_uart.c
03:28 PM NoHitWonder^: http://people.ece.cornell.edu/land/courses/ece4760/Math/GCC644/FM_synth/FM_synth_1.c here's FM
03:34 PM toblorone_: why is it that there doesn't seem to be a good tool anywhere to generate USB HID descriptors? Seems like it would make people's lives a lot easier
03:35 PM LeoNerd: I've seen websites for it
03:36 PM * LeoNerd also was working on some perl code to do that earlier
03:36 PM toblorone_: I haven't been able to find much. I've found parsers, but nothing resembling a "wizard" that will generate one for you
03:41 PM toblorone_: also, can anyone shed some light on the relation between the bluetooth and usb stack? after receiving data over bluetooth do things typically get routed through the same modules as usb?
03:45 PM Emil: toblorone_: because usb is a horrible protocol
04:00 PM Emil: Good night
04:00 PM polprog: night
04:00 PM polprog: ill sleep too
04:00 PM polprog: after i sort iut the pushbuttons in asm
04:04 PM polprog: out*
04:04 PM polprog: maybe ill go now
04:04 PM polprog: o/
04:21 PM hetii: Hi :)
04:22 PM hetii: Maybe some of you will have idea what`s wrong: http://paste.ubuntu.com/24786803/ line 186 and 187
04:22 PM hetii: And here my results: http://paste.ubuntu.com/24786851/
04:24 PM hetii: I pass double type by using va_arg() but on stm32 it returns odd values, on PC this code works fine ;/
04:34 PM cehteh: there was some header which defines the internal guts of floats per platform .. but i cant remember the name :D
04:37 PM cehteh: /usr/include/x86_64-linux-gnu/ieee754.h ... check that
04:37 PM cehteh: should be available for stm32 somewhere too
04:40 PM hetii: hmm
04:40 PM hetii: odd
04:41 PM hetii: General those calculation functions works, but why it cannot pass this double type properly I have no clue ..
04:42 PM cehteh: havent checked, no idea
04:43 PM cehteh: now i know why i dont implemented floating point in my io stuff :D
04:47 PM cehteh: also .. for now i avoid va_args and formatstrings
04:50 PM hetii: ok you can avoid to use anything ... but its a bit frustrating when you need to print some formated string and you cannot use standard printf ...
04:51 PM cehteh: yesterday we talked about this, was that you or someone else? i cant remember
04:51 PM hetii: not me.
04:52 PM cehteh: i have just functions per type print_string("the value is "); print_float(1.23); print_endl(); like things
04:52 PM cehteh: saves from having a formatstring interpreter for now
04:52 PM cehteh: i can build upon that and add one later
04:52 PM hetii: hmm
04:53 PM cehteh: of course its a bit more versatile, as the print functions can have some options to control the format
04:53 PM cehteh: err no float yet; but you get the idea
04:53 PM hetii: yep
04:54 PM cehteh: also each of these functions is continueable, when the buffer is too small it can fill it partially
04:55 PM cehteh: like print_int(12345) on a 3 byte buffer will print 123 and return 45 .. the serial library then restart it with the rest
04:56 PM hetii: I see
04:56 PM cehteh: (its stateful, corner cases with leading zeros are handled too)
04:57 PM cehteh: me thinks formatstring are somewhat ill, they are error prone, not really type safe without special compiler support and need an extra interpreter
04:59 PM hetii: if it works for you then fine. Like in real world, by using formatstring, usually you should not care about calling all your functions, at least not in first shoot.
05:01 PM cehteh: as i saied, i may later add a formatstring interpreter calling those functions
05:01 PM NoHitWonder^: i use sprintf with stm32
05:02 PM NoHitWonder^: sprintf((char*)str, "Temp: %ld", mr.temperature_value);
05:02 PM NoHitWonder^: BSP_LCD_DisplayStringAtLine(1, str);
05:02 PM cehteh: why that cast?
05:02 PM cehteh: anyway, that works as long as you can provided a long enouh buffer
05:03 PM NoHitWonder^: if i remember correctly, i got a warning without it
05:03 PM cehteh: then you should fix the warning correctly :D instead cast it away
05:04 PM NoHitWonder^: cant really argue with you, since i dont remember the case
05:04 PM cehteh: anyway, i needed some io lib which works with very small output buffers and static allocation
05:04 PM hetii: I cannot use any printf, as soon as I try then got error about missing _write() etc syscalls or that my program is to big..
05:05 PM cehteh: heh
05:05 PM cehteh: and then you add the saied formatstring interpreter to save some memory? :)
05:05 PM hetii: I also test: https://github.com/tmk/elm-chan_xprintf but it has no float support.
05:06 PM cehteh: for a test, write a function with va_args reaping a double and return it, check if that works
05:06 PM cehteh: try to isolate the error you have
05:07 PM cehteh: and do you really need float support?
05:07 PM cehteh: my immediate plans are extending the integer functions for fixed point
05:07 PM cehteh: thats just passing the position of the decimal point and done
05:08 PM hetii: cehteh: well I just need to print them out, don`t need to do some math on it
05:09 PM cehteh: double pi=3.1415927; print_integer((int)pi*100, 2) -> 3.14
05:09 PM cehteh: print_integer(314, 2) -> 3.14
05:09 PM hetii: hehe
05:09 PM hetii: true :)
05:09 PM cehteh: that may do the job much better
05:10 PM cehteh: you can easily add some rounding as desired, dont have to care with shitloads of scientific notations when you dont need them etc
05:10 PM cehteh: and be much more lightweight
05:11 PM hetii: yep, like this idea
05:14 PM hetii: but in my case better to have a function that will calculate position of the decimal point.
05:15 PM hetii: 1.2*C as well as 100.3*C ;)
05:17 PM NoHitWonder^: centeh that cast was actually a smart cast since, sprintf takes char * and lcd_string takes unit8_t *
05:17 PM NoHitWonder^: so that was the solution for the problem
05:18 PM NoHitWonder^: the error was : pointer targets in passing argument 1 of 'sprintf' differ in signedness [-Wpointer-sign]
05:18 PM NoHitWonder^: *warning
05:19 PM cehteh: NoHitWonder^: next thing is that you better use snprintf *or* you use a buffer with the worst case size
05:19 PM cehteh: if you know what the worst case is
05:19 PM cehteh: with floating point thats sometimes not so clear :)
05:20 PM cehteh: or you limit the output with the format string, but there are some surprising corner cases
05:21 PM cehteh: hetii: yes thats up to you, you may need some flags if 0.1 is displayed as .1 or 0.1 and if trailing zeros are printed and so on
05:22 PM cehteh: but still much easier for a lot things than a complete floating point output
08:45 PM enhering: Hi.
08:45 PM enhering: https://hackaday.io/project/11724-yauvc-yet-another-unmanned-vehicle-controller/log/60880-introducing-the-yat-yet-another-tricopter
09:18 PM enhering: Lambda_Aurigae?
09:19 PM enhering: Awoke?
09:21 PM Lambda_Aurigae: nope
09:33 PM Brando753: Anyone know if there is a Attiny MCU with 6 PWM pins?
09:37 PM enhering: I believe there is not. But you can look at the MCU chooser at the manufatcurer website
09:37 PM enhering: s/cu/ctu/
11:24 PM day_ is now known as daey