#avr Logs

Jun 11 2017

#avr Calendar

12:33 AM day is now known as daey
01:29 AM day is now known as daey
01:35 AM day is now known as daey
04:09 AM noqnio1: Good morning. I foolishly tried to burn the arduino bootloader on my atmega328 and now it avrdude cant even initialize.. Is there anything i can do?
04:10 AM noqnio1: and each time i try to connect, the signature is different :/
04:19 AM noqnio1: oh well it just needed a crystal :D
04:20 AM Casper: that mean you changed the fuses
04:21 AM xentrac: heh
04:21 AM xentrac: yay!
04:21 AM noqnio1: yes i reverted them to default and removed the xtal :)
04:30 AM noqnio1: can i use a cpp library in a c program?
04:32 AM xentrac: yeah, but sometimes it can be tricky
04:32 AM noqnio1: Do i just include it and cross fingers
04:33 AM xentrac: no, you can't #include a C++ header file in a C program
04:33 AM polprog: which cpp lib do you need?
04:33 AM noqnio1: ILI9163 driver
04:33 AM xentrac: unless it happens to be a C header file
04:33 AM polprog: if it's C not C++ you can freely include it
04:33 AM polprog: and it needs to be AVR code too
04:34 AM polprog: of course
04:34 AM noqnio1: pff i cant seem to find a C lib :(
04:34 AM xentrac: the most basic thing is that you need to have entry points with C linkage, compiled with extern "C" so they use the C calling convention
04:35 AM polprog: guess you have to write one?
04:35 AM xentrac: a lot of C++ libraries define entry points with C linkage already for just this reason
04:36 AM noqnio1: xentrac: how can i see if this is the case
04:36 AM polprog: https://stackoverflow.com/questions/2238456/how-does-cs-extern-work
04:36 AM noqnio1: polprog: the cpp one is like 2000 lines, i dont think i'm up for the task
04:36 AM xentrac: you can run nm on the .o file
04:36 AM xentrac: and see if the names are mangled
04:37 AM xentrac: aside from being able to call the functions in the first place, there can also be tricky issues with exceptions
04:38 AM noqnio1: hmm it sounds more than i am willing to handle
04:38 AM polprog: simply, dont mix c and cpp
04:38 AM xentrac: and, on some platforms, static constructors
04:38 AM polprog: unless you know what youre doing
04:38 AM xentrac: it's unavoidable if you're going to use C++, polprog
04:39 AM polprog: i guess i will have to
04:39 AM polprog: good thing i have avr-g++ for starters
04:39 AM noqnio1: pff maybe i'll just reflash the arduino bootloader
04:39 AM noqnio1: and everything there
04:40 AM polprog: its up to you
04:41 AM noqnio1: well thank you both for the info :)
04:42 AM day is now known as daey
04:42 AM polprog: noqnio1: you may find this useful: http://www.atmel.com/webdoc/avrlibcreferencemanual/FAQ_1faq_cplusplus.html
04:43 AM polprog: this looks sensible
04:43 AM polprog: http://www.avrfreaks.net/forum/avr-c-micro-how?page=all
04:48 AM noqnio1: ty !
04:51 AM polprog: np :)
05:04 AM renn0xtk9: has anyone a schematic of how to plug avr dragon jtag to an atmega on a breadboad? like from there http://www.atmel.com/webdoc/avrdragon/avrdragon.section.wpr_osd_lc.html it is not clear to me which pin of the "Target AVR" correspond to which actual pin on the 328
05:53 AM renn0xtk9: on avr dragon do I have to connect VCC and VTG together?
05:56 AM polprog: you dont know which pins are TDI, TDO etc, i suppose?
05:58 AM polprog: on the dragon vtg (in isp) and vtref (in jtag) is used to adjust the signalling level for the slave (AVR). you need to connect the vtref to the avr's vcc
06:00 AM renn0xtk9: polprog, yep
06:01 AM renn0xtk9: I have also read than ATMEGA328 do not actually support JTAG , so i am programming in ISP mode. Is that right?
06:01 AM polprog: woah, wait a sec
06:03 AM polprog: 328 doesnt support jtag
06:03 AM polprog: neither does the whole serie: 48, 88, 168,
06:05 AM renn0xtk9: okay
06:05 AM polprog: it has Debugwire and ISP
06:06 AM polprog: you should use ISP
06:09 AM Emil: renn0xtk9: rtfm
06:09 AM polprog: i try to be nice xD
06:10 AM Emil: it seems the level of people not reading the fucking manual is rising
06:10 AM polprog: it too damn high
06:10 AM Emil: hmm
06:11 AM polprog: i would put that on a shirt if it wasnt so politically incorrect: https://2.bp.blogspot.com/_z-crYkXfOb8/RlYPWlFzfII/AAAAAAAAAV4/n1QQgf_9u3E/s1600/rtfm1.png
06:11 AM Emil: Does it correlate with people getting to summer vacatio
06:11 AM Emil: n
06:11 AM Emil: :DD
06:11 AM polprog: hmm
06:11 AM Emil: polprog: fucking do it
06:11 AM Emil: I will if you dont
06:12 AM polprog: this ones better: http://i0.kym-cdn.com/photos/images/newsfeed/000/131/662/22711800_646849b145.jpg
06:12 AM renn0xtk9: Emil tnfm
06:12 AM Emil: :D
06:13 AM polprog: imoressive
06:13 AM Emil: TNFM Therapeutic Nursing Function Matrix
06:13 AM renn0xtk9: There is No Fucking Manual ;)
06:14 AM Emil: >no manual
06:14 AM Emil: literally best manual available
06:14 AM Emil: top
06:14 AM Emil: kek
06:14 AM renn0xtk9: meaning http://www.atmel.com/ < they refer for instance to board revision number, which are not printed on the board you receive ...
06:14 AM renn0xtk9: therefore tnfm ...
06:14 AM Emil: ...
06:15 AM polprog: avrdude -vvv should tell you that,
06:15 AM polprog: you have a dragon, rite?
06:15 AM renn0xtk9: yes
06:15 AM Emil: >I cannot apply any information whatsoever, everything must be catered to me
06:17 AM Emil: renn0xtk9: what's your end goal?
06:17 AM Emil: To upload data to your m328?
06:17 AM Emil: Also m328 is not m328p
06:17 AM polprog: or pb
06:17 AM Emil: yeah
06:18 AM renn0xtk9: I am tryin to make a heloworld iwth AVR : uploading that bit of code http://embeddedelectronics.org/?p=9
06:18 AM polprog: 403 forbidden
06:18 AM renn0xtk9: I have P -Pu
06:19 AM polprog: but honestly, a helloworld you should write *yourself*
06:19 AM renn0xtk9: right now I am just establishing "toolchain" to upload to it
06:20 AM Emil: renn0xtk9: https://emil.fi/avr
06:20 AM polprog: what do you mean by "P -Pu" ?
06:20 AM polprog: also that link emil gave you is awesome
06:20 AM polprog: IIRC i found it when i started AVRing :P
06:21 AM polprog: lol the guy at that embedded electronics site cant setup apache :D
06:21 AM renn0xtk9: thanks
06:22 AM polprog: > If you want to build the toolchain from source (to get support for atmega328pb for example), I've a "guide" at https://emil.fi/toolchain
06:22 AM polprog: Emil: did you update that?
06:22 AM polprog: meaning /avr
06:23 AM Emil: hm?
06:26 AM Emil: Yeah I added that part after building the toolchain myself
06:27 AM polprog: lol i think i found your cv
06:27 AM Emil: it's no secret :D
06:30 AM polprog: anyway, i put that pope pic on my site for conveinience
06:30 AM Emil: nice
06:30 AM polprog: so i can link it quickly for people :D
06:31 AM Emil: Hmm
06:31 AM polprog: i should make polprog.net/rtfm
06:31 AM Emil: I wonder what's the best place to order a t-shirt with print
06:31 AM Emil: do it
06:31 AM noqnio1: Is there a virtual 8 bit avr for fpga?
06:31 AM Emil: noqnio1: there is simavr
06:31 AM Emil: and yeah, there's an fpga cores
06:31 AM Emil: have you tried using s search engine yet?
06:32 AM Emil: I know for a fact that at least the attiny85 is available as a fpga core
06:32 AM noqnio1: i wanted to bring up the topic in discussion about how cool would a multi core avr on fpga would be
06:33 AM Emil: heh
06:33 AM Emil: A multicore avr would be fucking awesome
06:33 AM polprog: yea
06:33 AM Emil: I'd even settle for just a capable DMA
06:33 AM polprog: that too
06:33 AM Emil: I mean
06:34 AM Emil: if we had a multicore AVR, it could run a scheduler and shit
06:34 AM noqnio1: fork thy shit
06:34 AM noqnio1: or have a single core just for communicating with stuff
06:38 AM Emil: renn0xtk9: to upload to an avr using an avr dragon $avrdude -p part -c dragon_isp -P usb -e -U flash:prog.hex
06:39 AM Emil: https://emil.fi/jako/kuvat/2017-06-11_14-09-15_U7KkD6ew.png
06:45 AM renn0xtk9: https://pastebin.com/zn9s8hzB <wtf is it doing with jtag if i ask him to do isp:S
06:49 AM Emil: What is that :a at the end?
06:49 AM Emil: ah auto
06:50 AM renn0xtk9: should I remove it?
06:50 AM Emil: Nah
06:50 AM Emil: well, you dont need it
06:50 AM Emil: it autodetects anyhoo
06:50 AM Emil: but why is your bitclock retarded like that?
06:50 AM Emil: This is not a serial upload :D
06:51 AM Emil: If you want to use a serial bootloader then you burn the bootloader and then use a serial to usb bridge
06:52 AM renn0xtk9: that is the baudrate from dragon_isp
06:52 AM Emil: Is your ISP wired correctly?
06:52 AM Emil: renn0xtk9: matey noooo
06:53 AM renn0xtk9: Emil the bootloader, i need it only If I want to used it as an arduino. If I just want to make a blinkking led, I should be able to launch burn the programm direclty on the fresh miconcontrolle no ?
06:53 AM hetii: Hi :)
06:54 AM Emil: https://emil.fi/jako/kuvat/2017-06-11_14-23-26_BPAThcm9.png
06:54 AM renn0xtk9: Emil form avrdude.conf https://pastebin.com/kfEdSKEn
06:54 AM Emil: renn0xtk9: rtfm
06:54 AM Emil: renn0xtk9: if you use isp you are not using the serial bootloader
06:55 AM Emil: Also the bitclock is not the same thing as baudrate
06:55 AM Emil: B!=b
06:55 AM Emil: rtfm
06:55 AM renn0xtk9: where is the fucking manual !!!
06:55 AM Emil: You can use a search engine or type "man avrdude" into a terminal
06:55 AM Emil: rtfm
06:56 AM renn0xtk9: lool man is not a manual ^^ it is at most a quick help ;_
06:56 AM Emil: ...
06:56 AM renn0xtk9: "search engine" that should ultimatly point me to a pdf which address I am asking for and that you won't give me since not existent...
06:57 AM hetii: Maybe some of you have idea regarding my issue with DMA and USART, what I try is to activate alternative dma channel for usart in stm32f030f4p6 so according http://www.st.com/content/ccc/resource/technical/document/reference_manual/cf/10/a8/c4/29/fb/4c/42/DM00091010.pdf/files/DM00091010.pdf/jcr:content/translations/en.DM00091010.pdf page 159 footnote 2 I use SYSCFG_DMAChannelRemapConfig(SYSCFG_DMARemap_USART1Rx, ENABLE);
06:58 AM hetii: and it should set proper bits in SYSCFG, but after that nothing happen, still my events are in channel2/3 instead 4/5
06:58 AM Emil: renn0xtk9: >cater to my needs reeeeeeeeeeeeeeeeeeeeeeeeeeeeEEEEEEEEEEE
06:58 AM Emil: that's all I hear
06:58 AM hetii: I ask at #stm32 but without success :/
06:58 AM Emil: what did they tell you at that cancerpool?
06:58 AM renn0xtk9: cater to evryone needs ;) rtfm is all I hear from you ... < cater to your needs ;)
06:59 AM renn0xtk9: nobody forces you to answer, If you do, do it in a constructive way
06:59 AM Emil: Well, fuck off then
06:59 AM noqnio1: Love thy neighbor
07:00 AM Emil: Don't enable idiocy
07:00 AM noqnio1: No matter your opinion, being rude achieves nothing
07:01 AM Emil: no, it feels good and achieves everything
07:01 AM Emil: if you are a fucking retard who requires everything to be catered to them, you don't need to play around with avrs
07:02 AM noqnio1: Don't be so strict, and the "it feels good" said everything
07:02 AM Emil: noqnio1: mate, I have explained pretty much everything required to renn0xtk9 and he's not interested in putting in any effort himself
07:02 AM renn0xtk9: If you are fucking idiot that does know how to say anything elst than RTFM without actually pointing to anything else then man avrdude , you don't need to hang around on IRC ...
07:02 AM Emil: lol
07:02 AM renn0xtk9: I did not insult you first so shut the fuck off sons of a bitch now !
07:02 AM Emil: :DDD
07:03 AM Emil: rtfm retard
07:03 AM noqnio1: I am not arguing with what you explained or about anyones capabilities, I'm just saying that being rude achieves nothing
07:03 AM Emil: noqnio1: we are not here to enable idiocy
07:03 AM noqnio1: I didn't even read your correspondence
07:03 AM Emil: this is not your safe space
07:03 AM Emil: this is the wild internet
07:03 AM renn0xtk9: noqnio , let it alone he said it himself, it does good to his ego ;)
07:03 AM noqnio1: We are not here to fight either, its fucking sunday morning
07:03 AM Emil: noqnio1: well, if you didn't read anything perhaps you shouldn't comment :)
07:04 AM renn0xtk9: noqnio1 don 't feed the troll ;)
07:04 AM noqnio1: Yeah whatever I don't even care that much
07:04 AM Emil: always lovely how the idiots call it trolling
07:04 AM Emil: From the point of view of everyone else on this channel it is you who is trolling
07:05 AM noqnio1: How can you speak about "everyone else in this channel"
07:05 AM Emil: By having been here for quite a long time
07:06 AM Emil: And having helped out a lot of people
07:06 AM renn0xtk9: noqnio1: leave it alone ;) some people need to blame other in order to feel superior. don't feed him further ;)
07:06 AM noqnio1: Do you really thing that is justified or are you just arguing right now not to back up and hurt your ego?
07:06 AM noqnio1: think*
07:06 AM Emil: holy shit at the amount of safe space retards
07:07 AM Emil: Stop enabling idiocy
07:07 AM noqnio1: hahaha stop being so edgy mate
07:07 AM noqnio1: You'll cut yourself
07:07 AM Emil: top kek
07:10 AM Emil: polprog: I also rehosted those, https://emil.fi/jako/kuvat/rtfm_mao.png and rtfm_pope.png
07:11 AM polprog: what the fuck is going on here
07:12 AM polprog: i have to scroll back two buffers to see any meritorical discussion
07:12 AM polprog: renn0xtk9: do you want to just blink a led?
07:12 AM polprog: or what
07:13 AM renn0xtk9: polprog yes
07:13 AM polprog: and where are you stuck
07:18 AM renn0xtk9: polprog essentilally trying to do that https://de.wikibooks.org/wiki/C-Programmierung_mit_AVR-GCC/_Hello_World with that make fiel https://de.wikibooks.org/wiki/C-Programmierung_mit_AVR-GCC/_Makefile I keep gettig jtagmkII bad response https://pastebin.com/hRiGsQgw
07:19 AM polprog: check dragon-avr connections
07:19 AM polprog: and remove the -b115200
07:20 AM polprog: and remove :a from -U option
07:20 AM renn0xtk9: polprog ( only difference from those webapge is I am using dragon_isp as programmer)
07:20 AM polprog: is this pastebin link your log?
07:20 AM renn0xtk9: pastebin is my log yes
07:21 AM polprog: that makefile is unnecesarily complicated
07:22 AM polprog: https://paste.debian.net/971004/
07:22 AM polprog: notice how avrdude uses short avr names in -p parameter
07:22 AM polprog: you may need to put sudo in from of avrdude
07:23 AM polprog: in front*
07:23 AM renn0xtk9: yes i am sudoing alreadu
07:23 AM polprog: look at my makefile,
07:23 AM polprog: brb
07:26 AM renn0xtk9: hmm still https://pastebin.com/9Seed2j2
07:27 AM polprog: > ISP activation failed
07:27 AM polprog: did you check the cables
07:27 AM polprog: is the avr powered
07:27 AM polprog: did you take it out of an arduino?
07:31 AM renn0xtk9: yeah pretty much trippled checked the cables
07:31 AM renn0xtk9: pretty sure it was not out of an narduino
07:31 AM polprog: hmm
07:31 AM renn0xtk9: powering throught the vcc of dragon
07:32 AM polprog: is the vtg connected
07:32 AM polprog: it's definitely something wong with the link between dragon and avr
07:32 AM renn0xtk9: yeah to vcc on the breadboard
07:32 AM renn0xtk9: let me see if I somehow find another IC
07:32 AM polprog: ok, i have to cook dinner
07:32 AM polprog: glhf
07:33 AM polprog: o/
07:47 AM polprog: \o
07:48 AM polprog: its something you need to troubleshoot. that avrdude line is most probably correct.
07:48 AM polprog: if you dont specify the -U option you can check connectivity
07:48 AM polprog: without flashing abything
07:48 AM polprog: that's what i do
07:59 AM renn0xtk9: hmm it says no device signature https://pastebin.com/hwjpLqTi
08:01 AM polprog: avrdude: Device signature = 0x000000
08:01 AM polprog: oh
08:01 AM polprog: what the hell
08:01 AM polprog: where did you get your avrs
08:01 AM polprog: ive never seen this kind of an error
08:05 AM renn0xtk9: to plug you got to follow hits don;t you http://www.atmel.com/webdoc/avrdragon/avrdragon.SCKT3200A2.html ?
08:07 AM polprog: id say, check the isp header pinout and match the pins on the atmega, connect vtg to vcc, gnd to gnd etc.
08:07 AM polprog: but that signature error...
08:07 AM polprog: no idea
08:11 AM renn0xtk9: polprog that http://www.atmel.com/webdoc/avrdragon/avrdragon.SCKT3200A2.html is the one I shoudl apply right?
08:12 AM polprog: lol that's the same link
08:12 AM polprog: no, this one: http://makerdude.com/blog/wp-content/uploads/2012/03/icsp_hookup.png
08:13 AM polprog: If you flip the dragon PCB you have the pins labeled on the other side
08:13 AM polprog: that pic doesnt show the supply voltage, which you can provide from the power header on the dragon
08:14 AM renn0xtk9: hmm yea this is what I am doing alredy
08:15 AM renn0xtk9: the device signature might come from a bad atmega or bad avr dragon
08:15 AM polprog: bad atmega imo
08:17 AM renn0xtk9: okay so after ordering a programmer i am on to order some new atmegas ^^
08:17 AM polprog: how many atmegas do you have
08:19 AM renn0xtk9: The one i just test was a fresh one
08:19 AM renn0xtk9: I have three the former one which (unlikely) could have been used a as an arduino before) the one now and another fresh
08:20 AM renn0xtk9: right I must go for a few hours
08:20 AM polprog: o/
08:20 AM Jartza: most often 0x00000000 signature means you are not supplying correct clock to the chip
08:20 AM polprog: ah so
08:20 AM polprog: probably that one was from an arduino and needs an xtal
08:21 AM Jartza: either the chip has been configured for external CLOCK and you're using crystal, or something like that
08:21 AM Jartza: or the crystal has wrong kind of caps
08:21 AM Jartza: or similar
08:22 AM Jartza: I've never seen even a clone or partly burned atmega with wrong signature, so usually the signature being zero means the chip doesn't clock well
08:22 AM noqnio1: I have a short "d", if i func(d >> 8) and then func(d), will i send both bytes consecutively?
08:22 AM polprog: dont use types like short
08:22 AM polprog: use explicit
08:22 AM polprog: and yes, as long as it's a 16 bit int
08:23 AM FL4SHK: int16_t
08:23 AM noqnio1: ty
08:23 AM FL4SHK: I say use those
08:23 AM polprog: exactly
08:23 AM FL4SHK: I tend to use those in non-embedded code also
08:23 AM polprog: that also depends on the parameter type the func uses
08:23 AM noqnio1: it takes char
08:23 AM noqnio1: but i will change it to uint8 :p
08:23 AM polprog: hmm
08:24 AM FL4SHK: char can be signed or unsigned by default
08:24 AM FL4SHK: standard doesn't tell you
08:24 AM noqnio1: int8_t is unsigned ?
08:24 AM FL4SHK: so, I say use "char" if you really want a character :P
08:24 AM FL4SHK: int8_t is signed
08:24 AM polprog: noqnio1: uint is unsigned
08:24 AM noqnio1: will it work if i ask for uint in my func?
08:24 AM polprog: yeah
08:24 AM noqnio1: <3
08:24 AM FL4SHK: uint8_t will give you an 8-bit one though
08:27 AM FL4SHK: noqnio1: you need to #include <stdint.h> btw
08:27 AM FL4SHK: if you want these types
08:27 AM polprog: just use explicit types and it's gonna be less problems :P
08:27 AM FL4SHK: I agree
08:28 AM noqnio1: cool thanks guys
08:28 AM polprog: np
08:28 AM FL4SHK: no problem
08:29 AM FL4SHK: I use the explicitly sized types in PC code too though
08:29 AM FL4SHK: Just because I like them
08:30 AM FL4SHK: in embedded system code they're almost essential
08:38 AM polprog: i have this assembly code
08:39 AM polprog: https://paste.debian.net/971010/
08:39 AM polprog: which im writing and learning assembly on it
08:40 AM polprog: and what i want it to do now, is to handle button presses
08:40 AM polprog: i know the button press detection part is ok
08:41 AM polprog: what doesnt work is that it has to execute the decrement and increment of tmp (in counter_operation) only if the current button state is pressed and the previous (loaded from ram) is unpressed
08:41 AM polprog: i tried to do some bit logic ops
08:41 AM polprog: but it failed...
08:42 AM polprog: would that work if i used whole registers like i'd use booleans in c?
10:46 AM DKordic: polprog: IIRC something like ``#define __asm__'' should make it possible to `#include' from assembly.
10:47 AM DKordic: Take a look at <avr/io.h> (I don't have it installed).
11:06 AM polprog: DKordic: i can easily read and write io registers
11:06 AM polprog: i cant implement the logic...
11:11 AM DKordic: ``ldi r27, 0x0F''?!
11:20 AM polprog: that code is halfway through rebuilding
11:21 AM polprog: that line sets the higher byte of register X so i can then load from the address 0x0F[r26]
11:22 AM polprog: look, im coding in asm for a month now...
11:23 AM polprog: i know that some of that code is awful
11:24 AM DKordic: ``ldi XL, lo(adr); ldi XH, hi(adr); ld reg, X''? You should use some directive to reserve global variable memory and declare labels.
11:26 AM polprog: what do you mean by that
11:26 AM Tom_L: .include "./tn10def.inc"
11:28 AM Tom_L: if you need an .inc file they are in a studio install directory
11:29 AM polprog: im not using atmel studio, and i cant seem to find where (if they exist) they are in avr-gcc
11:30 AM Tom_L: they aren't
11:30 AM Tom_L: if you need one i may have it
11:30 AM polprog: ok, found some on github
11:30 AM polprog: but i see they are all .equ directives...
11:31 AM polprog: i just .equ all the stuff i need on the beginning of the file
11:31 AM polprog: the program works, assembles, and runs on the target (t4313)
11:34 AM Tom_L: the studio .inc is what that line was i posted
11:34 AM Tom_L: they're all defined in it
11:34 AM polprog: i just cant find the proper algorithm that would make sure a subroutine runs only if the button IS pressed, and WAS NOT pressed,
11:34 AM polprog: i dont need the .inc files
11:34 AM polprog: but thanks for showing me that something like that exists :)
11:34 AM Tom_L: rcall
11:34 AM Tom_L: ?
11:34 AM polprog: that was a mistake too
11:34 AM polprog: let me post the new code
11:34 AM Tom_L: i'm not that good at asm
11:34 AM Tom_L: and it's been quite a while since i wrote any
11:35 AM polprog: what i wanna do is load the previously saved PINB status from sram, compare it with the current status of PINB, and run a subroutine if bit x in sram is 0 and the same bit in PINB is 1.
11:35 AM polprog: then save PINB into sram
11:36 AM polprog: and do it all over again in the next iteration
11:36 AM Tom_L: save it to a var
11:37 AM polprog: ok, i found GNU assembler docs on basic usage, it covers variables.
11:37 AM Tom_L: brne
11:37 AM polprog: that i know
11:38 AM polprog: let me try saving something to that var
11:38 AM polprog: http://www-ug.eecg.toronto.edu/msl/assembler.html
11:39 AM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/pdf/atmel/ASM_User_guide.pdf
11:39 AM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/pdf/atmel/AVR_instruction_set.pdf
11:40 AM Tom_L: you probably have those
11:40 AM polprog: i have the instruction set
11:41 AM polprog: and the user guide is for atmel studio, the directives in gas are different
11:41 AM polprog: yeah it uses .set x=y not .equ x, y
11:44 AM polprog: ok, so i can put stuff into the data section...
11:44 AM Tom_L: yup
11:45 AM polprog: now, can i change the values during runtime, or is it only for constants
11:45 AM polprog: let's checl
11:46 AM polprog: check*
11:46 AM Tom_L: make sure they are word aligned
11:46 AM polprog: .align 1
11:46 AM polprog: ?
11:46 AM polprog: looks like they are
11:46 AM Tom_L: for word
11:47 AM Tom_L: looks like default is byte aligned
11:47 AM Tom_L: so you use the .align to move word etc over
11:47 AM Tom_L: so if you had byte word byte word you probably would re'arrange them
11:48 AM Tom_L: unless the assembler does that
11:49 AM Tom_L: i think assembler is fun but i never had time to do alot of it
11:49 AM polprog: odd...
11:49 AM Tom_L: why?
11:50 AM polprog: let me make a quick paste
11:51 AM polprog: https://paste.debian.net/971031/
11:52 AM DKordic: *facepalm* Why dont You use `lds' and `sts' instructions for global variabless, like `Count'?
11:52 AM polprog: good point
11:54 AM polprog: hmm
11:55 AM Tom_L: i don't think you need .align1 on a byte
11:55 AM Tom_L: isn't that for word?
11:55 AM Tom_L: so it skips the next byte and aligns on a word boundary
11:55 AM polprog: im looking through the disassembler now
11:56 AM Tom_L: pretty sure...
11:56 AM polprog: so...
11:56 AM polprog: lds r24, something
11:57 AM polprog: changed into lds r24, 0x60 where 0x60 is definitely not where the label was put, ie where the real value is (i see it on the hexdump)
11:58 AM Tom_L: something:
11:59 AM Tom_L: .byte 0x55
11:59 AM DKordic: polprog: ?
11:59 AM polprog: yeah
11:59 AM Tom_L: is all you need i think
11:59 AM polprog: Tom_L: let me try
11:59 AM Tom_L: if it was word you would need .align1
11:59 AM Tom_L: double .align2
12:02 PM DKordic: polprog: You obviously need some Subroutine to initialize SRAM.
12:02 PM DKordic: Copy from FLASH at Power-on Reset.
12:04 PM polprog: i will now try to write a byte to an address in sram and try to read it and display it
12:04 PM polprog: yay
12:04 PM polprog: works
12:05 PM polprog: http://wklej.org/id/3198033/
12:06 PM polprog: this displays F0 on the display
12:06 PM polprog: so the SRAM read/write works
12:14 PM polprog: im using avr-gcc program.s [etc]
12:14 PM polprog: to assemble/compile my program
12:15 PM polprog: the problem is i cant use registers below r15...
12:15 PM polprog: if i use avr-as the output file is unusable
12:15 PM polprog: meaning it doesnt run
12:16 PM polprog: the output file of avr-gcc (program.o) has all the interrupt vectors defined before main
12:16 PM polprog: and runs
12:16 PM polprog: how can i use registers below r15?
12:25 PM polprog: awesome, sts/lds works
12:33 PM polprog: https://paste.debian.net/971036/
12:35 PM rue_house: hmm which registers aren't available to all instructions...
12:37 PM Tom_L: i read about that
12:38 PM rue_house: I thought it was the higher registers
12:38 PM Tom_L: iirc asm was written when there weren't as many registers and they added more so they added instructions to acomodate them
12:38 PM Tom_L: i think so
12:38 PM rue_house: the really low ones are like, stack, but, there is like 4-15 or soemthing that I used to use as general?
12:38 PM Tom_L: but i dunno for sure
12:39 PM DKordic: polprog:
12:39 PM Tom_L: if someone here knew for sure it would be nice to know
12:40 PM polprog: yeah
12:40 PM polprog: ?
12:40 PM DKordic: *facepalm* The ``i'' in, for example, `ldi' stands for ``immediate'' (part of instruction encoding). Such instructions operate on GPR 16 to 31.
12:41 PM polprog: that's possible
12:41 PM polprog: i never used load indirect
12:42 PM polprog: it's ldi everywhere
12:44 PM DKordic: I guess `avr-gcc' is invoking `avr-ld' and adding `crt'.
12:46 PM DKordic: initialization before `main' is called, like copying .bss from FLASH to SRAM.
12:47 PM polprog: wow
12:47 PM polprog: looks like it's working properly
12:47 PM Jartza: well. all the "immediate" instructions in avr only operate on r16..r31
12:47 PM polprog: TIL
01:00 PM polprog: yes! the + button is working
01:05 PM rue_shop3: +?
01:06 PM polprog: i have my experiment rasterboard with a 7 seg, a 595 and a t4313 im trying to program in bare assembly
01:06 PM polprog: right now it increments a value on leds each time i press down a pushbutton
01:11 PM rue_shop3: ok
01:11 PM rue_shop3: those are basics alright, you just started?
01:11 PM polprog: yeah, it's a month of weekend tinkering
01:11 PM polprog: so 3 weekends, and not really pushing hard
01:19 PM polprog: now the minus button works too
01:20 PM polprog: enough for today, gotta talk with the rest of the family
01:20 PM polprog: thanks for clarification of those registers
01:26 PM polprog: ..and i have everything documented in git!
01:26 PM polprog: o/
01:46 PM rue_shop3: did you get he digit decoder going yet?
02:11 PM polprog: rue_shop3: not yet, currently it's just shifting the raw byte out
02:12 PM polprog: that's for next time
02:12 PM polprog: im thnking what would be the best approach
02:15 PM JanC_ is now known as JanC
02:25 PM DKordic: polprog: Driving 7SegLED?
02:31 PM rue_house: unsigned char CG[] = {
02:31 PM rue_house: (1<<A|1<<B|1<<C|1<<D|1<<E|1<<F), /* 0 */
02:31 PM rue_house: (1<<B|1<<C), /* 1 */
02:31 PM rue_house: (1<<A|1<<B|1<<D|1<<E|1<<G), /* 2 */
02:31 PM rue_house: (1<<A|1<<B|1<<C|1<<D|1<<G), /* 3 */
02:31 PM rue_house: (1<<B|1<<C|1<<F|1<<G), /* 4 */
02:31 PM rue_house: (1<<A|1<<C|1<<D|1<<F|1<<G), /* 5 */
02:31 PM rue_house: (1<<A|1<<C|1<<D|1<<E|1<<F|1<<G), /* 6 */
02:31 PM rue_house: (1<<A|1<<B|1<<C), /* 7 */
02:31 PM rue_house: (1<<A|1<<B|1<<C|1<<D|1<<E|1<<F|1<<G),/* 8 */
02:31 PM rue_house: (1<<A|1<<B|1<<C|1<<D|1<<F|1<<G) /* 9 */
02:31 PM rue_house: };
02:32 PM rue_house: define which bit each segment is on
02:32 PM rue_house: AAAAA
02:32 PM rue_house: F B
02:32 PM rue_house: F B
02:32 PM rue_house: F B
02:32 PM rue_house: GGGGG
02:32 PM rue_house: E C
02:32 PM rue_house: E C
02:32 PM rue_house: E C
02:32 PM rue_house: DDDDD dp
02:32 PM rue_house: then its just a lookup table
02:33 PM rue_house: if you want, tell me your bit positions and I'll give you the 10 byte array
02:34 PM rue_house: wtf, why do I ahve tiny85 code? I have no tiny85's
02:35 PM Tom_L: i bet it's not the only code you've never used
02:35 PM rue_house: I usually dont write 4 programs for a processor I dont have
02:36 PM rue_house: unsigned char CG[] = {
02:36 PM rue_house: (1<<A|1<<B|1<<C|1<<D|1<<E|1<<F), /* 0 */
02:36 PM rue_house: (1<<B|1<<C), /* 1 */
02:36 PM rue_house: (1<<A|1<<B|1<<D|1<<E|1<<G), /* 2 */
02:36 PM rue_house: (1<<A|1<<B|1<<C|1<<D|1<<G), /* 3 */
02:36 PM rue_house: (1<<B|1<<C|1<<F|1<<G), /* 4 */
02:36 PM rue_house: (1<<A|1<<C|1<<D|1<<F|1<<G), /* 5 */
02:36 PM rue_house: (1<<A|1<<C|1<<D|1<<E|1<<F|1<<G), /* 6 */
02:36 PM rue_house: (1<<A|1<<B|1<<C), /* 7 */
02:36 PM rue_house: (1<<A|1<<B|1<<C|1<<D|1<<E|1<<F|1<<G),/* 8 */
02:36 PM rue_house: (1<<A|1<<B|1<<C|1<<D|1<<F|1<<G), /* 9 */
02:36 PM rue_house: (1<<A|1<<B|1<<C|1<<E|1<<F|1<<G), /* A */
02:36 PM Tom_L: rue
02:36 PM rue_house: (1<<C|1<<D|1<<E|1<<F|1<<G), /* B */
02:36 PM rue_house: (1<<A|1<<D|1<<E|1<<F), /* C */
02:36 PM Tom_L: ever hear of pastebin????
02:36 PM rue_house: (1<<B|1<<C|1<<D|1<<E|1<<G), /* D */
02:36 PM rue_house: (1<<A|1<<D|1<<E|1<<F|1<<G), /* E */
02:36 PM rue_house: (1<<A|1<<E|1<<F|1<<G), /* F */
02:36 PM rue_house: 0 /* Blank */
02:36 PM rue_house: };
02:36 PM rue_house: THATS what I was looking for
02:36 PM rue_house: yes?
02:36 PM Tom_L: i bet it's not the only code you've never used
02:36 PM rue_house: there is no call for it,t eh channel is dead
02:37 PM Tom_L: ever hear of pastebin????
02:37 PM Tom_L: ever hear of pastebin????
02:37 PM Tom_L: ever hear of pastebin????
02:37 PM Tom_L: ever hear of pastebin????
02:37 PM rue_house: dont think I would ever do that if someone where having a conversation
02:37 PM rue_house: that would be rude
02:38 PM rue_house: how is a channel dead with 178 people? like really, almost 200 lurkers?
02:38 PM rue_house: its dead now, its dead at 10pm, its dead at 1am
02:38 PM rue_house: WTF
02:38 PM polprog: lol
02:38 PM polprog: thanks
02:38 PM rue_house: :)
02:39 PM polprog: i think i was that on your site
02:39 PM polprog: i saw*
02:39 PM rue_house: yea, if you want I'll make it a hex table for ya
02:39 PM polprog: ill manage :P
02:39 PM rue_house: I should go do some welding tho
02:39 PM Tom_L: don't wear sandals
02:39 PM xentrac: you should always do some welding
02:39 PM rue_house: BUT ITS HOT AND SUNNY OUT!
02:40 PM polprog: gtg
02:40 PM xentrac: have fun
02:56 PM antto: #avr is not dead yet, despite microchip ;P~
03:04 PM enhering: antto: What comes next?
03:04 PM polprog: theres an influx of newbies
03:04 PM enhering: After AVR?
03:04 PM polprog: stm i think
03:04 PM polprog: but hey, Z80 is still not dead!
03:04 PM enhering: at subdollar prices too?
03:05 PM polprog: either in it's original form or modified as an MCU
03:05 PM polprog: i still have a book from the 80s about Z80s
03:06 PM enhering: I wonder what will the next generation of my modules be populated with. https://hackaday.io/project/11724-yauvc-yet-another-unmanned-vehicle-controller STM32f3?
03:07 PM polprog: i dont see a problem in mixing cpus
03:08 PM polprog: i think i still have two old esp modules
03:14 PM polprog: im looking at stm32
03:14 PM polprog: if it's as easy to begin as avrs
03:15 PM polprog: ie just hook up the power and a pullup to the reset and youre good to go
03:15 PM polprog: i could try it
03:22 PM polprog: its a little bit complicated
03:35 PM Tom_L: i keep my books on the 68HC11 & 68332
03:36 PM Tom_L: that was when they actually had 'books'
03:38 PM Tom_L: even been in a channel you really like and a couple ppl join and just kinda ruin it for ya?
03:38 PM Tom_L: i could /ignore but i don't do that
03:47 PM xentrac: the 68HC11 is still one of the most popular microcontrollers
03:48 PM xentrac: although it has some totally bizarre different name now
03:48 PM xentrac: the Z80, on the other hand, is kind of dead; I don't understand why
03:50 PM polprog: i fortunately never experienced people ruining cosy channels
03:51 PM polprog: is this an allusion to the last couple days here :P
03:51 PM xentrac: you can still buy Z80 MCUs but they are expensive, in large packages, and use a lot of power, at least the ones I've seen
03:52 PM xentrac: I doubt it; rue_house has been here forever
03:52 PM polprog: huh, hc11 is cisc
03:53 PM xentrac: yeah, it dates from the pre-RISC era
03:54 PM FL4SHK: It's still kind of a pre-RISC era
03:54 PM xentrac: how so?
03:54 PM FL4SHK: x86-64 is pretty common
03:54 PM FL4SHK: :P
03:56 PM xentrac: oh, yeah, but vastly outnumbered by aarch64 and arm32
03:57 PM xentrac: and even on its home ground it's being undermined by GPU instruction sets
03:57 PM FL4SHK: heh
04:00 PM Tom_L: one i had had external flash
04:00 PM Tom_L: 32k iirc
04:00 PM Tom_L: it had address lines iirc
04:00 PM Tom_L: http://home.earthlink.net/~tdickens/68hc11/docs/botboard1.pdf
04:00 PM Tom_L: there was a II board too with the ram
04:00 PM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/pdf/68hc11/bb2man6.pdf
04:00 PM Tom_L: there
04:00 PM Tom_L: still have a couple of each of those
04:03 PM Tom_L: back then, those were the 'go to' board to have
04:06 PM xentrac: I wonder if I'm confused about the 68hc11
04:07 PM Tom_L: one mask came with a debugger in it iirc
04:08 PM Tom_L: something... i can't recall just what now
04:08 PM xentrac: I think I was thinking about a different lineage of the 6800
04:09 PM Tom_L: all about the same era
04:09 PM Tom_L: after it i got some 68332 boards
04:09 PM Tom_L: those were fun
04:10 PM Tom_L: buffalo... that's what it had in it
04:10 PM xentrac: 6800 → 6805 → 68HC05 → 68HC08 → 68HCS08 → 9S08 was what I was thinking about
04:11 PM xentrac: the line 9S08 is still a going concern
04:13 PM xentrac: there's also a "reduced" RS08 line
04:17 PM Tom_L: http://www.dee.ufrj.br/microproc/HC11/68hc11ur.pdf
04:17 PM xentrac: Digi-Key says: HC08, 676 parts; HC11, 36 parts; HCS12, 459 parts; S08, 998 parts; RS08, 49 parts
04:19 PM xentrac: their 5th and 6th most-in-stock parts are S08s in factg
04:19 PM xentrac: oh I guess they're the same part: https://www.digikey.com/product-detail/en/nxp-usa-inc/S9S08SG16E1CTLR/S9S08SG16E1CTLRCT-ND/2252300
04:21 PM xentrac: I don't know how similar programming an S08 is to programming an HC11 but I imagine it's pretty similar
04:25 PM xentrac: have you tried it, Tom_L?
06:06 PM Tom_L: no i haven't
06:09 PM day is now known as daey
06:37 PM hetii: Hi :)
06:37 PM hetii: Is it hard to emulate sd-card? My idea is to gram mp3 decoder like GPD2856C and instead sd-card use spi interface to push mp3 stream?
06:37 PM Emil: you mean like
06:37 PM Emil: You connect a device which looks like a low capacity drive
06:37 PM Emil: and when you upload a file there
06:38 PM Emil: it either streams that directly or takes it in and then outputs an mp3 stream?
06:38 PM Emil: Anycase
06:38 PM Emil: to answer the question
06:38 PM Emil: it is not hard to emulate an sd-card, per se
06:39 PM hetii: my idea was to use esp8266 and grap radio shoutcast and push it via spi to this IC but not sure what else need to be added, probably some initial header data responsible for fat io operation.
06:40 PM Emil: whatcha need an sd-card interface then for?
06:41 PM hetii: this Ic can read data from usb or via sd-card interface
06:41 PM Emil: ah yeah
06:41 PM Emil: then its easy
06:41 PM Emil: keep in mind that the sd-card interface is "propietary"
06:42 PM Emil: documentation is available but officially you'd have to "buy it"
06:42 PM Emil: that's for the full sd-card interface
06:42 PM hetii: well its just for fun:)
06:42 PM Emil: the simple one is super easy
06:43 PM hetii: based on this datasheet: http://www.datasheetbay.com/pdf/949394/GPD2856A.html it seams that only 3 line of data from sd-card are used
06:44 PM hetii: so I assume its just SPI mode communication
06:44 PM xentrac: hetii: the SD card is requierd to support SPI and also nybble-parallel communication
06:45 PM xentrac: if you're making an SD card, you have to support whichever one the device that's accessing it is looking for
06:46 PM xentrac: I think the full SD card interface is now published but you have to buy it in order to claim that you comply with it
06:46 PM hetii: yep I know the question is more about GPD2856A and it with mode it talk to sd-card
06:46 PM xentrac: but if you just want your hardware to work, I think the information is available
06:46 PM xentrac: yeah,I Idon't know how the GPD2856C or GPD2856A access their SD cards
06:48 PM Emil: Ah
06:48 PM Emil: Nice
06:48 PM hetii: ok I will use logic analizer and try spy what going on between this module and sdcard and then try simulate the same communication without sd-card
06:49 PM Emil: But
06:49 PM Emil: wel
06:49 PM Emil: you can scope out the format (which is highly likely the spi one)
06:49 PM Emil: But otherwise why reverse the entire protocol when you can just look it up online? :D
06:50 PM hetii: ok maybe its a good point to start from that :)
06:57 PM hetii: http://elm-chan.org/docs/mmc/mmc_e.html
06:58 PM xentrac: oh nice, if you have a logic analyzer this should be a cinch
06:59 PM xentrac: what do you use to decode the captured data, sigrok PulseView?
07:00 PM hetii: yep
09:20 PM _ami_: sleeping with lower cpu speed would save more power?
09:21 PM _ami_: clock_prescale_set(clock_div_256); ... sleep_mode(); vs just ... sleep_mode(); without slowing CPU down
09:22 PM kre10s: Yes. power consumption is typically given per Mhz
09:22 PM kre10s: although I don't think changing the prescaler would cut it. you would need to change the crystal.
09:23 PM _ami_: kre10s, yeah, i wanted to know abt the use clock_prescale_set(clock_div_256); acually saves some power or not.
09:25 PM _ami_: http://www.nongnu.org/avr-libc/user-manual/group__avr__power.html :-> Some of the newer AVRs contain a System Clock Prescale Register (CLKPR) that allows you to decrease the system clock frequency and the power consumption when the need for processing power is low
09:27 PM kre10s: My guess is that if the divided clock is used to run the IOs in sleep mode, then those IOs will consume less power than if they were run at full speed.
09:42 PM _ami_: kre10s, yes, i get the point now. its more useful when mcu is doing something and FAST cpu speed is not required.
11:56 PM day__ is now known as daey