#avr Logs

Feb 25 2018

#avr Calendar

02:01 AM pro_z_ is now known as pro_z
04:07 AM erossi_ is now known as erossi
04:31 AM z999: hello
04:32 AM antto: hai
04:38 AM zerox2a is now known as Guest52651
04:50 AM z999: hi can someone help me with this please? https://pastebin.com/2CgiPe1D
04:50 AM z999: iam trying to follow instructions
04:50 AM z999: <-----------------beginner
04:50 AM z999: asm
04:53 AM antto: asm :~(
05:03 AM polprog: asm!
05:04 AM polprog: so
05:05 AM polprog: you should see here the equivalent of setup() and loop()
05:05 AM polprog: do you?
05:11 AM z999: polprog dont know
05:11 AM z999: what did i do wrong
05:12 AM z999: was i suppose to do a constant?
05:12 AM polprog: you dont need to set DDR every time
05:12 AM z999: oh
05:12 AM z999: i thought it was required when changing ports
05:12 AM polprog: no, its stays unchabed
05:12 AM polprog: unchanged*
05:12 AM z999: so just do it once?
05:13 AM polprog: yea
05:13 AM polprog: and you can load 0xFF to a register and "use" that value several times
05:14 AM polprog: so, ldi r16, 0xFF out ddrd, r16 out ddrc, r16 out ddrd, r16
05:14 AM z999: so how do you suggest i write the code?
05:15 AM polprog: [set DDRs] loop: [set all ports to 0x55] call delay [set all ports to 0xAA] rjmp loop
05:15 AM polprog: do you understand why?
05:15 AM polprog: can you see the part that loops and the part that executes only once?
05:20 AM z999: no polprog, please explain if you can
05:20 AM polprog: to output some value to a PORT, you need to set it's DDR first, to make the port an output
05:21 AM polprog: or to be precise, the pins you want to be output
05:21 AM polprog: right?
05:21 AM z999: https://pastebin.com/sinBcdaF
05:21 AM z999: is that right?
05:22 AM z999: yes polprog that is right
05:22 AM polprog: okay, that code looks better now
05:22 AM z999: how do i write the end?
05:22 AM polprog: look at it closely and try to follow how it works
05:22 AM z999: jump here?
05:22 AM polprog: you dont have "here" defined
05:23 AM z999: rjump here?
05:23 AM z999: rjmp: here?
05:23 AM polprog: still, same problem
05:23 AM polprog: look at lines 11-14
05:24 AM z999: yes
05:24 AM z999: what did i do wrong?
05:24 AM polprog: so you load 0x55 to r16, call some delay function (i assume its somewhere there)
05:24 AM polprog: the load 0xAA to r16
05:25 AM polprog: the output that 0xAA to PORTs B, C, and D
05:25 AM polprog: thats close to what you want
05:26 AM polprog: do you know what a label is in assembly?
05:26 AM z999: oh i had to label it too?
05:26 AM polprog: you need to put a label to be able to jump to it
05:27 AM polprog: you have a label in that code
05:27 AM z999: but is everything else is right? besides the label part??
05:27 AM nuxil: z999, look up Abelardo Pardo
05:27 AM nuxil: on youtube. he got some avr asm tutorials :)
05:27 AM polprog: not exactly
05:27 AM polprog: "start:" at line 5 is a label
05:28 AM polprog: you need to define another label on the beginning of your loop
05:29 AM z999: yes still ocming up with errors
05:30 AM z999: like in the first line?
05:30 AM polprog: yeah, for example "loop:" in line 12
05:30 AM polprog: and then at the end of the loop, "rjmp loop"
05:30 AM polprog: thats it
05:31 AM polprog: then you will have to slightly fix the loop contents
05:31 AM z999: which one is line 12?
05:31 AM z999: saids it wont recognize call delay
05:31 AM polprog: do you actually single step the program in the simulator?
05:31 AM z999: i a m building and it has errors
05:31 AM polprog: that means you dont have the delay call defined
05:33 AM z999: so how do you suggest i fix it?
05:34 AM polprog: define a delay subroutine?
05:34 AM polprog: write* not define
05:39 AM z999: so how do i write the delay?
05:39 AM z999: call delay
05:39 AM z999: ret
05:39 AM polprog: ret goes inside
05:39 AM polprog: i dont know what kind of a delay you want
05:40 AM z999: i just want the script to work
05:40 AM polprog: well
05:40 AM z999: i want to follow the instructions
05:40 AM polprog: somewhere later in the code
05:40 AM polprog: delay:
05:40 AM polprog: nop
05:40 AM polprog: ret
05:40 AM z999: in the middle or toward the end?
05:40 AM polprog: thats gonna be a couple cycles delay...
05:40 AM polprog: not in the middle
05:41 AM z999: i label it l1: call delay
05:41 AM z999: or before the call delay line?
05:41 AM polprog: anywhere. just not in the middle of your main code
05:41 AM polprog: do you understand how assembly executes the operations?
05:41 AM z999: l1 is in the beginning then?
05:41 AM z999: the label l1?
05:42 AM polprog: did you take the delau from the generator site?
05:43 AM z999: the call delay is in the middle
05:43 AM z999: i am not sure how to define the delay to get the code to work
05:44 AM polprog: do you have any handbook there, wherever you are studying?
05:44 AM z999: yes
05:44 AM polprog: that should be in there if the proffesor needs you to know thus
05:44 AM polprog: this*
05:45 AM z999: ok so you are going to make me look in the book. which will take me hours to figure this out.
05:45 AM z999: ok
05:45 AM z999: i get it
05:45 AM polprog: a subroutine in assembly is defined as a label, then some code, then the "ret" instruction
05:46 AM polprog: how much time it will take you depends on the book really...
05:52 AM z999: i'll wait for someone else that can help me better
05:52 AM z999: thanks anyways
05:53 AM polprog: why dont you look into the book, honestly
05:53 AM z999: i did
05:53 AM z999: i don't see it!
05:54 AM z999: i don't know where to look for it
05:54 AM z999: i dont know what code to use or how to use it
05:54 AM polprog: whats the book about
05:55 AM z999: the av microcontroller and embedded systems using assembly and c
05:55 AM z999: by muhammad ali mazidi
05:55 AM z999: second editio
05:56 AM polprog: http://www.avr-tutorials.com/assembly/avr-assembler-directives
05:56 AM polprog: http://www.avr-tutorials.com/assembly/writing-assembly-subroutines-avr-microcontroller
05:58 AM _ami_: z999: https://www.amazon.com/Some-Assembly-Required-Programming-Microcontroller/dp/1439820643
05:58 AM _ami_: i find this book excellent
05:58 AM _ami_: for learning AVR asm.
06:00 AM polprog: z999: that book of yours doesnt look too badon the fist sight
06:00 AM z999: i'll wait for someone else
06:01 AM z999: maybe later someone else that is more helpful that can explain better to a beginner
06:01 AM polprog: http://teacher.buet.ac.bd/lutfulkabir/ICT6641_April2011/AVR%20Microcontroller%20and%20Embedded%20Systems_vol_1.pdf
06:01 AM polprog: chapters 2 and 3.
06:01 AM polprog: is that the book you have?
06:02 AM _ami_: not everybody likes to write code in asm. also its hard to remember asm syntax.
06:02 AM z999: i have second edition yes the books shoul be similar
06:03 AM _ami_: and life is short! :)
06:03 AM polprog: oh sorry. that pdf is not the whole book
06:03 AM polprog: oops
09:49 AM z999: anybody here?
10:11 AM z999: do think this is completing the assignment? https://pastebin.com/DCKBM5f2
10:11 AM z999: it did build
10:17 AM Tom_L: if you tested it like the directions say you should know
10:18 AM Tom_L: it's supposed to flip every other bit
10:19 AM Tom_L: and tell your teacher to be careful twiddling with PORTC unless he knows where the reset pin is
10:21 AM Tom_L: http://ww1.microchip.com/downloads/en/DeviceDoc/doc7799.pdf
10:21 AM Tom_L: take a look at PORTC PC1
10:25 AM Emil: Tom_L: bro
10:25 AM Emil: If we are talking about normal avrs
10:25 AM Emil: there's nothing to be carefula bout when twiddling PORTC if reset is there
10:25 AM Emil: careful about*
10:26 AM Emil: it won't affect the operation one bit
10:26 AM Tom_L: it will reset the chip
10:26 AM Emil: No
10:26 AM Emil: it will not
10:26 AM Tom_L: i speak from experience
10:27 AM Emil: Naw
10:27 AM Emil: I think you had some fluke
10:27 AM Tom_L: have you tried it?
10:27 AM Emil: Yes
10:28 AM z999: i am doing it wrong
10:28 AM Tom_L: i've tried it on multiple U2 chips
10:28 AM z999: i cant stand this
10:28 AM Emil: Tom_L: https://emil.fi/d/2018-02-25_18-27-46_v0a214HO.png
10:28 AM Tom_L: most (older) chips didn't bring that pin out anyway
10:28 AM Emil: Straight from the datasheet
10:30 AM Tom_L: that just backs up what i said
10:30 AM Emil: no
10:30 AM Emil: it does not
10:30 AM Tom_L: A low level on this pin ..... will generate a reset even if the clock is not running.
10:30 AM Emil: ah
10:30 AM Emil: I see where the confusion arose from
10:31 AM Emil: You meant external twidling
10:31 AM Emil: While I understood twiddling as twiddling in code
10:31 AM Tom_L: you can do it in code as well
10:31 AM Emil: no
10:31 AM Emil: you can not
10:34 AM Emil: But hmm, it's good that I took a look at the doc. Apparently the device can stay attached to the usb on usb reset
10:35 AM Emil: So one could do firmware flashing without the annoying plugin/out events
10:36 AM Tom_L: those you would just program via USB
10:36 AM Tom_L: using flip or dfu
10:40 AM Emil: Exactly
10:40 AM Emil: point is that as of now most reprogramming events result in unplug plug events on the host
10:44 AM feep: hi, I'm trying to flash a bootloader for my cr-10 3d printer which has an atmega1284p chip
10:45 AM Emil: Alrighty, what's the issue?
10:45 AM feep: I got the optiboot_atmega1284p.hex from the arduino distro
10:45 AM feep: put it on my octoprint rpi which is connected to the cr-10 via gpio
10:45 AM feep: flashed it using sudo avrdude -p atmega1284p -C ~/avrdude_gpio.conf -c pi_1 -v -U flash:w:optiboot_atmega1284p.hex:i
10:45 AM feep: which completed fine
10:46 AM feep: but when I switch the cr10 to usb power and try to flash the actual firmware using ttyUSB0, I get avrdude: stk500_recv(): programmer is not responding
10:46 AM Emil: well
10:46 AM Emil: are you connected to the serial lines?
10:46 AM feep: this method works fine to flash the actual *firmware*, mind.
10:46 AM feep: I just can't get optiboot to work.
10:46 AM Emil: bro
10:47 AM curlyears: yes, there *IS* a #avr. I hope someof yu will be able to assist feep in his issue. %Thanks you guys
10:47 AM Emil: to flash the bootloader you are connected to the SPI pisn
10:47 AM feep: Emil: yes, again, the actual flashing works fine
10:47 AM Emil: are you connected to the serial pins
10:47 AM feep: I can flash the firmware that way, and it'll install properly
10:47 AM feep: so I assume yes
10:47 AM Emil: feep: mate no
10:47 AM Emil: stop
10:47 AM feep: avrdude will be like avrdude: 131072 bytes of flash verified
10:47 AM Emil: serial programming is different from isp programming
10:48 AM feep: kay idk then
10:48 AM Emil: you need a usb to serial converter
10:48 AM Emil: if your cr-10 has a usb port that is normally used to it then connect throug that
10:48 AM feep: nono, I'm trying to get the cr10 to the point where I can flash it via its actual usb port.
10:49 AM Emil: feep: you are at that point.
10:49 AM Emil: after flashing optiboot you then update through the usb port
10:49 AM feep: right, but if I unplug 3.3v and switch to usb power, avrdude cannot see the board.
10:49 AM Emil: ...
10:50 AM feep: that is sudo avrdude -p atmega1284p -c arduino -P /dev/ttyUSB0 -b 57600 -v
10:50 AM Emil: the speed is probably 115200
10:50 AM Emil: instead of 57600
10:50 AM feep: oh, slower speed doesn't work?
10:50 AM feep: kay
10:50 AM feep: trying
10:51 AM feep: hooo!
10:51 AM feep: yep!
10:51 AM feep: now it sees it
10:51 AM Emil: also your device might be anything /dev/ttyUSBN instead of 0
10:52 AM Emil: Anycase there you go
10:52 AM feep: thanks a bunch!~
10:52 AM Emil: np
10:53 AM feep: hm
10:53 AM feep: okay, so I presume I have to flash the marlin image without bootloader, while passing -D?
10:53 AM Emil: -D?
10:53 AM Emil: Whatcha need -D for
10:53 AM feep: avoid deleting the flash
10:53 AM feep: so I don't flatten right over the bootloader
10:53 AM Emil: NO
10:53 AM Emil: Stop
10:53 AM Emil: mate
10:53 AM feep: kay
10:54 AM Emil: you don't understand
10:54 AM Emil: you cannot write over the bootloader through itself
10:54 AM feep: oooh
10:54 AM feep: OH!
10:54 AM feep: so this tutorial I followed originally is wrong when it tells me to flash the image via gpio?
10:54 AM Emil: no
10:55 AM Emil: if you don't need the bootloader you can write the image via gpio just fine
10:55 AM feep: ... this tutorial was supposed to install a bootloader :p
10:55 AM feep: it literally goes "flash bootloader via gpio, flash image via gpio"
10:55 AM Emil: so umm
10:55 AM Emil: that literally overwrites the bootloader
10:55 AM feep: which in retrospect seems wrong
10:55 AM feep: yeeaaaap
10:55 AM feep: wonderful :D
10:56 AM Emil: -D tells avrdude to not erase the rest of the flash
10:56 AM feep: sudo avrdude -p atmega1284p -c arduino -P /dev/ttyUSB0 -b 115200 -U Marlin.ino.sanguino.hex
10:56 AM feep: trying~
10:56 AM Emil: no
10:56 AM feep: kay, not trying
10:56 AM Emil: -U flash:w:firmare:i
10:56 AM feep: owait! yeah, wrong memory spec
10:56 AM Emil: where firmware is Marlin.ino.s...
10:56 AM feep: -U flash:w:Marlin.ino.sanguino.hex:w*
10:57 AM feep: :i*
10:57 AM Emil: yes
10:57 AM feep: here goes!
10:57 AM feep: eee it's writing
10:58 AM Emil: feep: good :)
10:59 AM feep: validated <3
10:59 AM * feep mails the tutorial guy to correct
11:00 AM nn77 is now known as nn7
11:01 AM Emil: feep: you might also want to reupload with -e
11:01 AM Emil: but that's not strictly necessary
11:01 AM feep: -e?
11:01 AM Emil: if you store configuration data in eeprom and don't want it erased then don't use -e
11:01 AM Emil: but otherwise you pretty much always want -e
11:01 AM feep: oyeah, no, since I'm upgrading version that's probably wise
11:01 AM * feep reruns
11:01 AM Emil: feep: it erases chip content
11:02 AM Emil: before reprogramming
11:02 AM feep: so done
11:02 AM * feep puts the screws back in~
11:03 AM Emil: feep: which channel did you and curlyears come from btw?
11:04 AM Emil: Just interested
11:09 AM feep: #reprap~
11:13 AM feep: man, whew
11:13 AM feep: I *almost* forgot setting the power jumper back to vreg
11:13 AM feep: that'dve fried the board :D
11:16 AM Tom_L: how did i guess that :)
11:16 AM Tom_L: #reprap
11:18 AM Emil: feep: shit design if it would have done that :D
11:18 AM feep: well yeah
11:18 AM Emil: but that's not your fault (probabably)
11:18 AM Emil: probably*
11:19 AM feep: I'm just happy that it doesn't route its 100W heater over the mainboard
11:19 AM Emil: :DD
11:19 AM feep: there have literally been actual houses that burnt down due to shitty printers that did that
11:21 AM Emil: Yeah so I've heard
11:22 AM feep: kay, jumper reset
11:22 AM * feep closes it up again
11:37 AM chat is now known as Guest32622
12:20 PM chat is now known as Guest16356
01:34 PM nohit: nuxil do you wanna see what we got done in 48hours ?
01:47 PM nuxil: nohit, sure
01:49 PM nohit: http://dancingclown.tech/alakajam2018/
01:49 PM nuxil: So i bricked my beautiful M324P chip :(
01:50 PM nuxil: who has a hvpp for sale that does dip 40 :D ?
01:51 PM nuxil: nohit, i get a blue screen with music
01:52 PM nohit: what browser ?
01:52 PM nuxil: chrom
01:52 PM Tom_itx: dragon does
01:53 PM Tom_itx: cheaper to get another chip\
01:53 PM nohit: i have tested with chrome and firefox, works with both
01:53 PM nuxil: Tom_itx, yea, but it might be handy to have,
01:54 PM Tom_itx: i used that feature _once_ and decided all those wires were hardly worth it
01:54 PM nuxil: nohit, https://gyazo.com/9c0481552e85a229c72058f177315baa
01:54 PM nohit: strange
01:55 PM nuxil: well im glash i got a m324p spare. i nevre order just 1 chip. :D
01:55 PM nuxil: *glad
01:55 PM Tom_itx: yep, always buy in pairs
01:56 PM nohit: i can send you a stk500
01:56 PM nohit: i have 3 of them
01:56 PM Tom_itx: does stk500 do hvpp?
01:57 PM nohit: yes
01:57 PM nuxil: oh.
01:57 PM nohit: iirc havent used them in years
01:58 PM nuxil: yes send me one :p how much $ you want :p
01:58 PM nohit: nothing, i got them for free
01:58 PM nuxil: nice.
02:05 PM nuxil: nohit, lol, worksed in Edge :)
02:06 PM nohit: heh
02:07 PM nuxil: i found a bug :D
02:07 PM nuxil: https://gyazo.com/8f5d78ce4b2dc848c9f6c152b609cc75 you can "walk" in the middle of the bar/plank or whatever it is.
02:13 PM nohit: yes that's a bug we didnt have time to fix
04:06 PM deshipu: Hi, I'm trying to build one of the LUFA demos, the docs at http://fourwalledcubicle.com/files/LUFA/Doc/170418/html/_page__compiling_apps.html#Sec_CompilingApps_Compiling say that I shuould get a .HEX file, but all I get from 'make all' is an .elf file. How do I get a hex file?
04:37 PM antto: deshipu newer avrdude can read elf
04:37 PM antto: or you can "extract" areas from the elf and write them as ihex via some of the tools included in the compiler
04:38 PM antto: avr-objcopy
04:38 PM deshipu: avr-objcopy -j .text -j .data -O ihex VirtualSerial.elf VirtualSerial.hex
04:38 PM deshipu: I did this
04:38 PM deshipu: and it seems it worked
04:38 PM deshipu: but I wonder why the docs are wrong
04:39 PM deshipu: is LUFA still maintained?
04:40 PM deshipu: or should I be using something else?
04:40 PM Tom_itx: i dunno, dean still frequents here
04:40 PM antto: could it be an older version of avrgcc spewing .hex directly?
04:41 PM antto: because the very first avr stuff i did, i don't remember having any elfs ;P~
04:41 PM antto: and i think it was using the winavr2010 avrgcc
04:43 PM deshipu: I see, makes sense, thanks
04:43 PM antto: no, i'm not sure about this
04:43 PM deshipu: I wonder why none of the VirtualSerial examples is receiving any data, they are only sending
04:44 PM antto: could it be flow-control related?
04:47 PM Tom_itx: i may have gotten elfs but i got hex too
04:47 PM Tom_itx: i don't remember now
04:47 PM nuxil: elf's ?
04:47 PM nuxil: i get elfs all the time :p
04:47 PM Tom_itx: elf files
04:48 PM Tom_itx: dip
04:49 PM nuxil: for my current project it creates files as, eep, elf, hex, lss, lst, map, sym :)
04:49 PM Tom_itx: yeah, i deleted most of those
04:50 PM antto: <idontbelieveyou.gif>
04:50 PM Tom_itx: true story
04:50 PM Tom_itx: nobody lies on the interweb
04:50 PM Tom_itx: antto, you gain elfs the more you play the game
04:51 PM Tom_itx: you just haven't played it long enough
04:51 PM antto: i don't think i play any games with elfs
04:51 PM nuxil: antto, <nowuyoubeliveme. https://i.gyazo.com/c74abe43540b764c9542b3fa42ef71de.png > :p
04:51 PM antto: nuxil i see a Makefile
04:52 PM nuxil: yea
04:52 PM antto: okay, i can "ls" my build folder and you'll see a .syx file
04:52 PM antto: that doesn't mean avrgcc outputs midi sysex files, ya know
04:53 PM nuxil: you want the makefile?
04:53 PM antto: no, pls
04:53 PM nuxil: :p
04:53 PM antto: i don't speak Makefiles x_x
04:54 PM antto: maybe check your files by date, and the .elf will be slightly older than the other files ;P~
04:56 PM nuxil: emm why? https://i.gyazo.com/af96c615881579b7c9e19a7dbde92742.png
04:59 PM antto: cuz of that thing at the end
05:03 PM nuxil: anytime you include avr/io.h it will generate a elf file afik.
05:03 PM nuxil: https://www.nongnu.org/avr-libc/user-manual/group__avr__fuse.html
05:09 PM deshipu: avr-objdump: section '.fuse' mentioned in a -j option, but not found in any input file
05:09 PM deshipu: doesn't seem like it's included then
05:10 PM antto: nuxil waaat?
05:10 PM antto: where did you read that?
05:11 PM antto: and how often do you write any sort of program for an avr chip without including avr/io.h?
05:19 PM nuxil: sorry i assumed that, its obiouse that its donr by gcc "avr-gcc -g -mmcu=atmega324 -o foo.elf foo.o"
05:45 PM z999: hi can anyone tell me if this is right. https://pastebin.com/hFZydrZh
05:46 PM Tom_itx: again?
05:46 PM z999: Tom_itx i havent resolved it
05:46 PM z999: still working on it
05:46 PM Tom_itx: what does it do when you step thru the program?
05:48 PM z999: where am i suppose to look?
05:48 PM z999: registers?
05:48 PM z999: memories?
05:49 PM Tom_itx: Then using the simulator, single-step through the program and examine the ports.
05:49 PM z999: i know the parts
05:49 PM z999: but you mentioned before it is suppose to change somewhere
05:49 PM Tom_itx: PORTB, PORTC, PORTD
05:49 PM z999: is it in registars
05:49 PM z999: or the memory
05:49 PM z999: where is that?
05:51 PM Tom_itx: #define PORTB _SFR_IO8(0x18)
05:51 PM Tom_itx: #define PORTC _SFR_IO8(0x15)
05:51 PM Tom_itx: #define PORTD _SFR_IO8(0x12)
05:51 PM z999: my question is in which window will it show about the port
05:51 PM Tom_itx: memory locations defined in the device io.h
05:51 PM z999: ports
05:51 PM Tom_itx: i don't know what software you're using
05:52 PM Tom_itx: i haven't used studio since ver 4 or 5
05:52 PM z999: amtel studio 7
05:52 PM Tom_itx: used to be on the right side
05:52 PM Tom_itx: open a window to view them
06:00 PM z999: n not working
06:00 PM z999: the values doesnt go to the other ports
06:00 PM nuxil: atmel uses .def iirc
06:00 PM z999: just portb
06:00 PM nuxil: #define is gcc
06:03 PM nuxil: z999, your task is to set port to value X, delay a bit then set a new value on the ports ?
06:03 PM z999: yes
06:05 PM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/avr/blinkled/asm/delay/led_blink_delay.asm
06:06 PM Tom_itx: look that over a bit but don't copy it
06:06 PM Tom_itx: do your own work
06:07 PM Tom_itx: you need different flip values than FF anyway
06:07 PM Tom_itx: every other bit flips on yours
06:11 PM Tom_itx: http://tom-itx.no-ip.biz:81/~webpage/avr/blinkled/asm/interrupt/led_blink_int.asm
06:11 PM Tom_itx: if you want a delay using interrupts instead
06:11 PM Tom_itx: (maybe you'll get extra credit :D)
06:12 PM Tom_itx: but hopefully you'll just learn something
06:12 PM z999: Tom_itx thanks but i have to figure it out
06:12 PM z999: i have to understand the instructions you wrote
06:12 PM Tom_itx: i know that
06:12 PM z999: i am beginner
06:12 PM Tom_itx: i realize that also
06:12 PM z999: thanks
06:13 PM Tom_itx: it's got good comments
06:13 PM z999: i'll repost what i have until i get it right
06:14 PM nuxil: haha that my girl. be presistant :p
06:15 PM Tom_itx: we've all had help at one point
06:27 PM nuxil: z999, if you need a timer of set time. you need to do some calulations.
06:27 PM nuxil: *delay of set time
06:27 PM nuxil: 1st of you need to know cpu freq.
06:28 PM nuxil: then calulate how much time 1 cycle does. 1/cpu freq.
06:31 PM Tom_itx: the instructions don't care how long the delay is
06:32 PM Tom_itx: https://pastebin.com/hFZydrZh
06:32 PM Tom_itx: i don't remember how you step over code in studio do you?
06:32 PM Tom_itx: he'll need to figure that out too
06:32 PM nuxil: what is sph ?
06:33 PM Tom_itx: good q
06:33 PM nuxil: stack pointer high ?
06:33 PM Tom_itx: high and low
06:33 PM Tom_itx: yes i bet
06:35 PM Tom_itx: why's the .ORG 0x300 in there?
06:35 PM Tom_itx: don't think he needs that either
06:36 PM nuxil: he is a she iirc :)
06:36 PM Tom_itx: oh
06:36 PM Tom_itx: hard to tell from z999 :D
06:36 PM Tom_itx: we weren't formally introduced
06:36 PM nuxil: but hey. its internett. maybe "he" just said that to get nerdy geeks to help :p
06:37 PM Tom_itx: i would help no matter
06:37 PM Tom_itx: it's all in the approach
06:37 PM Tom_itx: hey dude do my homework....
06:37 PM Tom_itx: take a hike
06:37 PM nuxil: ^^
06:37 PM Tom_itx: gotta run
06:38 PM Tom_itx is now known as Tom_L
06:43 PM z999: i am really am a girl
06:43 PM z999: and yes need help
06:44 PM z999: oh he is gone :(
06:47 PM nuxil: errors ?
06:51 PM z999: i dont understand the comments
06:51 PM z999: it is too advanced
06:52 PM nuxil: this better to understand ? https://pastebin.com/5bERW8Pu
06:52 PM nuxil: just to give you idea
06:54 PM nuxil: i write in gcc style. so adapt for atmel.
06:54 PM z999: yes...i can change it
06:54 PM z999: i will see if it works
06:54 PM z999: thanks
06:57 PM z999: the function delay is in the beginning?
06:57 PM z999: sholdnt it be at the end
06:58 PM nuxil: its a function
06:59 PM nuxil: it need to be called. so where it is should not matter. as long as the asmebler knows about it.
07:13 PM Tom_L: no, i'm always here just away
07:15 PM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/pdf/atmel/AVR_instruction_set.pdf
07:15 PM Tom_L: z999, there's the asm instruction set if you wanna look for something
07:16 PM nuxil: also check out Abelardo Pardo on youtube. he got some tutorials on avr & asm
07:16 PM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/pdf/atmel/ASM_User_guide.pdf
07:16 PM Tom_L: and an old user guide
07:32 PM z999: ok tom
07:35 PM z999: nuxil you left out 0x55
07:35 PM z999: i am not sure where to fit it in
07:37 PM Tom_L: in my example?
07:37 PM Tom_L: the FF flips all the bits
07:37 PM z999: https://pastebin.com/090KbVpP
07:37 PM Tom_L: you would put it in place of it
07:38 PM z999: oh i see
07:38 PM Tom_L: because you're flipping every other bit instead of all at once
07:38 PM Tom_L: look at the binary value for 55 and you'll see that
07:39 PM z999: um.....func is not recognized
07:39 PM z999: invalid directive .func
07:41 PM Tom_L: just call it delay:
07:41 PM Tom_L: lose the .
07:42 PM Tom_L: then add a label to the main part
07:42 PM Tom_L: like 'main:'
07:45 PM Tom_L: #define is a c directive, use .def instead
07:50 PM z999: .end func?
07:51 PM z999: what is the correct syntax for that
07:52 PM Tom_L: you don't need it, just use a different label to start the next function or loop to avoid the asm being executed below it
07:53 PM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/avr/blinkled/asm/delay/led_blink_delay.asm
07:53 PM Tom_L: look at the ends of each of those functions
07:54 PM Tom_L: some jump some don't
07:54 PM z999: unexpected register expecting =
07:54 PM z999: .def CPU_TICK= 1 / CPU_FRQ
07:54 PM Tom_L: so from main: it will go on and execute loop: because there is nothing to stop it
07:55 PM z999: i am getting an error on that line i posted though
07:56 PM Tom_L: try ; for a comment instead of /
07:57 PM z999: Severity Code Description Project File Line
07:57 PM z999: Error syntax error, unexpected REGISTER, expecting '='
08:00 PM z999: i did the ; and i am still getting an error
08:00 PM z999: same error
08:00 PM Tom_L: what are you trying to do there?
08:00 PM Tom_L: and why?
08:00 PM z999: i'll just paste bin again so you can see
08:00 PM z999: i am trying to build it
08:01 PM z999: and i am getting errors
08:01 PM z999: the same freaking activity been doing all day
08:01 PM Tom_L: your first paste wasn't that far off
08:01 PM Tom_L: asm is fun :D
08:01 PM Tom_L: but i'm quite rusty, haven't done much for a few years
08:02 PM z999: https://pastebin.com/RMDBXT86
08:03 PM z999: well how can i fix it if i am getting an error on that line
08:03 PM z999: maybe an equal sign does not belong there
08:04 PM z999: stuck stuck stuck
08:04 PM z999: can't move
08:05 PM z999: in the book it states .include
08:05 PM z999: maybe .def is not used in asm
08:05 PM Tom_L: different assemblers vary
08:05 PM Tom_L: maybe so
08:06 PM Tom_L: .include will include another file
08:06 PM Tom_L: .def will define a token or variable
08:06 PM Tom_L: they are not the same
08:08 PM z999: it is not working
08:08 PM z999: omething is wrong with syntax
08:09 PM Tom_L: are you using studio?
08:09 PM z999: yes
08:09 PM Tom_L: 7?
08:10 PM z999: line 5
08:10 PM z999: yes amtel studio 7
08:11 PM Tom_L: it's probably the line above it
08:11 PM Tom_L: .def somevalue r18; .def somevalue = r18
08:12 PM z999: error
08:13 PM Tom_L: what avr are you programming for?
08:13 PM z999: tassembly
08:13 PM z999: assembly
08:13 PM z999: those two lines have errors
08:14 PM Tom_L: what chip are you programming for?
08:14 PM z999: atmega328
08:14 PM z999: atmega328p
08:14 PM Tom_L: it would be helpful for you to include it's io.inc file
08:14 PM Tom_L: it has definitions for all the chip characteristics in it
08:14 PM Tom_L: so lets start from the top
08:15 PM Tom_L: .include "m328def.inc"
08:15 PM Tom_L: then all your registers and ports are defined for you
08:15 PM z999: delete .def
08:15 PM Tom_L: if you search the studio directory you should find that file somewhere
08:15 PM Tom_L: it's buried
08:16 PM z999: do i delete both .def lines?
08:16 PM Tom_L: for now just put a ; in front of them
08:16 PM Tom_L: to comment them out
08:17 PM z999: more errors
08:17 PM Tom_L: next you're gonna need a few registers to use so you should give them some more common sensible names
08:17 PM z999: a million errors now
08:17 PM Tom_L: it probably can't find that file
08:17 PM Tom_L: what is the first error?
08:18 PM z999: .def 'xh' redefinition
08:18 PM z999: .def xl redefinition
08:18 PM z999: and on and on
08:18 PM Tom_L: awesome
08:18 PM Tom_L: that means we're getting close :)
08:19 PM z999: how do i fix this?
08:19 PM Tom_L: it started when you included the avr file right?
08:19 PM z999: yes
08:20 PM Tom_L: some of the names you used are being used in that file probably
08:20 PM Tom_L: so we need to find out which ones and fix that
08:21 PM Tom_L: can we start a new file? keep your work saved but start fresh
08:21 PM Tom_L: you will want parts of it
08:21 PM z999: i'll put it on notepad
08:21 PM z999: and delete everythin
08:22 PM Tom_L: as long as you can still get to it
08:22 PM z999: yes ok
08:22 PM z999: what do i do now
08:23 PM Tom_L: moving pcs hang on
08:24 PM Tom_L: was trying to find something with studio on it but no luch
08:24 PM Tom_L: luck
08:25 PM Tom_L: oh wait.. there it is
08:26 PM ASRock_pc: i'm using studio 4 so it will be somewhat different
08:27 PM ASRock_pc is now known as Tom_itx
08:27 PM Tom_itx: oh poo
08:27 PM Tom_itx is now known as Guest21471
08:30 PM Tom_shop: z999, still there?
08:30 PM z999: wow working on activity 1 all day. i haven't accomplish zilch
08:30 PM z999: yes right here
08:31 PM z999: some of my classmates havent done it themseles
08:31 PM Tom_shop: lets's start from scratch. i'm using studio 4 though
08:31 PM z999: yes
08:31 PM Tom_shop: so it will vary
08:31 PM Tom_shop: let's start a new project
08:31 PM z999: ok
08:32 PM Tom_shop: pick asm for the assembler and give it a name
08:32 PM z999: ok
08:32 PM Tom_shop: do you have IO view on the right side?
08:32 PM z999: no
08:32 PM Tom_shop: that's where you will watch the registers
08:32 PM z999: it is window that pops up
08:33 PM z999: when you click on the icon
08:33 PM Tom_shop: it's there somewhere, you may need to find it
08:33 PM Tom_shop: ok
08:33 PM z999: ok
08:34 PM Tom_shop: .include "m328def.inc"
08:35 PM Tom_shop: next set up some registers you will use.
08:35 PM Tom_shop: a couple for transferring values and counters etc
08:36 PM Tom_shop: .def temp = r16 ; name the registers we will use
08:36 PM Tom_shop: .def counter1 = r17
08:36 PM Tom_shop: .def counter2 = r18
08:36 PM Tom_shop: .def portbuffer = r19
08:36 PM Tom_shop: that's what i used
08:36 PM Tom_shop: add space where needed there
08:36 PM Tom_shop: irc does strange things sometimes
08:37 PM Tom_shop: then set a starting point for the program
08:37 PM Tom_shop: .org 0x00
08:40 PM z999: ok
08:40 PM z999: then what?
08:40 PM z999: copy the previous codes below .org 0x00
08:42 PM Tom_shop: sry got distracted
08:42 PM Tom_shop: start with a main function
08:42 PM Tom_shop: main:
08:43 PM Tom_shop: and set up your stack pointer with the ramend lines
08:43 PM Tom_shop: using the registers you just defined
08:43 PM z999: i have to look it up because i dont remember how to use them
08:43 PM z999: hold on
08:43 PM Tom_shop: ldi temp, low(RAMEND)
08:43 PM Tom_shop: out SPL, temp
08:44 PM Tom_shop: etc
08:44 PM z999: oh thanks
08:44 PM z999: oh that is not all of it
08:44 PM z999: hold on let me look it up for a sec
08:44 PM Tom_shop: ldi temp, high(RAMEND)
08:44 PM Tom_shop: out SPH, temp
08:44 PM Tom_shop: holler when ready
08:45 PM Tom_shop: SPL and SPH are the stack boundaries
08:45 PM z999: ok ready!
08:45 PM z999: yes
08:45 PM Tom_shop: now you need to set the ports for output
08:45 PM Tom_shop: iirc they are input by default
08:45 PM Tom_shop: so let's use temp again for that
08:46 PM Tom_shop: ldi temp 0xFF
08:46 PM Tom_shop: that will set all the bits in each port we do next
08:46 PM Tom_shop: to output
08:46 PM z999: comma right
08:46 PM Tom_shop: out DDRB, temp DDRB is the data direction register for that port
08:46 PM z999: ldi temp, 0xff
08:46 PM Tom_shop: yes
08:46 PM Tom_shop: same for the other 2 ports
08:48 PM z999: ok
08:48 PM Tom_shop: i should be putting this in studio too...
08:49 PM z999: i'll copy and paste later so that you can do it too
08:49 PM Tom_shop: i've got it
08:49 PM z999: ok then what
08:50 PM z999: remmmber it needs value $55 then $aa
08:50 PM Tom_shop: that's next
08:51 PM Tom_shop: ok let's set up a loop
08:51 PM Tom_shop: loop:
08:51 PM Tom_shop: i'm kinda wingin it here
08:52 PM Tom_shop: ldi portbuffer, 0x55
08:53 PM Tom_shop: did you set DDRx for each port?
08:54 PM Tom_shop: ready?
08:58 PM Tom_shop: z999, ?
08:59 PM z999: hol on
08:59 PM z999: yes ready
08:59 PM Tom_shop: phone...
09:00 PM Tom_shop: one sec
09:00 PM z999: ok
09:00 PM Tom_shop: what's your last line?
09:01 PM z999: ldi portbuffer 0x55
09:01 PM Tom_shop: ok
09:02 PM Tom_shop: right below loop: right?
09:02 PM z999: yes
09:02 PM Tom_shop: out PORTB, portbuffer
09:02 PM Tom_shop: same for the other 2
09:02 PM Tom_shop: now we need to make a delay
09:03 PM z999: delay: call delay?
09:03 PM Tom_shop: wait
09:03 PM Tom_shop: let's set up a counter first
09:03 PM Tom_shop: delay won't be long enough probably
09:03 PM Tom_shop: so
09:04 PM Tom_shop: ldi counter1, 255
09:04 PM Tom_shop: you defined counter1 and 2 above
09:04 PM Tom_shop: remember?
09:04 PM z999: yes
09:04 PM Tom_shop: ok
09:07 PM Tom_shop: umm
09:07 PM Tom_shop: ok
09:07 PM Tom_shop: let's call the delay here and we'll define it below in a bit
09:07 PM Tom_shop: so
09:07 PM Tom_shop: rcall delay
09:07 PM Tom_shop: calls a subroutine
09:09 PM Tom_shop: we will finish this part then define the delay
09:09 PM z999: ok
09:09 PM Tom_shop: one sec
09:11 PM z999: ok
09:12 PM Tom_shop: ok, phone, sry
09:12 PM Tom_shop: so last line was rcall delay?
09:12 PM Tom_shop: ldi portbuffer, 0xAA
09:13 PM Tom_shop: out PORTB, portbuffer
09:13 PM Tom_shop: and c and d
09:13 PM z999: ldi counter1, 255
09:13 PM z999: after that i do not know
09:13 PM z999: call delay?
09:13 PM Tom_shop: yes
09:13 PM Tom_shop: rcall
09:13 PM z999: type call delay?
09:13 PM Tom_shop: rcall delay
09:13 PM z999: or delay: call delay?
09:14 PM Tom_shop: ready?
09:14 PM z999: yes
09:14 PM Tom_shop: ldi portbufffer, 0xAA
09:15 PM z999: ok
09:15 PM Tom_shop: out PORTB, portbuffer
09:15 PM Tom_shop: and c and d
09:16 PM Tom_shop: we're gonna make the delay a loop inside a loop
09:16 PM Tom_shop: that's why there are 2 counters
09:16 PM z999: ok
09:17 PM z999: is that it?
09:17 PM Tom_shop: no
09:17 PM z999: rjmp here?
09:17 PM Tom_shop: no
09:17 PM z999: ok
09:17 PM Tom_shop: you need to call delay again for the 2nd port value or you will never see it
09:17 PM Tom_shop: so
09:18 PM Tom_shop: this will seem redundant now but you will see
09:18 PM Tom_shop: ldi counter1, 255
09:18 PM Tom_shop: rcall delay
09:19 PM Tom_shop: then
09:19 PM Tom_shop: rjmp loop
09:19 PM Tom_shop: :)
09:19 PM Tom_shop: not the most efficient but it should work
09:19 PM Tom_shop: for all you lurkers :D
09:20 PM z999: ok
09:20 PM z999: i will build
09:20 PM Tom_shop: no
09:20 PM z999: will let you know
09:20 PM Tom_shop: not yet
09:20 PM z999: ok
09:20 PM z999: waiting
09:20 PM Tom_shop: we still need the delay
09:20 PM Tom_shop: so after rjmp loop
09:20 PM Tom_shop: delay:
09:20 PM Tom_shop: ldi counter2, 255
09:20 PM Tom_shop: delay_loop:
09:21 PM Tom_shop: nop
09:21 PM Tom_shop: nop
09:21 PM Tom_shop: nop
09:21 PM Tom_shop: dec counter 2
09:21 PM Tom_shop: brne delay_loop
09:21 PM Tom_shop: dec counter1
09:21 PM Tom_shop: brne delay
09:21 PM Tom_shop: ret
09:22 PM z999: ok
09:22 PM Tom_shop: NOW try it
09:22 PM z999: no rjmp here
09:23 PM Tom_shop: it will return
09:23 PM z999: ok
09:23 PM Tom_shop: to the next line after it's call
09:23 PM Tom_shop: first glance, it looks do'able
09:24 PM z999: 687 errors
09:24 PM Tom_shop: that's all?
09:24 PM z999: this doesn't seem doable
09:24 PM z999: it seems impossible
09:24 PM z999: and never ending
09:24 PM Tom_shop: sure it is
09:24 PM Tom_shop: it can't see the .inc file i bet
09:25 PM Tom_shop: so we need to find it
09:25 PM Tom_shop: see, i'm running studio 4
09:25 PM Tom_shop: and things are different in studio 7
09:25 PM Tom_shop: but it should still have the .inc files
09:25 PM Tom_shop: it may be called something else now
09:26 PM Thrashbarg: z999: I hesitate to say that if you're struggling this much at this level of programming, there's something terribly wrong with the course material you're following
09:26 PM Tom_shop: i get: Assembly complete, 0 errors, 0 warnings
09:26 PM Tom_shop: agreed
09:27 PM Tom_shop: i don't have studio 7 either or i'd look for the inc file
09:27 PM z999: Thrashbarg: :/ it is a very steep learning curve for me, unfortunately
09:27 PM Thrashbarg: z999: it should be this steep
09:27 PM z999: Tom_shop studio 7 is free
09:27 PM z999: do you want to dl?
09:28 PM Tom_shop: this program looks workable
09:28 PM Tom_shop: F no
09:28 PM Thrashbarg: not for anyone wanting to do this at least
09:28 PM Tom_shop: i hated studio back then and i certainly don't want it now
09:28 PM Tom_shop: i use text editors and makefiles
09:29 PM Tom_shop: but i happened to have 4 loaded so i used it this time
09:30 PM Tom_shop: oh crap maybe i have 7
09:30 PM Tom_shop: god help me
09:30 PM Thrashbarg: heh
09:30 PM Tom_shop: it's in the directory tree at least
09:30 PM z999: i hope i dont bang my head on the wall, continously, because i am so frustrated with this thing
09:31 PM Thrashbarg: z999: just curious, what programming languages have you done before?
09:31 PM Tom_shop: once you get past the first one it will ge easier
09:31 PM z999: thrashbarg, i did C. that is it
09:31 PM z999: not c+ just C
09:31 PM Thrashbarg: z999: okay good, how'd that go?
09:32 PM z999: barely passed with a B by some miracle
09:32 PM z999: i was very bad at that too
09:32 PM Thrashbarg: and before C?
09:32 PM z999: nada
09:32 PM Thrashbarg: so you've never programmed anything except C and now assembler
09:32 PM Tom_shop: this may not be your calling
09:32 PM Tom_shop: but let's try to get this working
09:32 PM z999: that is right Thrashbarg
09:33 PM z999: Tom_shop it takes me a while to get it
09:33 PM Tom_shop: ok let's take a look
09:33 PM z999: yes Tom_shop waiting for you
09:33 PM Tom_shop: go to program files -> atmel
09:33 PM Tom_shop: and let's find the .inc files
09:33 PM z999: Thrashbarg you can judge me i expect it at this point
09:33 PM Thrashbarg: z999: no I don't intend to... again I say it's the course material not laying down fundamentals correctly
09:34 PM Thrashbarg: your sheer determination to do this qualifies you in my my to be able to do this
09:34 PM z999: where in program files? files?
09:34 PM z999: oh thanks
09:34 PM Tom_shop: trying to find it
09:34 PM z999: Thrashbarg someone else would have dropped the class by now
09:35 PM Thrashbarg: yeah I know
09:35 PM Thrashbarg: you need to look into the fundamentals of how computers work to really get this. Without them you're in the dark
09:35 PM Tom_shop: ok
09:35 PM Tom_shop: is there a AVR tools directory under atmel?
09:36 PM Tom_shop: then AvrAssembler2 under that
09:38 PM Tom_shop: so programfiles -> atmel->avr tools->AvrAssembler2
09:38 PM Tom_shop: is where they are in studio 4
09:38 PM Tom_shop: oops one more -->Appnotes
09:38 PM Tom_shop: there are 2 directories
09:39 PM Tom_shop: AvrAssembler has the first half of the .inc files and AvrAssembler2 has the other half
09:40 PM Tom_shop: better yet
09:41 PM Tom_shop: search for m328def.inc
09:41 PM Tom_shop: i wonder if they went with .xml files after studio5
09:41 PM Tom_shop: i know they started using ms framework around ver 6 and they lost me then
09:42 PM Tom_shop: god only knows how bad microchip will screw it up
09:42 PM Thrashbarg: yaaay :/
09:42 PM nuxil: yea. its basicaly just Visual studio now.
09:43 PM Thrashbarg: I just use a text editor, makefiles and the command line :/
09:43 PM nuxil: yea me to. notepad++
09:43 PM Thrashbarg: Same, until I went back to Linux. Windows is starting to scare me
09:44 PM Tom_shop: nuxil, can you see if you can find the inc files?
09:44 PM nuxil: im thinking about that aswell. and just wine the apps i really need thats just windows. i hear wine is getting good
09:44 PM z999: i am going to google how to look for inc files in amtel studio 7
09:44 PM Tom_shop: or do you not have it loaded
09:44 PM Tom_shop: z999, they may not have them in studio 7
09:45 PM Tom_shop: we are trying to figure that out
09:45 PM nuxil: Tom_shop, i dont use atmelstudio. do no know where to look.
09:45 PM Tom_shop: i think they went to xml files
09:45 PM Tom_shop: for now we can just define what we need
09:45 PM Tom_shop: let's do that
09:45 PM Thrashbarg: https://raw.githubusercontent.com/DarkSector/AVR/master/asm/include/m328def.inc
09:45 PM nuxil: i installed it. opened it, saw it was VS. closed it and never used it sice.
09:46 PM Tom_shop: yeah, i've pasted them for ppl in the past
09:47 PM Tom_shop: i've got it, she probably doesn't
09:52 PM Tom_shop: z999, still there?
09:52 PM z999: yes
09:52 PM z999: right here
09:52 PM Tom_shop: let's go about this another way
09:52 PM Tom_shop: save that file
09:52 PM Tom_shop: start a new project
09:53 PM Tom_shop: select asm
09:53 PM Tom_shop: give it a NEW name
09:53 PM Tom_shop: pick a debugger (doesn't matter) pick dragon
09:53 PM Tom_shop: then a list of chips should come up
09:54 PM Tom_shop: pick atmega328
09:54 PM Tom_shop: that will read in the xml file
09:54 PM Tom_shop: so we won't need the .include
09:54 PM Tom_shop: bastards
09:54 PM z999: teacher knows how to bust my balls
09:54 PM z999: so to speak
09:54 PM z999: even though i dont have balls
09:54 PM Tom_shop: tell when ready
09:55 PM z999: delete .include then?
09:55 PM z999: we did too much work
09:55 PM Tom_shop: paste the code you saved into the new source file window
09:56 PM z999: ok
09:56 PM Tom_shop: hold on i gotta find it
09:56 PM z999: from which point to which point
09:56 PM Tom_shop: all of it
09:56 PM Tom_shop: the stuff we just wrote
09:56 PM z999: the same code that gave me 687 errors?
09:56 PM Tom_shop: yes
09:56 PM z999: ok
09:57 PM Tom_shop: one sec
09:58 PM Tom_shop: ok you got the file in the new source window?
09:58 PM Tom_shop: put a ';' in front of the .include line
09:59 PM Tom_shop: it has to be there in mine
10:00 PM z999: ok
10:00 PM Tom_shop: what's the first error you get?
10:00 PM z999: ok let me build again
10:00 PM Tom_shop: without the .include line i get 13 errors
10:00 PM Tom_shop: with it i get none
10:01 PM z999: 687 errors
10:01 PM Tom_shop: gawd i hate ide's
10:01 PM z999: this is just a nightmare
10:01 PM Tom_shop: ok what's the first one?
10:01 PM Tom_shop: no it's just shit software
10:01 PM z999: giving up after 100 errors
10:01 PM nuxil: nah. you learn something.
10:01 PM Tom_shop: what's the first error?
10:02 PM nuxil: 100 ways not to do it
10:02 PM z999: then it saids invalid redefinition of acbg
10:02 PM Tom_shop: that's without the .include line?
10:02 PM z999: no it literally say "giving up after 100 errors"
10:02 PM Tom_shop: i would too
10:03 PM Tom_shop: that's without the .include line?
10:03 PM z999: yes without the include line
10:03 PM nuxil: oh lol
10:04 PM Tom_shop: i feel the program is sound
10:04 PM z999: i am not an alcoholic but man feel like drinking away my frustration at this
10:04 PM Tom_shop: i think you need to ask your teacher a bit more about studio 7
10:04 PM Tom_shop: don't get rid of this version
10:04 PM z999: i think i will torpedo blow this amtel studio 7
10:05 PM Tom_shop: see, you're learning by leaps and bounds
10:06 PM Tom_shop: i would install 7 but don't have time tonight to follow thru with it
10:06 PM z999: is there another way to do this without the .include file and all the .defs you put into it?
10:06 PM Tom_shop: it's the best way
10:06 PM z999: it takes like 2 hours to install it
10:06 PM z999: dont do it
10:06 PM Tom_shop: i'm aware of that
10:06 PM Tom_shop: been there done that
10:06 PM z999: so i am at square 1
10:07 PM z999: again
10:07 PM Tom_shop: wanna try studio 4?
10:07 PM z999: no,, the teacher will grade it in studio 7
10:07 PM Tom_shop: ok
10:08 PM z999: i wonder if Thrashbarg has time to figure it out
10:09 PM Tom_shop: we'll cheat a bit here
10:09 PM Tom_shop: ready?
10:09 PM z999: ok
10:09 PM Tom_shop: if i can remember...
10:09 PM Tom_shop: nuxil,
10:09 PM Tom_shop: still there?
10:10 PM Tom_shop: RAMEND is defined 0x08FF
10:10 PM nuxil: yes
10:10 PM Tom_shop: 0x08 is the low end right?
10:11 PM Tom_shop: to fill the stack pointer
10:11 PM Tom_shop: z999, i would try this
10:11 PM Tom_shop: ready?
10:11 PM z999: yes
10:11 PM Tom_shop: don't erase but copy these lines and comment out the original ones
10:11 PM Tom_shop: instead of ldi temp, low(RAMEND)
10:11 PM Tom_shop: comment that out
10:12 PM Tom_shop: next line out SPL, temp
10:12 PM Tom_shop: comment that out
10:12 PM Tom_shop: and put out SPL 0x08
10:12 PM Tom_shop: same for SPH
10:12 PM Tom_shop: we will just hardcode the values
10:12 PM Tom_shop: they can just suck it
10:13 PM Tom_shop: so for SPH put: out SPH, 0xFF
10:13 PM Tom_shop: and comment out the RAMEND lines
10:13 PM Tom_shop: and the out SPH, temp and out SPL, temp
10:14 PM Tom_shop: follow?
10:14 PM z999: out sph 0xff
10:14 PM z999: out spl 0xff
10:14 PM z999: is that rght?
10:14 PM Tom_shop: ,
10:14 PM Tom_shop: don't forget the ,
10:14 PM Tom_shop: no
10:14 PM z999: yes of course
10:14 PM Tom_shop: out SPL 0x08
10:14 PM z999: damn syntax
10:14 PM Tom_shop: out SPL, 0xFF
10:14 PM Tom_shop: H
10:14 PM Tom_shop: dammit
10:15 PM z999: ok
10:15 PM Tom_shop: out SPH, 0xFF
10:16 PM Tom_shop: ok the r16.. r19 _should_ be ok
10:16 PM z999: well ramend is commented out
10:17 PM Tom_shop: the whole line
10:17 PM z999: wel how will it work if it is commented out
10:17 PM Tom_shop: lemme catch up here..
10:17 PM Tom_shop: then i'll tell you
10:18 PM z999: out sph 0xff then out spl 0xff
10:18 PM z999: that is it
10:18 PM Tom_shop: no SPL is 0x08
10:18 PM Tom_shop: not ff
10:18 PM z999: ok
10:19 PM Tom_shop: so all you should have for that part is the 2 out lines
10:19 PM Tom_shop: one for SPL and one for SPH
10:20 PM Tom_shop: the .include line is commented out?
10:22 PM Tom_shop: ready?
10:22 PM nuxil: do you need to use the stack for this task at all? dosnt it confuse you the high and low byte ?
10:22 PM Tom_shop: i'll paste my file so you can compare when we're done
10:22 PM Tom_shop: i dunno
10:22 PM Tom_shop: it's just good to define it i think
10:22 PM Tom_shop: probably not in this case
10:23 PM Tom_shop: z999, running on empty here...
10:23 PM z999: hi
10:23 PM z999: i am here
10:23 PM Tom_shop: did you get that sorted out?
10:24 PM z999: i've been running empty since this morning
10:24 PM Tom_shop: ok below the last .def portbuffer = r19
10:24 PM Tom_shop: add this:
10:24 PM z999: and i have 2 more activities to do. this is just activity 1
10:24 PM Tom_shop: .def PORTB = 0x05
10:24 PM Tom_shop: .def PORTC = 0x08
10:24 PM Tom_shop: .def PORTD = 0x0b
10:25 PM Tom_shop: oh wait we can't do that
10:25 PM z999: include is still commented out
10:25 PM Tom_shop: yes
10:25 PM Tom_shop: leave it that way
10:26 PM z999: ok waiting
10:27 PM Tom_shop: mmm that's not gonna work
10:27 PM Tom_shop: lemme think
10:27 PM z999: hmmm i do not believe the other students (the ones that did it) went through so much trouble
10:28 PM Tom_shop: ok, the 2 out SPL SPH lines?
10:28 PM Tom_shop: get rid of those
10:28 PM z999: i wonder if i can search the problem online to see how others tried to solve it
10:28 PM Tom_shop: almost there...
10:29 PM Tom_shop: patience
10:29 PM z999: ok
10:29 PM z999: uncomment those lines
10:29 PM Tom_shop: no get rid of them
10:29 PM Tom_shop: completely
10:29 PM z999: all of it
10:29 PM z999: even the new ones
10:29 PM Tom_shop: i'm tired of messin with the stack pointer
10:30 PM Tom_shop: you're not gonna run outta stack on this thing
10:30 PM z999: ok
10:31 PM Tom_shop: ready?
10:31 PM Tom_shop: below .def portbuffer = r19 add:
10:31 PM Tom_shop: .equ PORTB = 0x05
10:31 PM Tom_shop: .equ PORTC = 0x08
10:31 PM Tom_shop: .equ PORTD = 0x0b
10:31 PM Tom_shop: .equ DDRB = 0x04
10:31 PM Tom_shop: .equ DDRC = 0x07
10:31 PM Tom_shop: .equ DDRD = 0x0A
10:32 PM Tom_shop: that _should_ shut studio 7 up
10:32 PM z999: ok
10:32 PM Tom_shop: i'll paste what i've got
10:32 PM z999: delete before .def portb etc?
10:33 PM Tom_shop: http://paste.debian.net/1012004/
10:33 PM Tom_shop: take a peek
10:33 PM Tom_shop: i left in the old code but commented it out
10:33 PM Tom_shop: see, the .inc file has all those .equ stuff in it
10:34 PM Tom_shop: but we just defined the ones we're using
10:34 PM Tom_shop: the .inc file just saves time
10:34 PM z999: yes the same as what i got
10:34 PM z999: do i try to build?
10:34 PM Tom_shop: so if it works, get rid of all the commented lines
10:34 PM Tom_shop: sure
10:34 PM Tom_shop: mine builds
10:35 PM z999: 687 errors here
10:35 PM Tom_shop: what's the first error?
10:35 PM z999: same as before
10:35 PM Tom_shop: you sure you saved it?
10:36 PM z999: i can save it again
10:36 PM Tom_shop: before i go, check the IO View window
10:37 PM Tom_shop: is there anything in it?
10:37 PM z999: it is not building! how could there be anything in io
10:38 PM Tom_shop: mine shows all the ports etc
10:38 PM z999: no not when it doesn't build
10:38 PM Tom_shop: it should show it because you selected the chip when you created the project
10:38 PM Tom_shop: that's why i had you re start the project
10:40 PM Tom_shop: actually the whole part of main: you don't need now
10:40 PM Tom_shop: from loop: on is all you really need and the .def and .equ above that
10:41 PM z999: actually you do need main
10:41 PM z999: that is part of instructions for activity 1
10:41 PM z999: it had to go to ddrb, ddrc, ddrd
10:41 PM Tom_shop: then rename loop: to main:
10:41 PM Tom_shop: and get rid of main
10:41 PM Tom_shop: one sec
10:42 PM Tom_shop: http://paste.debian.net/1012005/
10:43 PM z999: ok
10:43 PM Tom_shop: that's all you really need
10:43 PM Tom_shop: rename the rjmp loop to rjmp main now
10:43 PM Tom_shop: and get rid of the eor line
10:43 PM Tom_shop: that's from my stuff
10:43 PM z999: you have the ports twice
10:43 PM z999: it is ddrb ddrc ddrd
10:44 PM Tom_shop: uh huh
10:44 PM Tom_shop: those are data direction registers
10:44 PM Tom_shop: the others are the actual ports
10:44 PM Tom_shop: ddrb isn't portb
10:44 PM Tom_shop: it's the direction register for it
10:44 PM Tom_shop: to tell if it's an input or an output
10:45 PM Tom_shop: and those numbers assigned to them are where they appear on the actual chip
10:45 PM Tom_shop: you can also find those in the data sheet for the chip
10:45 PM Tom_shop: if the teacher asks where you found them :D
10:47 PM Tom_shop: i think in order to walk through the code though you need a debugger and chip attached to studio
10:47 PM Tom_shop: i'm not sure, i can't remember
10:47 PM z999: no
10:47 PM z999: you do not
10:47 PM Tom_shop: ok
10:48 PM Tom_shop: well you're one up on me then :D
10:48 PM z999: i have done it before without the chip
10:48 PM z999: by the way still 687 errors
10:48 PM z999: i will pastebin what i have so you can compare
10:48 PM z999: bbut something is not right with the code
10:48 PM Tom_shop: no need i trust your typing ability
10:48 PM z999: if someone else do not help then i will get no where
10:48 PM Tom_shop: i'd have to get 7 to figure it out
10:49 PM z999: been doing this for 12 hours now
10:49 PM Tom_shop: when's it due?
10:49 PM z999: it is past due
10:49 PM z999: every day is 2% deducted
10:49 PM Tom_shop: oops
10:49 PM z999: this is just the first activity for this lab there are 2 more
10:49 PM Tom_shop: this code is solid i think
10:49 PM z999: and i cant do shit because i am stuck on activity 1
10:49 PM Tom_shop: don't discard it
10:49 PM z999: well it is not working
10:50 PM nuxil: post what you got.
10:50 PM z999: it gives me 687 errors does not build
10:50 PM Tom_shop: but i'd try to find out why all the errors
10:50 PM Tom_shop: it's some silly little thing
10:50 PM Tom_shop: one little tweak will fix it all i bet
10:50 PM Tom_shop: can you ask a classmate?
10:50 PM z999: https://pastebin.com/NU16PCtb
10:50 PM Tom_shop: it's some stupid studio 7 setting
10:50 PM z999: i did
10:51 PM z999: 1 of them hasnt done it
10:51 PM z999: the other two helped to a certain point
10:51 PM z999: they told me they do not want to give their code because then i wont learn
10:51 PM z999: blah blah blah
10:52 PM Tom_shop: change loop: to main:
10:52 PM Tom_shop: you said you needed a main
10:52 PM Tom_shop: i don't care what you call it
10:52 PM Tom_shop: then change the line: rjmp loop to rjmp main
10:53 PM Tom_shop: the assembler could care less
10:53 PM z999: still doesn't build
10:54 PM z999: it is not main
10:54 PM Tom_shop: i didn't say that would fix anything
10:54 PM z999: it needs to have ddrb ddrc ddrd because it is part of the instruction to assignment
10:54 PM Tom_shop: you said you needed a "main:"
10:54 PM Tom_shop: they are there
10:54 PM z999: ok
10:54 PM z999: so why isn't working?
10:54 PM Tom_shop: the .equ DDRB = 0x04
10:54 PM Tom_shop: studio 7
10:55 PM Tom_shop: is the reason
10:55 PM Tom_shop: it's some stupid setting in it
10:55 PM Tom_shop: one tweak will likely fix it all
10:55 PM Tom_shop: if you see abcminiuser here ask him
10:55 PM Tom_shop: he worked for atmel a while back
10:56 PM z999: ok do you have to go ?
10:56 PM Tom_shop: i've just not used studio 7
10:56 PM Tom_shop: i have a few min
10:56 PM nuxil: portbuffer in that code is not needed from what i see, you can use tmp for output aswell. ldi temp, value; out portx temp
10:56 PM z999: ok.
10:57 PM z999: i will save this
10:57 PM Tom_shop: tweak it however you like, i'm just saying this comiles with no erors an would likely blink the leds on those pins
10:58 PM Tom_shop: there's more than one way to skin a cat
10:58 PM nuxil: true
10:58 PM z999: i heard that sayin lots of time
10:58 PM Tom_shop: eor would probably work too but we'll not go down that road
10:59 PM Tom_shop: it would be harder to do not using 0xFF as a mask
10:59 PM z999: deleted portbuffer and replaced with temp
10:59 PM z999: still 687 errors
10:59 PM Tom_shop: that's fine
10:59 PM z999: anyways, activity 1 and 2 are related
11:00 PM Tom_shop: ok do this
11:00 PM z999: i will try to save this and work on activity 3
11:00 PM Tom_shop: comment out everything and start at the top and uncomment the lines
11:00 PM Tom_shop: see where the errors begin
11:00 PM Tom_shop: do the .def and .equ first
11:00 PM Tom_shop: see if it builds that way
11:01 PM Tom_shop: then uncomment a couple lines and try again
11:01 PM z999: yes did that. the opening is the problem
11:01 PM z999: i get 687 errors regardless
11:02 PM Tom_shop: it might be looking for an .include m328def.xml file for all i know
11:02 PM z999: it is either not recognizing it
11:02 PM z999: we did that and didnt work
11:02 PM Tom_shop: no not .xml
11:02 PM Tom_shop: did you try that?
11:02 PM z999: no
11:02 PM z999: how do you try xml?
11:02 PM Tom_shop: it's some stupid thing like that
11:02 PM Tom_shop: causing the problem
11:03 PM Tom_shop: .include m328def.xml but i don't know but what they renamed the whole file
11:03 PM Tom_shop: it would be 328 something :)
11:04 PM z999: i wonder how can you find it
11:05 PM nuxil: xml?
11:05 PM nuxil: C:\Program Files (x86)\Atmel\Studio\7.0\packs\atmel\ATmega_DFP\1.2.150\avrasm\inc
11:05 PM nuxil: inc files
11:06 PM Tom_shop: http://community.atmel.com/forum/header-files-as7
11:06 PM Tom_shop: nuxil, did they rename them?
11:06 PM nuxil: i have no idea. atmel studio 7 is the only version i have had installed
11:07 PM Tom_shop: well, it's the only one i don't have :)
11:07 PM z999: Everything that has to do with device knowledge is now inside packs. We also finally renamed the xml files to atdf (since that's what they're called). The XML schema is the same btw...
11:07 PM z999: found this in google
11:07 PM * nuxil hates xml
11:07 PM Tom_shop: so once you find the include you should be ok
11:08 PM Tom_shop: only that example i posted was for c
11:08 PM z999: i have to figure out how to find it
11:09 PM z999: m328pdef.inc
11:09 PM z999: is this it
11:10 PM z999: i typed this but it still doesnt work
11:10 PM Tom_shop: that's just a 328 variant
11:11 PM Tom_shop: http://www.avrfreaks.net/forum/where-include-file
11:11 PM Tom_shop: for studio 6
11:11 PM Tom_shop: dunno about 7
11:12 PM z999: ok changed it to xml doesnt work
11:13 PM nuxil: the def files you will find at the location i posted. that are all *.inc no xml files in there
11:13 PM nuxil: why does it use xml ?
11:14 PM Tom_shop: not sure why it's getting all the errors but it's something stupid like the .inc files
11:14 PM Tom_shop: https://medium.com/jungletronics/meeting-assembly-hello-world-arduino-blinking-code-330386652309
11:14 PM Tom_shop: they're using studio 7 there
11:15 PM Tom_shop: ignore the arduino pollution
11:17 PM nuxil: talk about xml. did you know you can make xml appare as html ?
11:17 PM nuxil: using xsl
11:18 PM nuxil: http://www.jointheriot.org/arma2squad/A2squad.xml old annoying squad card i did back when i was playing arma2 :p
11:18 PM Tom_shop: that's strictly on a need to know basis
11:18 PM Tom_shop: guess what/
11:18 PM Tom_shop: ?
11:19 PM Tom_shop: if i get stuck in that mire, just shoot me
11:19 PM nuxil: heh
11:20 PM Tom_shop: enough for me tonight.
11:20 PM Tom_shop: later
11:21 PM Tom_L: is studio 7 64bit?
11:21 PM Tom_L: or does it matter?
11:23 PM nuxil: idk. its installed under ...x86 so dont think so
11:24 PM nuxil: its 32bit.
11:25 PM Tom_L: the only reason i kept up on studio was to keep my programmer working with it
11:25 PM Tom_L: that' was thru ver 6 iirc
11:25 PM day__ is now known as day
11:26 PM Tom_L: z999, where are you from anyway?
11:26 PM z999: i wrote to the community board maybe tomorrow someone willanswer
11:26 PM z999: putting it aside and working on activity 3
11:26 PM z999: Tom_L: Miami, Florida
11:26 PM Tom_L: you may not need include files now, it may be done when you define the project
11:27 PM Tom_L: i know asm hasn't changed that much and that code should work
11:27 PM Tom_L: z999 did you have a direct download link for studio 7?
11:28 PM nuxil: man. so many Tom's in here :D
11:29 PM z999: yes tom
11:29 PM z999: this is activity 3 Using a simulator, write a program to read a byte of data from PORTB and send it to PORTC and PORTD. Also, copy the byte to registers R20, R21, and R22. Single-step the program and examine the ports and registers.
11:29 PM z999: this doesn't seem so complicated
11:29 PM nuxil: easy peasy
11:30 PM z999: Tom_L this is the link to AS7 https://www.microchip.com/avr-support/atmel-studio-7
11:31 PM nuxil: you been worknig with the out operand, now you need to look at the in
11:38 PM Tom_itx: haha
11:38 PM Tom_itx: i had an older 7 installer already
11:40 PM Tom_itx: if it messes up 4 i won't forgive you
11:49 PM Tom_L: hah studio 7 and they're still using 2015 shell