#avr Logs

Mar 26 2018

#avr Calendar

12:01 AM day__ is now known as day
12:30 AM polprog: mornings
12:33 AM _ami_: polprog, yo, howz your cpu health? :)
12:40 AM polprog: _ami_: thanks, they are all cpu-ing
12:40 AM polprog: ;)
12:44 AM _ami_: you got me last time. :P
01:47 AM rue_bed: anyone done stm32 i2c with opencm3?
01:48 AM rue_bed: for something common, lm75 or pcf* or something?
01:48 AM Haohmaru: <crickets.wav>
01:48 AM rue_bed: :/
01:49 AM Haohmaru: pretty much the first thing i'll need to code for stm32 would have to be the custom usart bootloader
01:49 AM Haohmaru: :/
01:49 AM rue_bed: WHY
01:49 AM _ami_: rue_bed, i have done i2c in stm32.
01:49 AM rue_bed: use the programmer
01:49 AM rue_bed: _ami_, with what perph?
01:50 AM Haohmaru: rue_bed can't use a programmer later to change firmware via tcp
01:50 AM rue_bed: why do you want to set something up so its hackable by russians?
01:50 AM _ami_: rue_bed, i2c1 peripherals.
01:51 AM rue_bed: a pcf8541?
01:51 AM _ami_: oh, you meant with i2c slave devices?
01:51 AM rue_bed: yeaaa
01:52 AM _ami_: tried with mcp4725, oled ssd1306 and ina219 and AT24 eeprom.
01:52 AM Haohmaru: rue_bed the tcp connection itself can/will be encrypted elsewhere, the bootloader just has to run a synchronous usart
01:52 AM rue_bed: ok
01:53 AM _ami_: rue_bed, using stm32f1xx?
01:53 AM _ami_: blue pill?
01:53 AM _ami_: it has some silicon i2c bugs
01:53 AM rue_bed: yea 103
01:53 AM rue_bed: heh
01:53 AM _ami_: what problems are you getting?
01:53 AM rue_bed: so I should use the bit banging library from the avr stuff :)
01:54 AM * polprog puts a pentium box next to haohmaru's board as an ethernet to serial solution
01:54 AM rue_bed: none yet
01:54 AM _ami_: ko.
01:54 AM _ami_: ok
01:54 AM rue_bed: I have a oled display I'm looking at
01:54 AM rue_bed: they dont use opencm3 and I'd like to standardize on that
01:55 AM Haohmaru: polprog i already got the module that deals with the tcp
01:55 AM Haohmaru: no need for a comput0r
01:55 AM Haohmaru: plus, comput0r afaik can't has synchronous mode
01:55 AM rue_bed: I'd like to get the stm32 going with a w5500 too
01:56 AM polprog: never used synchronous mode
01:56 AM Haohmaru: rue_bed in my case i use xmega32a4u+w5500
01:56 AM rue_bed: yea, I'm not into xmega
01:56 AM rue_bed: stm32 is more standard
01:56 AM Haohmaru: THAT'S YOUR LOSS!
01:56 AM Haohmaru: ;P~
01:57 AM Haohmaru: but eventually i will probably replace the xmega with maybe an stm32 with a few pins, usart, and slightly more than 8K ram
01:58 AM rue_bed: its arm, everything is going to go arm, unless your trying to make obscure hardware, dont know if there is much point in anything else
01:58 AM _ami_: Haohmaru, you could jump to system memory from main flash program for updating the flash.
01:59 AM Haohmaru: hm?!
01:59 AM _ami_: that system memory points to the internal serial bootloader(uses UART1)
01:59 AM rue_bed: iirc cant in thumb mode
01:59 AM _ami_: Haohmaru, https://stm32f4-discovery.net/2017/04/tutorial-jump-system-memory-software-stm32/
01:59 AM Haohmaru: whatever bootloader there may be on the stm32, i cannot use it directly
02:00 AM Haohmaru: because mine has to talk to the server via our high-level protocol, and also needs to use synchronous master mode USART
02:02 AM _ami_: Haohmaru, read abt this: https://bin.jvnv.net/f/Qjbxx page no. 13.
02:03 AM _ami_: instead of writing bootloader on stm32, u could have a programmer sit between your tcp server and stm32 and it does the flashing to stm32 and talks to your high level server.
02:04 AM rue_bed: well, if your into trouble, remote flashing shouldn't be unobtainable
02:04 AM _ami_: that programmer can select the boot pins mode and reset the stm32 whenever update is required.
02:04 AM _ami_: in your case, u would want to boot into system memory
02:05 AM rue_bed: "oh god, I DIDN'T just push that as an update did I !!!! !?!?!?!"
02:05 AM rue_bed: ;)
02:05 AM Haohmaru: yet another chip to act as a programmer?!
02:05 AM Haohmaru: x_x
02:05 AM Haohmaru: why would that be better/easier?
02:06 AM _ami_: how are you doing OTA? that device itself can do this job?
02:06 AM Haohmaru: OTA?
02:06 AM _ami_: Over the air.
02:07 AM Haohmaru: uhm, the synchronous USART that the bootloader should be using is connected to a transparent USART<->tcp module
02:07 AM Haohmaru: ..in synchronous slave mode
02:08 AM _ami_: lets say esp8266 is connected to stm32.
02:08 AM Haohmaru: :~(
02:09 AM _ami_: via usart1 and it controls the reset/boot0/boot1 pins of stm32.
02:09 AM _ami_: when there is an update, esp sets boot1 to 0 and boot0 to 1 and reboots stm32..
02:09 AM _ami_: now stm32 is in system memory mode.
02:10 AM _ami_: esp8266 transfers the application binary to stm32 via serial and after flashing, it reboots stm32 with boot0 set to 0.
02:11 AM Haohmaru: my ethernet module cannot reboot the main device
02:11 AM _ami_: ah, you have ethernet module.
02:11 AM _ami_: hmm
02:11 AM Haohmaru: yes, that is the usart<->tcp module
02:11 AM _ami_: then you need bootloader on stm32 - custom one.
02:12 AM _ami_: in user flash section.
02:12 AM Haohmaru: exactly, that's what i've been talking about
02:12 AM Haohmaru: how big is one flash page btw?
02:12 AM _ami_: 1024 bytes
02:12 AM Haohmaru: if it's bigger than 512 bytes i'm f*cked
02:12 AM Haohmaru: :~(
02:14 AM Haohmaru: actually, if the bootloader has tens of kilobytes of RAM, it won't be an issue
02:17 AM _ami_: the bootloader in stm32 is reside in flash section so it has access to all SRAM.
02:17 AM _ami_: there is no special bootloader section like avr in stm32.
02:17 AM _ami_: u can have multiple applications binaries in your stm32 and u could jmp from one to another.
02:17 AM _ami_: if you wish, your application can update your bootloader and vice-versa.
02:18 AM Haohmaru: o_O that's funky
02:18 AM _ami_: bootloader here is just another application which happens to write to other part of flash.
02:18 AM rue_bed: why not have the stm32 do a restart in the user code after the bootloader
02:19 AM Haohmaru: my bootloader plan/strategy originates from the time before stm32, when i was going to be using xmega for this
02:20 AM Haohmaru: so i need to set up the chip so it always runs the bootloader first, and then the bootloader should decide whether to jump to the firmware or not, also, the firmware should be able to restart the chip with some flag set which the bootloader can read
02:20 AM _ami_: rue_bed, the cortex-m architecture defines the 0x00 address as memory location where starting to place MSP and vector table. This means that the flash starting address 0x08000000 is aliased to 0x00 and it depends upon the boot pins configuration at the time of start.
02:20 AM Haohmaru: that flag will be the "bootloader pls remain running" flag
02:21 AM _ami_: Since your bootloader is already in flash section, you don't need to remap. just set the vector table and msp to next jmp address and jump to app addr + 4 location.
02:21 AM _ami_: i have tried this and it seems to work perfect.
02:23 AM _ami_: i have not tried jumping from flash to sram without restart. i don't know if it works.
02:23 AM Haohmaru: _ami_ does the AN2606 document talk about the built-in bootloader (which i don't need) ?
02:23 AM Haohmaru: i mean can i just skip reading it
02:23 AM Haohmaru: or is there anything useful for my case
02:23 AM _ami_: you don't need built-in bootloader.
02:24 AM _ami_: you need a custom uart bootloader which starts from flash address 0x08000000
02:24 AM _ami_: and update the other part of flash with new app binary (say at address 0x08000000 + 4k or 8k)
02:25 AM Haohmaru: hm, so my bootloader will be located in the beginning of the "program flash", and the firmware will be located 4 or 8K after it?
02:25 AM _ami_: Haohmaru, check this code: its usb dfu https://github.com/libopencm3/libopencm3-examples/blob/master/examples/stm32/f1/other/usb_dfu/usbdfu.c
02:25 AM _ami_: yes, indeed.
02:26 AM Haohmaru: i looked at that, it's USB stuff i'm not familiar with
02:26 AM _ami_: it will depend upon the size of bootloader.
02:26 AM _ami_: ok.
02:27 AM _ami_: let me give you one example program which tasks is to jmp to another application start address.
02:27 AM Haohmaru: i think all that i will need is the functions for reading/writing a page of flash, initializing the USART, and rebooting
02:27 AM _ami_: correct!
02:27 AM Haohmaru: at least for a minimal working bootloader
02:27 AM _ami_: Yup.
02:28 AM _ami_: also arm has a nice function to do this. scb_reset_system() or similar.
02:28 AM _ami_: to reboot
02:28 AM Haohmaru: kewl
02:28 AM _ami_: u can find this function in usb dfu code.
02:28 AM Haohmaru: xmega has RST.CTRL
02:29 AM _ami_: Haohmaru, https://www.enlightenment.org/ss/display.php?image=e-5ab8a0ee339a92.92332299.png
02:30 AM nohitzwork: https://github.com/cnoviello/mastering-stm32/blob/master/nucleo-f401RE/src/ch20/main-bootloader.c
02:30 AM nohitzwork: for cube hal
02:34 AM Haohmaru: line 139 there looks interesting
02:34 AM Haohmaru: the first byte of the firmware flash is checked if it's equal to the RAM size?
02:35 AM Haohmaru: who puts that value there? the bootloader after successiful firmware update, or is it more special than that?
02:35 AM _ami_: Haohmaru, i think this is just to verify if you are not jumping from flash to sram section
02:35 AM Haohmaru: i mean, is this just a common practice to have the firmware start from a 4byte offset
02:36 AM _ami_: this is similar to this check (*(volatile uint32_t *)APP_ADDRESS & 0x2FFE0000) == 0x20000000
02:36 AM _ami_: SRAM address is 0x20000000
02:36 AM _ami_: so its basically checking if your app address does not point to SRAM address
02:37 AM _ami_: AFAIK, base address of the application holds the initial stack ptr position.
02:37 AM _ami_: i guess its cortex m design?
02:38 AM Haohmaru: oh, are the first 4 bytes there just a pointer for where to jump to?
02:39 AM _ami_: no, it stores the initial stack pointer position.
02:39 AM Haohmaru: hm, so it's some special voodoo ritual then
02:39 AM _ami_: and stack starts from SRAM 0x200XX00.. something
02:40 AM _ami_: generally SRAM layout like this in stm32
02:40 AM _ami_: 0x200xx00[stack-->][<--heap][data(.bss, .data)] 0x20000000
02:41 AM _ami_: so first 4 bytes of app address is 0x200xx00
02:43 AM Haohmaru: i don't understand the stuff on such low level, stack, heap, bss, i've seen these but i have no idea how things actually work
02:43 AM Haohmaru: i just write my sloppy C/C++ code
02:46 AM polprog: i dont know the difference between stack and heap :(
02:47 AM Haohmaru: i think one of them is memory allocated with your program (that doesn't change in size), while the other is memory that gets allocated dynamically, at least on comput0r programs
02:48 AM _ami_: polprog, its a very popular questions asked during job interviews :)
02:48 AM Haohmaru: if you declare a global-scope or static array, or a local scope array, those are not allocated dynamically
02:48 AM _ami_: question*
02:48 AM Haohmaru: if you call new [] then ur pwned
02:48 AM polprog: if they ask me questions like that ill just tell them to get lost
02:49 AM Haohmaru: i'll tell em the above
02:49 AM Haohmaru: *shrug*
02:49 AM polprog: okay maybe not really
02:49 AM Haohmaru: _ami_ was i close to the truth? ;P~
02:49 AM polprog: but in general im against whiteboard interviews like that
02:50 AM _ami_: polprog, there are no other ways to measure someone's capabilities.
02:50 AM Haohmaru: yeah, if they ask the same questions, or just a few questions, they won't get a good idea of your capabilities
02:50 AM polprog: then again, avrs being strictly harvard arch vs stm32 being closer to regular comput0rs
02:50 AM _ami_: ok, they can see your profile and past work.. but i don't think the interviewers have time for this.
02:50 AM polprog: _ami_: there are, just give someone a real problem
02:50 AM _ami_: so they just follow set of rules set by the employer
02:51 AM Haohmaru: they will miss polprog then
02:51 AM polprog: and HR drones reading scripts are another problem. but theres not much i can do... so i better know the answers, no matter how dumb the question is
02:51 AM Haohmaru: THEIR LOSS!
03:13 AM Haohmaru: polprog what's the difference between a floating boat and a sinking boat?
03:13 AM polprog: one uses integers
03:13 AM Haohmaru: ur hired.
03:13 AM polprog: yiss
03:14 AM Haohmaru: but the right answer was "you can pull the floating boat up with a weak resistor to sky"
03:14 AM polprog: lol
03:16 AM * polprog throws an 8087 at Haohmaru
03:16 AM Haohmaru: wut's that
03:16 AM polprog: a floating point coprocessor
03:17 AM Haohmaru: ooh, i want to glue it onto my atmega2561
03:17 AM Haohmaru: can it do doubles?
03:17 AM polprog: no you need two of them
03:17 AM Haohmaru: meh
03:17 AM polprog: (joking, it can)
03:18 AM polprog: double trouble ;)
03:18 AM Haohmaru: it'd be nice if i can replace my 64bit int division maths and sh*t with float/double
03:18 AM Haohmaru: i think even 32bit float might do the job
03:19 AM Haohmaru: how bout float on these stm32F4s? do you just use "float" variables in yer code like normal?
03:19 AM Haohmaru: and the compiler does the magic?
03:20 AM polprog: no idea
03:20 AM polprog: you could try
03:20 AM polprog: it should have an fpu
03:20 AM Haohmaru: i use these kind of compiler settings:
03:21 AM Haohmaru: arm-none-eabi-g++.exe -mthumb -O2 -Wall -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fno-aggressive-loop-optimizations -D__weak="__attribute__((weak))" -D__packed="__attribute__((__packed__))" -DUSE_HAL_DRIVER -DSTM32F446xx -std=c++11
03:21 AM Haohmaru: i can't try anything, don't have a chip yet
03:21 AM polprog: you can
03:21 AM * polprog gives Haohmaru a disassembler
03:22 AM Haohmaru: noooo, asm :~(
03:22 AM Haohmaru: mov eax brjne NOP NOP NOP NOP NOP
03:22 AM Haohmaru: 0xFUUUUUUUUUUUUUU
03:23 AM polprog: http://www.st.com/en/microcontrollers/stm32f446.html?querycriteria=productId=LN1875
03:23 AM polprog: id
03:23 AM polprog: it says it has an fpu
03:24 AM Haohmaru: yeah, all of the cortex-M4 appear to have fpu afaiu
03:47 AM nohitzwork: my-coworker says that -mfloat-abi determens if fpu is in use or not and -mfpu selects the type of fpu
03:47 AM nohitzwork: hard means it uses fpu, soft not
03:48 AM nohitzwork: so it should work with those you have now
03:48 AM Haohmaru: nice
03:54 AM nohitzwork: Specifying ‘soft’ causes GCC to generate output containing library calls for
03:54 AM nohitzwork: floating-point operations. ‘softfp’ allows the generation of code using hardware
03:54 AM nohitzwork: floating-point instructions, but still uses the soft-float calling conventions.
03:54 AM nohitzwork: ‘hard’ allows generation of floating-point instructions and uses FPU-specific
03:54 AM nohitzwork: calling conventions.
03:57 AM Haohmaru: hm, wait, so the stm32 built-in bootloader contains a pile of means for flashing?
03:57 AM nohitzwork: yeah
03:57 AM nohitzwork: usb, i2c , spi, uart
03:57 AM Haohmaru: it waits on all USARTs, on SPIs, on USB, etc..
03:57 AM Haohmaru: funky
03:57 AM Haohmaru: so it might be useful to use the USB part of that instead of a programmer
03:57 AM Emil: wot
03:57 AM Emil: iirc only serial
03:58 AM Emil: and only one serial
03:58 AM nohitzwork: nah
03:58 AM Haohmaru: hm
03:58 AM Emil: nohitzwork: yes
03:58 AM Haohmaru: page 155 in AN2606 has a bootloader logic diagram
03:58 AM Emil: unless you are talking on some recent stm32s
03:58 AM nohitzwork: http://www.st.com/content/ccc/resource/technical/document/application_note/b9/9b/16/3a/12/1e/40/0c/CD00167594.pdf/files/CD00167594.pdf/jcr:content/translations/en.CD00167594.pdf
03:58 AM Emil: because the bluepills sure as hell don't
03:59 AM Haohmaru: i'm looking at F446
03:59 AM nohitzwork: Its main task is to download the
03:59 AM nohitzwork: application program to the internal Flash me
03:59 AM nohitzwork: mory through one of the available serial
03:59 AM nohitzwork: peripherals (USART, CAN, USB, I
03:59 AM nohitzwork: 2
03:59 AM nohitzwork: C, SPI, etc.).
04:01 AM Haohmaru: if it can, it initializes all serial peripherals, then waits for 0x7F on some/all USARTs, if that doesn't work it waits for I2C address detec, then waits for synchro mechanism detect on SPI, then for frame detect on CAN, and finally for USB cable detect (and then goes back to the top of the loop)
04:05 AM _ami_: some supports over i2c, usb too.. but blue pill built in serial is only over usart1
04:06 AM _ami_: serial bootloader*
05:56 AM Haohmaru: damn it, which datasheet shall i be looking into to figure out how to read/write to the flash? (stm32)
05:57 AM Haohmaru: i got the chip datasheet, the Reference Manual, the Programmer's Manual, and a bunch of app notes
05:57 AM Haohmaru: i'm seeing fragments here and there
06:28 AM nohitzwork: \o/
06:28 AM nohitzwork: we successfully updated firmware via bluetooth
06:29 AM nuxil: ?
06:29 AM Haohmaru: ++brain_cancer_cells;
06:29 AM nuxil: more details :p
06:29 AM nuxil: what are you woking on ?
06:30 AM nohitzwork: world's first underwater navigator for scuba divers
06:30 AM nuxil: nice :)
06:31 AM nuxil: i remember now
06:31 AM nuxil: ÿou showed some links of some renders some time ago
06:31 AM nohitzwork: yep
06:31 AM nuxil: so its coming alone fine ?
06:32 AM nohitzwork: yeah
06:32 AM nohitzwork: we updated fw via android app
06:32 AM nohitzwork: small milestone
06:32 AM nuxil: thats cool :)
06:33 AM nuxil: did you implement my suggestions ?
06:33 AM nuxil: :p
06:33 AM nohitzwork: no
06:34 AM nuxil: having depth, direction desent rate etc on each corner of the screen.
06:34 AM nuxil: ok
06:34 AM nuxil: :(
06:34 AM nohitzwork: that render doesnt really give you anything what the ui will look like in the end
06:35 AM nohitzwork: i could show you some pics but i cant
06:35 AM nohitzwork: i wanna keep this job
06:35 AM nuxil: i'll sign a nda :p
06:37 AM Haohmaru: you can probably find those pics on the NSA servers somewhere ;P~
08:57 AM rue_: what happens if the nsa is hacked
08:57 AM rue_: they would have access to everything
09:01 AM thardin: dont be silly that cant happen
09:02 AM rue_: SINGLE POINT OF FAILURE!
09:10 AM desperek: polprog, so, how do i connect this quartz :D?
09:10 AM polprog: to xtal pins and caps from the pins to ground
09:11 AM polprog: theres a schematic in the datasheet if i remember
09:12 AM desperek: polprog, to both xtal pins? from vcc?
09:12 AM polprog: no
09:12 AM polprog: one crystal pin to xtal1 and another crystal pin to xtal2
09:12 AM polprog: and from each of those pins a cap to ground
09:12 AM desperek: hm
09:12 AM desperek: 22pF?
09:15 AM desperek: also
09:15 AM desperek: polprog, should i use 16MHz or 8Mhz?
09:15 AM desperek: or it doesnt matter?
09:15 AM polprog: well, that wiill be the speed your avr is running at
09:25 AM emil is now known as Emil
09:27 AM desperek: polprog, doesnt work ;-;
09:27 AM desperek: shall i connect reset button?
09:27 AM polprog: yeah
09:27 AM polprog: also
09:27 AM desperek: polprog, how to then
09:27 AM polprog: http://puu.sh/yqKFY/f4322a7539.jpg
09:28 AM desperek: polprog, what if i have a microswitch
09:28 AM polprog: same
09:29 AM polprog: also. how did you tell it doesnt work?
09:30 AM desperek: polprog, target doesnt answer in avrdude
09:31 AM polprog: hmm
09:31 AM polprog: make sure all the cables are ok
09:32 AM polprog: you can also try to lower the speed of avrdude
09:33 AM polprog: are you suing usbasp?
09:34 AM polprog: using*
09:37 AM desperek: yes....
09:37 AM desperek: how do i know if all cables are ok ffs
09:38 AM polprog: reconnect them
09:38 AM polprog: also
09:38 AM polprog: make sure the avr has power, obviously
09:39 AM desperek: polprog, eh, how do i power it, then
09:39 AM polprog: umm
09:40 AM polprog: does your usbasp has a VCC output?
09:40 AM desperek: yes it does
09:40 AM desperek: adding power on usbasp it doesnt change anything
09:40 AM desperek: maybe atmega is fried?
09:41 AM polprog: so connect it to both VCC pins of the avr
09:41 AM polprog: maybe
09:41 AM polprog: are you sure its giving out power?
09:41 AM Haohmaru: does it smell like "oh noes"
09:48 AM desperek: Haohmaru, nope, i think it smelled like that last time tho :D
10:07 AM skz81: <desperek> maybe atmega is fried? >> if yes... try salsa sausage !
10:08 AM polprog: https://www.youtube.com/watch?v=sG3wceb05Sg
10:09 AM polprog: you are laughing but water with itd 4200 kJ/kg*K heat may actually work for a bit of time
10:09 AM polprog: it's*
10:28 AM nuxil: why would i laugh? water is a great thermal conductor :)
10:29 AM nuxil: for "low temp"
10:29 AM nuxil: < 100
10:29 AM polprog: you can always pressurize it
10:29 AM nuxil: oil is used in high temp places wherr fluid is needed
10:30 AM polprog: oil, glycol, whatever
10:31 AM nuxil: depending on the air. but iirc water conducts heat around 25-30 ish times more.
10:32 AM nuxil: having that said. i will never use watercooling in my pc again.
10:32 AM nuxil: had it once. and never again.
10:32 AM polprog: leak?
10:33 AM nuxil: yea.. big leack- frided my mobo and graphic cards. the traces going to the pci extress was all burned and curled up :D
10:33 AM polprog: shit happens
10:33 AM nuxil: so yea. never again :p
10:35 AM nuxil: i have fell in love with my 3d printer :D i want a 2nd one now :D
10:38 AM polprog: Tektronix 222. look at that cute scope
10:38 AM polprog: https://www.youtube.com/watch?v=LJ2VS3aohV0
10:39 AM nuxil: nice portable scope
10:40 AM nuxil: i like sopes with ctr screen
10:40 AM nuxil: *scopes
10:40 AM polprog: i like CRT screens in general
11:47 AM polprog: we managed to make the avr work :D
11:50 AM nuxil: ?
11:51 AM polprog: desperek's chip
11:52 AM nuxil: ahh. cool
11:52 AM nuxil: shine a blue light/laser at the die
11:52 AM polprog: hm?
11:52 AM nuxil: and see what happens
11:53 AM polprog: probably bad stuff
11:53 AM polprog: as blue light is highly energetic
11:53 AM nuxil: :)
11:53 AM polprog: shine a xenon flash lamp on your laptops screen ;)
11:54 AM polprog: a good camera flash can reset a chip
11:54 AM polprog: interesting attack vector
11:54 AM polprog: damn i have a book to read for school. Go away :D
11:54 AM nuxil: yes
11:54 AM nuxil: pi2/3 resets if you flash it
11:55 AM nuxil: with a blitz or bright light
12:27 PM desperek: woohoo!
12:27 PM polprog: so i swiped a bus ticket over my walkmans head
12:27 PM polprog: and looked at it on a scope
12:28 PM polprog: looks like multiple bursts of manchester code
12:36 PM Emil: sounds about right
12:36 PM polprog: i expected that
12:36 PM polprog: but seeing is believing
12:36 PM Emil: manchester is bad in that it halves your bitrate
12:37 PM Emil: but cool in that you get always on clock
12:37 PM polprog: i need to revise it
12:37 PM polprog: but thats later
12:37 PM Emil: Probably having a periodic sync signal is bettee
12:37 PM polprog: if i had a proper rig for that id read it better
12:37 PM polprog: now i gotta solve a cubic equation by hand
12:38 PM polprog: home work :<
12:39 PM skz81: over my walkmans head >> what ?? headphones you means ? that can read magnetic stuff ?
12:39 PM polprog: no
12:39 PM polprog: i have a tape deck
12:39 PM polprog: i wanted to take it apart to get just the reader head
12:39 PM polprog: but i didnt
12:40 PM polprog: i hooked up my scope to the headphone output
12:40 PM polprog: pressed play, and moved the mag stripe over the head
12:41 PM skz81: hu ok... Sounds more "classical"... Last time I learn you can acheive a spectrometer with a CD fragment and a classical web cam, I though it was a fake at first. Now i'm open to consider silly options :]
12:42 PM polprog: you gotta do with what you have
12:42 PM polprog: i wish i could get my hand on a ticket validator
12:42 PM polprog: im curious whats inside them
12:42 PM polprog: what cpu
12:43 PM polprog: wtc
12:43 PM polprog: etc*
12:43 PM skz81: nt, nt, You what to take the bus for free !!
12:43 PM skz81: :]
12:43 PM polprog: i have an rfid travel card
12:44 PM polprog: and im an ethical human being
12:44 PM polprog: although
12:44 PM polprog: a pocket ticket reprogrammer would be nice
12:44 PM polprog: but the machine prints all the stuff on the ticket anyways so its pointless
12:44 PM polprog: oh wait
12:45 PM polprog: its gonna be a quadratic equation, i made a mistek
12:46 PM polprog: damn its a cubic one anyways
12:46 PM polprog: how tf am i supposed to solve that by hand
12:46 PM polprog: we didnt have it yet
12:48 PM skz81: Once in 2nd year "college" we had a 7nd degree , 7 variables to solve as an exam. (teacher vengeance I guess). It was like 3 question. 1) write and solve the equation system (from an AmpOP circuitry). 2) U = R.I 3) Using the results of 1), do... whatever.
12:48 PM skz81: 99% of the "class" got 2 points, from question 2.
12:48 PM skz81: (me included, i'm not that mathematician)
12:48 PM skz81: No sorry, not 7nd degree
12:49 PM skz81: 7 equation system
12:49 PM polprog: hmm
12:49 PM polprog: any calculators or all by hand>
12:49 PM polprog: ?
12:50 PM skz81: all by hand ! I mean, the official and allowed "calculator" was very primitive. Mostly for cos, sin, and so on.
12:50 PM polprog: heh at least trig
12:51 PM polprog: on the final exam we are allowed to have a simple 4-operation calculator, optionally with square root
12:51 PM skz81: http://mycalcdb.free.fr/galerie/Casio/casio.fx-92_College_II.6.jpg <= this one
12:52 PM polprog: its pretty advanced
12:52 PM skz81: no help for solving equation systems
12:52 PM desperek: woo, advanced calc
12:54 PM skz81: I had a better one in high school :)
12:54 PM desperek: skz81, like, scientific calc or graphic one?
12:54 PM polprog: i have this oldie and the slightly newer one
12:54 PM polprog: https://puu.sh/zQ0mJ/4c83a6bcdd.jpg
12:55 PM polprog: im using the newer one at school. everybody has a similar newer model
12:55 PM polprog: we need them for physics
12:55 PM polprog: and so we use them on maths as well cos we wont carry two calcs lol
12:55 PM polprog: the older one is in the lab drawer
12:56 PM polprog: the graphing one has 32KB of memory!
12:56 PM polprog: that oughtta be enough for everyone!
12:56 PM skz81: desperek, yup graphic, and programmable. Not very advanced programmation facilities. But I wrote a program for a friend in literary class, that solved 2nd degree equation. Always good marks in maths for him
12:57 PM polprog: wait, it didnt have that in firmware?
12:57 PM skz81: (the teacher wasn't even supposing he used such a stuff.)
12:57 PM desperek: polprog, i have same second model for sure, i dont know about graphic but i have a similar
12:57 PM skz81: polprog, nope, not by that time !
12:57 PM polprog: desperek: that casio seems to be the TI-89 of Poland
12:58 PM polprog: everybody has one like that ;D
12:58 PM desperek: oh lol
12:58 PM skz81: that was very basic... Drawing function, zooming, basic programmation
12:58 PM polprog: and can you imagine that the newer models my friends have have less functions? no equation solver for example
12:58 PM polprog: not even linear
12:59 PM desperek: heh
01:00 PM desperek: https://a.uguu.se/D7xmtE2fRyWt.mp4 oh look at me!
01:00 PM polprog: skz81: i like the design of that one you posted
01:02 PM polprog: it seems they packed a ton of features
01:02 PM skz81: polprog, it was very robust. Mine felt many times, never broke. (not related, but... I even opened it and flipped the keys up-side-down, was ...fun...)
01:02 PM polprog: lol
01:02 PM polprog: yeah
01:02 PM polprog: ihave my casio for 10+ years now
01:04 PM skz81: polprog, I used it twice : before high school and after (in engineering school). Such a "regression", frustrating...
01:04 PM polprog: not much use in HS?
01:04 PM skz81: I had the graphic & programmable by that time (not this one !)
01:05 PM polprog: i like those
01:05 PM polprog: which one?
01:05 PM skz81: this one only display numbers (7-segments)
01:06 PM skz81: a casio too, but i don't remeber the model name... let me 2 seconds to google it
01:08 PM skz81: http://img.abrakaba.com/001C5DD9-0/Casio-Graph-60.jpg <= probably not this very model but it wpo as looking like that.
01:09 PM skz81: was*
01:09 PM wpo: huh
01:09 PM wpo: o
01:10 PM MrFahrenheit: polprog, I have a casio 9860g2
01:10 PM skz81: Never understood that my friend in literary class (and many other in his class) had that too !
01:11 PM skz81: probably some "deal" with french government (conspiracy !! :] )
01:54 PM polprog: skz81: looks just like mine ;)
01:54 PM polprog: MrFahrenheit: thats one model newer
01:55 PM polprog: heh nowadays graphing calcs run on cortex cpus and you can boot linux on them . lol
02:02 PM skz81: <polprog> skz81: looks just like mine ;) >> yup, but the processor is probably more powerful, and firmware, more featured :)
02:03 PM skz81: in yours I mean
02:03 PM skz81: <polprog> heh nowadays graphing calcs run on cortex cpus and you can boot linux on them . lol >> that
02:10 PM MrFahrenheit: polprog, I've got a $13 camera here with wifi that runs linux, so that's not saying much
02:10 PM polprog: some of them even have networkong
02:10 PM polprog: king*
02:11 PM polprog: you never wanted nmap on a calculator? :D
02:57 PM skz81: good night !
04:01 PM desperek: can i use avr to controll flow of 230v?
04:01 PM Emil: desperek: yes
04:01 PM Emil: of course
04:02 PM desperek: Emil, okay, how to :D
04:02 PM MrFahrenheit: naming really is the hardest part of programming
04:02 PM desperek: it indeed is MrFahrenheit
04:02 PM MrFahrenheit: desperek, use a relay
04:02 PM Emil: polprog: this is university :D https://emil.fi/d/2018-03-26_23-22-09_L18At76o.png
04:02 PM desperek: oof
04:02 PM desperek: polprog, do spania!
04:03 PM polprog: rofl
04:20 PM desperek: also
04:20 PM desperek: can somebody explain this syntax?
04:21 PM desperek: Emil, ?
04:21 PM Emil: desperek: hm?
04:21 PM desperek: Emil, like in topic
04:22 PM Emil: what about the topi?
04:23 PM desperek: Emil, like this |= and &= things
04:24 PM Thrashbarg: a |= b is the same as a = a | b
04:33 PM desperek: Thrashbarg, i dont follow, sorry. could you explain?
04:33 PM desperek: i mean
04:33 PM desperek: how does that relate to setting bits?
04:36 PM Thrashbarg: do you know what | and & do?
04:36 PM desperek: not really, but i believe these are XOR or something? Thrashbarg
04:37 PM Thrashbarg: | is OR, & is AND, ^ is XOR
04:38 PM Thrashbarg: so if we're using the OR function, as in a = a | b, any bit set in a OR b becomes set and written back to a
04:38 PM desperek: oh
04:39 PM Thrashbarg: if a is a port, then whatever bits are set in b will set the bits in the port
04:40 PM desperek: hm
04:40 PM Tom_L: or and and
04:41 PM desperek: eh
04:41 PM desperek: so how does that comply with 1<<BIT
04:41 PM Tom_L: shift 1 into BIT position
04:42 PM Thrashbarg: 1 is shifted BIT digits to the left. so if you want to set BIT 3, 1 is shifted to become 0b0001000
04:42 PM Thrashbarg: and that is then ORed with the data already in the port
04:42 PM desperek: oh thats awful example :D
04:42 PM Thrashbarg: eh?
04:43 PM lvlinux: awful?
04:43 PM desperek: i dont see why would you need OR anyways, or how does that work,
04:43 PM desperek: as for the example
04:43 PM lvlinux: I thought it was pretty good.
04:43 PM desperek: bits shift from right to left?
04:43 PM lvlinux: LSB is on right, so yes.
04:43 PM desperek: w-what's LSB?
04:43 PM lvlinux: least significant bit
04:43 PM Tom_L: least significant bit
04:43 PM lvlinux: :)
04:43 PM desperek: ah, right
04:44 PM Tom_L: LDS is entirely something else
04:44 PM desperek: so the 1 that makes 1
04:44 PM Tom_L: LSD
04:44 PM Thrashbarg: desperek: if you didn't OR the data, if you just loaded that number to the port, it would clear any other bits that might be set
04:44 PM desperek: oh that makes sense now!
04:44 PM desperek: so it would be:
04:44 PM desperek: 0x0100000
04:44 PM desperek: 0x0001000
04:45 PM desperek: ---
04:45 PM Thrashbarg: 0b not 0x
04:45 PM lvlinux: 0x means hex
04:45 PM desperek: oh right
04:45 PM desperek: ye i see now
04:45 PM Thrashbarg: x is hexadecimal
04:45 PM desperek: so ~ makes it negative, right?
04:45 PM Thrashbarg: yes
04:45 PM desperek: okay that makes so much sense now
04:46 PM desperek: thank you very much!
04:46 PM Thrashbarg: cool
04:46 PM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/avr/c_bits/bits_index.php
04:46 PM Tom_L: desperek
04:46 PM desperek: mhm, thanks
04:57 PM desperek: Thrashbarg, oh, what about input?
05:02 PM Thrashbarg: you AND the bit you want, if the result is non-zero, the bit was set
05:08 PM desperek: Thrashbarg, i dont understand
05:09 PM Thrashbarg: if (PINA & (1<<bit)) { whatever }
05:10 PM Thrashbarg: PINA being the input port, 1 gets shifted left bit bits. If that bit is set in PINA, the result will have a 1 in it, that is it's non-zero
05:10 PM Thrashbarg: so the if statement will run
05:11 PM desperek: oh okay
05:11 PM desperek: thanks again
05:11 PM Thrashbarg: np
05:12 PM polprog: i should write a serial in avr and linux guide
05:13 PM lvlinux: polprog: do it!
05:13 PM polprog: tomorrow ;)
05:13 PM polprog: damn. i finish at 1500 tomorrow
05:14 PM polprog: i have to be there at 0715
05:14 PM polprog: that leaves me to wake up at 0600
05:14 PM polprog: and its midnight
05:14 PM polprog: so
05:14 PM polprog: goodnight
05:14 PM lvlinux: g'night.
05:14 PM polprog: ive noted down the serial guide idea though
05:15 PM lvlinux: :)
05:15 PM polprog: so ill probably start writing it tomorrow
05:24 PM MrFahrenheit: desperek, once you've mastered bit setting, try these http://realtimecollisiondetection.net/blog/?p=78
05:24 PM desperek: gnight polprog
05:24 PM desperek: im going to sleep as well!
05:24 PM desperek: thanks MrFahrenheit
05:26 PM MrFahrenheit: I'm mostly joking, you don't need to know those
05:58 PM Emil: desperek: you shpuld know the basics of c before you program avrs
07:05 PM lvlinux: Emil: or assembly :)
11:58 PM polprog: lvlinux: Emil: theres also bascom basic to choose from
11:59 PM day__ is now known as day