#avr Logs

Feb 18 2017

#avr Calendar

12:25 AM daey_ is now known as daey
08:58 AM yids_: hm i want to set some fuses in my atmega1284 with something like " avrdude -P /dev/ttyUSB1 -p atmega1284p -U hfuse:w:0x99:m -v"
08:58 AM yids_: but it tells me i need to specify a programmer, but normally i just program it via the ftdi
08:58 AM Casper: fuse need a real programmer, not a bootloader
08:59 AM _ami_: -c <programmer type>
08:59 AM _ami_: Casper: yeah, bootloader can't set fuses
09:00 AM yids_: but uh
09:00 AM yids_: hm i have a (fake) jtag ice thing could i use that?
09:00 AM yids_: it does say that in the list
09:00 AM yids_: but i thought it was not a programmer
09:04 AM Emil: Hmm
09:04 AM Emil: Anyone know of a good guide to i2c on avr?
09:04 AM _ami_: http://exploreembedded.com/wiki/Basics_of_I2C_with_AVR
09:05 AM _ami_: http://www.ermicro.com/blog/?p=744
09:06 AM yids_: its this board im using http://support.sodaq.com/sodaq-one/sodaq-mbili-1284p/
09:07 AM _ami_: fancy board :)
09:09 AM _ami_: i have a usbasp programmer.. so if i have to set the fuses, i would just find mosi/miso/sck/rst and connect my programmer to it. https://pbs.twimg.com/media/C40AEUnWYAEKlpf.jpg:large
09:10 AM _ami_: be careful while setting fuses, make sure bootloader section is enabled with whatever fuse you plan to use.
09:14 AM yids_: okay but so do i need a programmer? sorry im a bit new to this and a lot of the terms dont immeditaley make sense to me. "bootloader cant set fuses", that means i can not set fuses via the ftdi?
09:15 AM Emil: yids_: yes
09:15 AM PolishProgrammer: execute 'avrdude -c ?' to get a list and pick yours
09:15 AM Emil: yids_: though you "might be able to" abuse the ftdi
09:15 AM Emil: to set the fuses
09:16 AM yids_: yeah but i dont have a programmer
09:16 AM yids_: i think
09:17 AM PolishProgrammer: what do you use to program the avrs
09:17 AM yids_: the builtin ftdi?
09:17 AM PolishProgrammer: what's that?
09:17 AM Emil: yids_: if you have another avr you can use it as a programmer, too
09:17 AM Emil: to set the fuses
09:17 AM yids_: ah
09:17 AM PolishProgrammer: ahhh, an uart usb converter?
09:17 AM yids_: PolishProgrammer: im not sure, it just has a usb port and i flash to there :P
09:18 AM yids_: yes
09:18 AM PolishProgrammer: so its a dev board?
09:18 AM yids_: yes
09:18 AM yids_: http://support.sodaq.com/sodaq-one/sodaq-mbili-1284p/
09:18 AM PolishProgrammer: im afraid that can be hard to manipulate the fuses
09:18 AM yids_: hmz
09:18 AM PolishProgrammer: you can get avr programmer for peanuts
09:18 AM yids_: im not even sure if i need to
09:18 AM PolishProgrammer: search how to make a paralell port avr programmer
09:19 AM yids_: i read http://ardupilot.org/dev/docs/jtag.html here that at least on the 1280 by default the jtag is disabled by a fuse
09:19 AM yids_: can i read the fuses via the ftdi or do i also need a programmer for that?
09:19 AM PolishProgrammer: weird
09:19 AM PolishProgrammer: no, you need a programmer
09:19 AM PolishProgrammer: ftdi is an uart-usb converter
09:19 AM PolishProgrammer: it communicates with the program
09:20 AM PolishProgrammer: on the micro
09:20 AM PolishProgrammer: you need to go one level deeper
09:20 AM yids_: so what do i speak to on the micro? the spi interface?
09:21 AM PolishProgrammer: this is the cheapest programmer
09:21 AM PolishProgrammer: https://www.google.pl/amp/www.instructables.com/id/Simplest-AVR-Parallel-port-programmer/%3Famp_page%3Dtrue
09:21 AM PolishProgrammer: normally the programmer talks with the internal logic
09:21 AM Lambda_Aurigae: yids_, what fuses are you wanting to change? they could screw up your bootloader.
09:21 AM yids_: uhm the ones that enable jta
09:21 AM yids_: g
09:21 AM PolishProgrammer: to flash the mem, set fuses etc
09:21 AM yids_: debugging
09:22 AM yids_: but im not even sure if they are disabled
09:22 AM Lambda_Aurigae: ok..that shouldn't break anything.
09:22 AM PolishProgrammer: it pulls down the RESET' pin and then the logic works different than normal operation
09:22 AM Lambda_Aurigae: reading fuses with bootloader is going to be hit and miss...depending on if the bootloader handles it.
09:22 AM PolishProgrammer: make sure to calculate the proper values
09:23 AM PolishProgrammer: for hfuse and lfuse
09:23 AM Lambda_Aurigae: ok..off to spend time wif da wifey.
09:23 AM PolishProgrammer: la, have fun
09:24 AM PolishProgrammer: if the board has reset and spi broken out (available) then you can reprogram the fuses with the avr
09:24 AM PolishProgrammer: with the programmer *
09:24 AM PolishProgrammer: mistake ;)
09:24 AM PolishProgrammer: see that link, or you can get USB ASP
09:25 AM PolishProgrammer: for less that a couple bucks
09:25 AM yids_: allright
09:26 AM PolishProgrammer: avrdude takes byte values for fuses, read them first and calculate
09:37 AM _ami_: yids_: buy usbasp programmer < 2$
09:38 AM yids_: yeah that is probably a good idea, but i`d like to start debuging my code right now ;)
09:38 AM _ami_: but be careful while setting up fuses. it might screw ur bootloader
09:39 AM yids_: anyway, im not even sure if the fuses are disabled, im just trying to run avarice and gdb now,
09:39 AM yids_: Failed to synchronise with the JTAG ICE (is it connected and powered?)
09:39 AM yids_: that seems to be a different problem
09:39 AM yids_: i guess
10:29 AM Ad0: is it possible to just use arduino libraries and continue using AVRISP and atmel studio?
10:29 AM Ad0: or does it require a whole different setup?
10:30 AM Ad0: it's so annoying that all the stuff I need is arduino and not AVR
10:31 AM PolishProgrammer: which libs do you need?
10:32 AM PolishProgrammer: i found that there are many barebones avr libs based on arduino libs
10:32 AM PolishProgrammer: its possible to flash arduino bootloader and stuff
11:33 AM Duality: Ad0: probably yes, if you get it compiled and linked the right way.
11:33 AM Emil: Ad0: sure is
11:34 AM Emil: Ad0: you just need to include Arduino.h also
11:34 AM Emil: "Arduino" IDE is just a wrapper on avr-gcc; libc, bintools and avrdude
11:43 AM antto: and i just stay away from this arduino sh*zzle
11:50 AM PolishProgrammer: i purposedly did not buy arduino
11:50 AM PolishProgrammer: i thought uts a toy for children
11:51 AM PolishProgrammer: and expensive as hell
11:51 AM PolishProgrammer: 30 euro for a microcontroller
11:51 AM PolishProgrammer: atmega 16 was 8 pln which 2 quid
11:54 AM specing: remember that you are also paying for software R&D with it
11:59 AM Duality: arduino board is handy to have sometimes :) but i never use the ide, i always program it with avr-libc directly :)
12:00 PM Duality: besides you can get the boards pretty cheap from china
12:00 PM specing: indeed
12:01 PM chisight: the china clones are often cheaper than a chip and crystal.
12:02 PM rue_house: arduino board runs less than $1.50usd and usually has a regultor, osc chip and reset
12:03 PM PolishProgrammer: i think that the most expensive part might be the ftdi converter
12:03 PM rue_house: on some unos, I have to take off the internal usb->serial and make up an opto-isolated one
12:03 PM rue_house: PolishProgrammer, CH340
12:03 PM rue_house: nobody needs ftdi anymore
12:04 PM PolishProgrammer: opto isolated usb-serial?
12:04 PM PolishProgrammer: how much is that ch340?
12:04 PM rue_house: its free with the $2 arduino
12:05 PM Ad0: hey
12:05 PM Ad0: PolishProgrammer: emon library
12:05 PM PolishProgrammer: i saw original arduino uno on maker faire for 30 euros
12:05 PM Ad0: http://lechacal.com/wiki/index.php/RPICT3V1
12:05 PM rue_house: https://www.aliexpress.com/item/high-quality-One-set-UNO-R3-CH340G-MEGA328P-for-Arduino-UNO-R3-NO-USB-CABLE/32697443734.html
12:05 PM rue_house: there is an expensive one
12:05 PM Ad0: http://lechacal.com/RPICT/CT3V1/RPICT3V1_v1_0.ino
12:05 PM PolishProgrammer: maybe the fact it was maker faire made it so expensive
12:05 PM Ad0: there's some nice string formatting and serrial stuff there
12:06 PM Ad0: I ported the calcIrms to AVR anyway.
12:06 PM PolishProgrammer: youre contributing to that?
12:06 PM PolishProgrammer: cool lib
12:07 PM Ad0: I mean what is pin 0
12:07 PM Ad0: lol
12:07 PM Ad0: it's something arduino knows
12:07 PM Ad0: PolishProgrammer: well not contributing exactly but making my own version work on an attiny45
12:07 PM Ad0: which I did
12:07 PM PolishProgrammer: im completely green on arduinos
12:07 PM Ad0: instead of outputting float with 2 decimals, I output a uint16_t * 100
12:07 PM Ad0: and then I can convert back on decimals.
12:08 PM rue_house: I have to opto-isolate the usb cause the devices are on different circuits and when there is a power bump, the connection causes the usb to lock up
12:08 PM PolishProgrammer: Ad0, i made my first lib for a 74hc595
12:08 PM Ad0: kk
12:08 PM Ad0: I can post my source so far
12:08 PM PolishProgrammer: it was my first so i did look at existing ones ;)
12:09 PM PolishProgrammer: i think the int solution is better for avrs
12:09 PM Ad0: http://pastebin.com/mA8FWE8Q
12:09 PM PolishProgrammer: especially attinies
12:09 PM Ad0: i2bcd has the wrong name
12:09 PM Ad0: lol
12:09 PM Ad0: fastest way I could pad 0s to ensure fixed string length
12:10 PM PolishProgrammer: why are you increasing the idx inside the ifs?
12:11 PM PolishProgrammer: oh wait i see :D
12:11 PM PolishProgrammer: brainfart
12:14 PM rue_house: PolishProgrammer, did you bit bang it or use a hardware system?
12:15 PM rue_house: yay, itoa on a avr eh?
12:15 PM rue_house: heh
12:15 PM rue_house: this is for an '85?
12:16 PM rue_house: its got room for the math library?
12:18 PM Duality: Ad0: what is calcIrms ?
12:20 PM specing: itoa is not that big
12:21 PM rue_house: filteredI = 0.996*
12:21 PM rue_house: just that will push the code size up like 12k
12:21 PM rue_house: cause then its using the floating point math library, and thats big
12:25 PM rue_house: >:| I cant name the first variable in my program 0, damnit
12:30 PM PolishProgrammer: rue_house, what do you mean?
12:31 PM PolishProgrammer: i once used sqrt and my bytecode grew twicr
12:31 PM rue_house: write a program that does 10/2 and prints the result, note the size of it
12:31 PM rue_house: then write a program that does 10*0.5, and prints the result, note the size of it
12:32 PM PolishProgrammer: do i bitbang what?
12:32 PM rue_house: I dont THINK the optimizer will catch it
12:32 PM rue_house: the 595 library
12:32 PM PolishProgrammer: yeah,
12:32 PM PolishProgrammer: i dont have it now, i should put it up on GH
12:33 PM rue_house: http://paste.debian.net/915372/
12:33 PM PolishProgrammer: fun fact, the ++ instruction was because optimizers were stupid and did not know that a+1 could be done with a single assembly call
12:33 PM rue_house: does the core of it look a lot like that?
12:34 PM PolishProgrammer: it was all in a single method
12:34 PM rue_house: oh you insane OOP people
12:34 PM PolishProgrammer: a loop that set the bit and pulsed the clock
12:34 PM PolishProgrammer: man, its 1 loop
12:34 PM PolishProgrammer: funfact2: java was my first language
12:34 PM rue_house: http://paste.debian.net/915373/
12:34 PM rue_house: I suppose I cant post that code without the .h file contents
12:35 PM PolishProgrammer: now that makes sense
12:36 PM PolishProgrammer: where is SetBit defined? did you define it?
12:36 PM rue_house: because of the fact you can string 595, its not got the latch in it, you can clock out as many sets of 8 bits as you want
12:36 PM PolishProgrammer: yeah i know
12:36 PM rue_house: its part of avrcommon.h
12:36 PM rue_house: casue I use it everywhere
12:36 PM PolishProgrammer: is avrcommon.h a libc or yours
12:37 PM rue_house: mine
12:37 PM PolishProgrammer: i patched it so you can define if you latch it or not
12:37 PM rue_house: http://paste.debian.net/915374/
12:37 PM rue_house: thast a nice approach
12:37 PM rue_house: hmmm
12:37 PM PolishProgrammer: after i needed to chain 2 595s on one board
12:38 PM rue_house: maybe I'll go for that
12:38 PM PolishProgrammer: hey that file is handy :
12:38 PM PolishProgrammer: :)
12:39 PM PolishProgrammer: is that paste persistent?
12:39 PM PolishProgrammer: i need to use more preprocessor directives
12:42 PM Ad0: rue_house: yeah
12:42 PM Ad0: Duality: it's basically to calculate an average with low pass filter the current
12:43 PM Ad0: right now I don't have any sensor so I just loop
12:43 PM Ad0: what I wonder is how do I map pin(1) to pure AVR code
12:43 PM Ad0: http://lechacal.com/RPICT/CT3V1/RPICT3V1_v1_0.ino as you see the current(0), current(1), current (2)
12:44 PM Ad0: the argument is the pin no.
12:44 PM Ad0: and that's an arduino thing
12:44 PM PolishProgrammer: well check the corresponding pins on arduino
12:44 PM Ad0: analogRead(inPinI);
12:44 PM Ad0: which is 0,1,2
12:44 PM Ad0: where do I check that, it's an attiny84
12:44 PM PolishProgrammer: oh
12:45 PM Ad0: so it runs on arduino platform but is not one
12:45 PM PolishProgrammer: analog pin
12:45 PM PolishProgrammer: so read adc
12:45 PM Ad0: is it like adc 0 ?
12:45 PM Ad0: or is it mapped through some magic
12:45 PM PolishProgrammer: probably, you can always mod it to read from adc directly not from some 'pin 0'
12:46 PM Ad0: http://highlowtech.org/wp-content/uploads/2011/10/ATtiny44-84.png
12:47 PM PolishProgrammer: thats what i dont like about arduinos, the unneeded HAL
12:47 PM PolishProgrammer: Ad0 yes the pins labeled analog are the adc
12:47 PM Ad0: yes
12:47 PM PolishProgrammer: which in the orig docs are called ADCx
12:48 PM Ad0: so is it a 1:1 relationship there?
12:48 PM PolishProgrammer: yes
12:48 PM Ad0: thank god
12:48 PM PolishProgrammer: so analog 0 is pin PA0, pin 13 on the chip
12:49 PM Ad0: http://highlowtech.org/wp-content/uploads/2011/10/ATtiny45-85.png
12:49 PM rue_house: sorry, I'm back. Yea, I put macros in there that shoudl otherwise exist
12:49 PM Ad0: what about this one
12:49 PM rue_house: avrcommon.h is part of almost every project
12:49 PM PolishProgrammer: this one seems to have only three adc inputs
12:49 PM PolishProgrammer: check the orig datasheet from atmel with official pin names
12:49 PM Ad0: yeah
12:50 PM PolishProgrammer: arduinoelettronica.files.wordpress.com/2012/02/attiny85_pinout.png
12:50 PM Ad0: https://i.imgur.com/JPFRpTa.png
12:50 PM PolishProgrammer: thats a screenshot from the datasheet
12:51 PM Ad0: yeah
12:51 PM Ad0: I took it:)
12:52 PM PolishProgrammer: i see ;)
12:52 PM rue_house: hmmmm serial over ethernet
12:52 PM Ad0: so on this one it starts on ADC1
12:53 PM PolishProgrammer: probably yes
12:53 PM PolishProgrammer: ive never used any tinies
12:53 PM Ad0: SOFT_UART_TX_PORT - PORTB
12:53 PM Ad0: SOFT_UART_TX_PIN - PB0
12:54 PM PolishProgrammer: bear in mind this has only 6 gpio
12:54 PM Ad0: I guess that doesn't conflict with ADC1,2,3
12:54 PM PolishProgrammer: pb 0 is analog reference voltage, AREF
12:54 PM PolishProgrammer: you may choose the internal reference tho
12:54 PM Ad0: is it technically possibleto have the AVRISP and everything hooked up to the attiny45 and still read analog values?
12:54 PM PolishProgrammer: it was not very accurate on mega 16
12:55 PM PolishProgrammer: but it works
12:55 PM Ad0: I tuned it's oscillator
12:55 PM PolishProgrammer: try PB1
12:55 PM Ad0: with an actually oscilloscope
12:55 PM PolishProgrammer: i never tuned any
12:55 PM PolishProgrammer: i need to try it
12:55 PM PolishProgrammer: :)
12:56 PM Ad0: http://lechacal.com/RPICT/3CT/RPICT3_v1_4.ino this is the original source I ported from
12:56 PM Ad0: http://lechacal.com/RPICT/7CT1V/SendOnlySoftwareSerial.zip
12:57 PM PolishProgrammer: im on mobile but its just soft uart, right?
12:57 PM PolishProgrammer: no big deal
12:57 PM PolishProgrammer: :)
12:59 PM Ad0: just checking what pin it went to
01:00 PM Ad0: SendOnlySoftwareSerial mySerial(0) - pin 0 ?
01:00 PM PolishProgrammer: might be
01:00 PM PolishProgrammer: you are porting it on another micro
01:01 PM Ad0: internally it's digitalWrite(0)
01:01 PM PolishProgrammer: so its this complicated
01:01 PM Ad0: so what oes that mean
01:01 PM Ad0: it has to be pin 5
01:01 PM Ad0: does digitalWrite in arduino set the pin's configuration every time?
01:01 PM PolishProgrammer: i dont know but you can modify it to use your available pin
01:02 PM PolishProgrammer: i dont know :)
01:02 PM Ad0: hehe
01:02 PM Ad0: I don't like arduino
01:02 PM Ad0: :)
01:02 PM PolishProgrammer: i dont even have an arduino :P
01:02 PM Ad0: but there are too many libraries written for it
01:02 PM Ad0: me neither
01:02 PM Ad0: http://code.google.com/p/arduino-tiny/
01:02 PM PolishProgrammer: i think that they may be bloaty
01:02 PM Ad0: it needs that core
01:02 PM Ad0: is it a bunch of header files?
01:02 PM PolishProgrammer: the original libs
01:03 PM PolishProgrammer: may be some .cpp files too, if they are using OOP
01:04 PM Ad0: yes
01:04 PM Ad0: https://sites.google.com/site/elettronicaarduinoesperimenti/Home/arduino-ide-and-attiny45
01:04 PM PolishProgrammer: you are working with mains so be careful
01:04 PM PolishProgrammer: too
01:04 PM Ad0: the sensors are non-invasive CT clamps
01:04 PM Ad0: it goes around the wire
01:05 PM Ad0: or else I would probably be dead
01:05 PM Ad0: http://guide.openenergymonitor.org/setup/
01:07 PM PolishProgrammer: i dont know how arduino handles the whole hardware abstaction layer, how digital pin 0 is mapped to a gpio on the micro
01:07 PM PolishProgrammer: etc.
01:07 PM Ad0: also is OSCCAL permanent?
01:07 PM PolishProgrammer: should be
01:07 PM PolishProgrammer: its stored inside the mcu
01:07 PM Ad0: PolishProgrammer: I think that's decided through the "board" configurations
01:08 PM PolishProgrammer: might be
01:08 PM Ad0: I will just load up another project and see if this library will work
01:08 PM Ad0: maybe it's only an arduino *library* and not a bootloader etc
01:09 PM Ad0: bloat annoys me
01:09 PM PolishProgrammer: gotta order some parts for the reflow oven
01:14 PM Ad0: I'll try it
01:15 PM Ad0: LOL! it already has it in atmel studio 7
01:18 PM enhering: Hi
01:18 PM enhering: good afternoon
01:18 PM enhering: 1600 in the NE of Brazil
01:20 PM PolishProgrammer: lol, that maxim thermocouple sensor costs 36 pln at tme and 18 pln at mouser
01:24 PM Emil: Ad0?
01:25 PM Emil: OSCCAL permanent what,
01:25 PM Emil: ?
01:27 PM JanC is now known as Guest5849
01:27 PM JanC_ is now known as JanC
01:28 PM PolishProgrammer: can you quickly advise me on a low power 3.3 v linear reg?
01:28 PM PolishProgrammer: for that maxim thermocouple amplifier
01:28 PM PolishProgrammer: so low noise
01:31 PM Jartza: evening
01:31 PM Ad0: Emil: that if you set it you don't need to set each time you power up
01:31 PM Ad0: I found out that the value needs to be 0x90
01:32 PM Emil: Ad0: wat
01:32 PM Emil: Ad0: OSCCAL is like any register on the device
01:32 PM Emil: Your code needs to adjust it on startup
01:35 PM PolishProgrammer: pardon me then
01:35 PM PolishProgrammer: ;)
01:37 PM Ad0: ok
01:37 PM Ad0: I have seen these self-calibrating snippets
01:37 PM Ad0: are they any good?
01:42 PM Emil: If they work they work
01:43 PM Emil: Is this for a serial communication scheme?
01:43 PM Emil: I recommend implementing framing
01:43 PM Ad0: yes
01:43 PM Emil: But calibrating once is pretty much always enouh
01:45 PM Ad0: yeah
01:50 PM Emil: I just use the pb0 output and adjust by hand
01:51 PM Emil: but using serial calibration is easy enough
02:29 PM PolishProgrammer: see you
02:38 PM Ad0: I made arduino core work
02:38 PM Ad0: and of course it will I just flash everything
02:43 PM plouf: hey guys
02:44 PM plouf: i always had to CLEAR before flash, otherwise program did NOT work
02:44 PM plouf: is this true or i do something wrong
02:45 PM cehteh: clear what?
02:46 PM plouf: erase chip
02:46 PM cehteh: flash cells need to be erased prior programming, programming flips the bits only in one direction (from 1 to 0)
02:47 PM plouf: therefore programing ONLY over a programmed chip produce fault code ?
02:47 PM cehteh: but when you speak about flashing a program, the programmer/avrdude should care of that
02:47 PM cehteh: chip erase depends on a fuse, there is a mode where it clears EEprom as well or not
02:48 PM cehteh: normally you dont need to call an explicit chip erase its implied when you flash a program
02:49 PM cehteh: iirc you can turn that off, check avrdude manpage, usually you dont want that
02:49 PM cehteh: aka let it automatically erase the chip/pages to be programmed
02:49 PM cehteh: do you use the eeprom?
02:49 PM plouf: so avrdude send's a "chip erase" command by itself when i pres "flash" ?
02:49 PM plouf: rarely
02:50 PM cehteh: yes
02:50 PM cehteh: unless you explicitly disable that
02:50 PM plouf: so a chip erase is mandatory in order to corect program chip
02:50 PM Jartza: plouf: "empty flash" is chip that contains only bits 1
02:50 PM cehteh: and bootloaders may have different ideas :)
02:51 PM cehteh: its not mandatory, but you need to know what you are doing when you are turning it off
02:51 PM Jartza: so it's 0b11111111 in every location. and when you flash it, the bits can only be switched to zeroes without erase
02:51 PM plouf: question is "if i flash a avr without erase it first will it program correctly "?
02:51 PM plouf: from what you said i concude
02:51 PM cehteh: for example instead full erase you can page wise erase only where you write and even more check first if it is already erased
02:52 PM Jartza: some better bootloaders even compare the data to see if the page needs to be programmed at all
02:52 PM cehteh: you dont need to erase 'explicit' as it is implicit, unless you turn that off
02:52 PM Jartza: or erased
02:52 PM cehteh: yes
02:53 PM plouf: up to now i only flash program on avr WITHOUT bootloader
02:53 PM Jartza: that'll save flash from degrading
02:53 PM cehteh: to make it simple: something has to erase the page, yes. but usually thats not you, avrdude cares
02:53 PM Jartza: but usually it's not problem if you're not going to program your avr thousands of times
02:53 PM plouf: i will double check, mabe its the programmer disadvantage then
02:54 PM cehteh: stale data (or accidentally deleted configuration data) in eeprom can sometimes be problems ... you need to care for that
02:54 PM plouf: i use SPI programming
02:54 PM plouf: (question number 2)
02:56 PM plouf: and when trying to program some fuses
02:58 PM plouf: like "Reset disable" it fails
02:59 PM plouf: and.or spi disable
03:01 PM cehteh: be lucky
03:02 PM cehteh: read datasheet again and be happy that you didnt bricked your chip yet
03:02 PM plouf: it just switch back to " enable"
03:02 PM plouf: programing etc works
03:02 PM cehteh: when you enable reset-disable, then you cant programm the the chip anymore with SPI
03:02 PM plouf: correct
03:03 PM cehteh: and the fuses are latched, next powercycle and you woul'd been doomed
03:03 PM cehteh: -> datasheet
03:03 PM plouf: i first flash it sccefully
03:03 PM cehteh: why do you want to do that anyway?
03:03 PM plouf: then i fuse "disable programming of flash"
03:03 PM plouf: the fuse programmed correct
03:04 PM cehteh: there are some reasons to disable reset and spi, but its more pain in the butt
03:04 PM plouf: then i try to program "disable reset" (since reset pin is used as input)
03:04 PM cehteh: which avr? a tiny?
03:04 PM plouf: yes tiny85/ tiny2313
03:05 PM plouf: i DO NOT want to program it after this step
03:05 PM cehteh: do you desperately need the reset as io ping?
03:05 PM cehteh: famous last words :)
03:05 PM plouf: hehe
03:05 PM cehteh: until you find a bug or have some improvement
03:05 PM plouf: dont care
03:05 PM plouf: new chip will replace it
03:06 PM cehteh: i sometimes use the reset pin for a button input without disabling reset
03:06 PM cehteh: .. that is, when booting i just detect if reset was pressed and handling that as button press
03:07 PM cehteh: far less pain than disabling reset completely
03:07 PM cehteh: for less used buttons, like a "calibrate' button or such anyway
03:07 PM plouf: i really dont care in this specific project
03:08 PM cehteh: well then try again disable reset/spi .. maybe you need to disable some avrdude safety net (check manpage)
03:08 PM cehteh: powercycle after you changed the fuses .. booom
03:09 PM cehteh: avrdude has some safetys for fuses
03:15 PM yids_ is now known as yids
03:17 PM plouf: i ussualy use a GUI to avrdude and/or bascom internal pragrammer basically never through cli :)
03:17 PM Lambda_Aurigae: kids and their gooies!
03:18 PM plouf: windooze stuff
03:20 PM Lambda_Aurigae: bingoids
03:21 PM Lambda_Aurigae: but, you can run avrdude from command line on winblows too.
03:22 PM Lambda_Aurigae: I have a bunch of girls with mac computers that want to learn electronics, microcontrollers, and robotics this summer.
03:22 PM Lambda_Aurigae: 12 to 14 year old girls.
03:22 PM Lambda_Aurigae: at least 4 of them, maybe as many as 8
03:23 PM Lambda_Aurigae: gonna have to modify my curriculum to work everything on mac.
03:23 PM Lambda_Aurigae: because I don't have enough PC laptops for them all.
03:26 PM plouf: are they going to learn AND continue to work with these stuff ? or just learn and forget?>
03:27 PM Lambda_Aurigae: dunno.
03:27 PM Lambda_Aurigae: they are all interested in learning
03:27 PM Lambda_Aurigae: so I will teach.
03:28 PM plouf: :)
03:34 PM plouf: is there a change tha my STK500 is too old ? avrdude only reads with "STK500" NOT "STK500 v1"
03:35 PM Lambda_Aurigae: my stk500 works with avrdude still.
03:35 PM Lambda_Aurigae: there is a v1 and v2 for that..minor changes in the protocol.
03:37 PM cehteh: avrdude gui? :D
03:37 PM Lambda_Aurigae: cehteh, yeah, there are a couple of them out there,,mostly for winblows.
03:38 PM plouf: i use SinaProg
03:41 PM plouf: seems tha no fusebit programming is accepted after memory lock
03:41 PM plouf: clear chip clears all fuses too
03:42 PM plouf: but is NOT accepting lock + disable reset at the same step
03:42 PM cehteh: -> datasheet
03:42 PM cehteh: i mean you can try'n'error all day around, but you dont need to report this here
03:43 PM plouf: sorry.
03:43 PM plouf: just wondering if anyone has any idea
03:43 PM cehteh: the tiny85 datasheet explains the order fuses are latched and set and avrdude has some stuff about that too
03:44 PM cehteh: yes the idea is that i remmeber that its is written down in the datasheet, but i cant recall the details
03:44 PM Lambda_Aurigae: clear chip doesn't clear all fuses far as I know..just the ones that are used for chip lock.
03:44 PM cehteh: so me or you, one of us has to read the datasheet, guess who would be more approbiate with this problem
03:44 PM cehteh: yes
03:46 PM Lambda_Aurigae: I think ISP can't be disabled by ISP...not sure about disabling reset through ISP on that particular chip.
03:47 PM enhering: Hi
03:47 PM enhering: Anybody has seen carabia?
03:47 PM cehteh: iirc both is possible, just beeing latched and need a powercycle .. but maybe i am wrong, did i mention that it is explained in the datasheet?
03:47 PM enhering: Or knows if he is around with another nick?
04:23 PM PolishProgrammer: i have never worked with voltages of millivolts
04:24 PM PolishProgrammer: are there any pcb design dos and don'ts when designing that sort of things?
04:24 PM plouf: and?
04:24 PM PolishProgrammer: ill stick a cap across the thermocouple input
04:24 PM PolishProgrammer: obviously
04:25 PM Chillum: I find isolating the ground with a cap very close to the TC ground's input is important
04:31 PM PolishProgrammer: so thermocouple's negative should be connected via a cap to ground, is that what you mean?
04:33 PM Chillum: it is the same ground, but connected to TC+ with a cap right near where it inputs
04:33 PM Chillum: I just did as recommended by the MAX6675 datasheet
04:34 PM specing: enhering: carabia was kicked/banned and has not returned yet
04:34 PM Chillum: what are you using to read the TC?
04:34 PM PolishProgrammer: i just finished reading it ;)
04:34 PM PolishProgrammer: the max31855
04:34 PM Chillum: I know the MAX6675 has been deprecated for
04:34 PM Chillum: yes that is it
04:35 PM PolishProgrammer: i found the 6675 and its indeed deprecated
04:35 PM Chillum: I have one in my solder over control board
04:35 PM Chillum: have not bothered to update the design for the 31885
04:35 PM Chillum: 31855
04:36 PM PolishProgrammer: i never heard of that kind of board, what's it used for?
04:36 PM PolishProgrammer: iron thermometer?
04:36 PM Chillum: it is my own board. I controls an oven for surface mount soldering
04:37 PM Chillum: baking boards
04:37 PM Chillum: I said "solder over" I meant "solder oven"
04:37 PM Tom_itx: http://tom-itx.no-ip.biz:81/~webpage/toaster_oven/toaster_oven_index.php
04:37 PM Tom_itx: like that
04:37 PM PolishProgrammer: actually im designing the same thing for my "oven" :D
04:39 PM Chillum: let me take a screenshot of my schematic
04:40 PM PolishProgrammer: i consider myself semi-intermediate in avrs, but i just want to avoid rookie mistakes
04:40 PM PolishProgrammer: suprisingly many people have their own reflows
04:40 PM Chillum: This is what I ended up with, it actually worked: images.highinbc.com/solder_oven_rev_h.png
04:41 PM Tom_itx: my schematics should be up there
04:41 PM Tom_itx: i used a 328
04:41 PM Tom_itx: but any 48 88 etc would work fine
04:41 PM Chillum: it has a port that an FTDI board and stick right into and it auto-programs like a nano
04:42 PM Chillum: RGB LED, buzzer, serial inteface for nextion display screen, TC reader, and a rotary encoder for user input
04:42 PM Chillum: It ended up b eing a combo of surface mount and through hole and I used both sides of the boards
04:43 PM Chillum: had to be soldered in just the right order with a combo of hot air and an iron
04:43 PM Chillum: first attempt at a complexish board
04:43 PM PolishProgrammer: cool
04:44 PM Chillum: final board looked like this: https://oshpark.com/shared_projects/cItf3Ja4
04:44 PM PolishProgrammer: i have a similiar idea, an avr takes the tc readings via that maxim and switches the heater on or off via a relay. plus a hd77480 display for temp and a couple buttons
04:44 PM Chillum: good use of real estate
04:45 PM Chillum: hitting your temperature curve is a whole other exercise in software
04:47 PM PolishProgrammer: i think i will be happy with just constant temp for now. i wont reflow a clone of a GPU
04:47 PM PolishProgrammer: thats a very elegant board, by the way
04:47 PM Chillum: took me 8 iterations to get it that way
04:48 PM Chillum: was fun to solder
04:48 PM The_CooIest: ahhhhhhhhhhhhhhhhhhhhhhh you keep highlighting me
04:48 PM PolishProgrammer: i got a tc with a thermometer (cheaper than a tc alone ) and reflow the reflow controller
04:48 PM PolishProgrammer: :)
04:49 PM Chillum: oh ya, I also included a ds18b20 for monitoring my relay temperature
04:49 PM Ad0: how do I read from the 3 ADCs again, I completely forgot it all hehe
04:49 PM Ad0: on attiny45
04:49 PM Chillum: I have found that a hot air gun is better for small boards
04:49 PM Ad0: is there some MUX crap I have to do?
04:49 PM Chillum: the oven is mostly unused
04:49 PM PolishProgrammer: AdP,yes,
04:50 PM Ad0: hey Chillum have you seen the https://www.youtube.com/channel/UCl2mFZoRqjw_ELax4Yisf6w
04:50 PM Lambda_Aurigae: Ad0, you read one pin at a time...use the adc pin selection multiplexer to select which pin.
04:50 PM PolishProgrammer: ad0, you need to select the channel in ADMUX
04:50 PM Ad0: ok
04:50 PM Chillum: yes I watch Louis
04:50 PM Ad0: so all 3 ADCs can't be read "just like that"
04:50 PM Chillum: and big clive, and squeaky dave
04:50 PM Ad0: kk
04:50 PM PolishProgrammer: and start the conversion by flipping some bits in the proper register
04:50 PM PolishProgrammer: ;)
04:50 PM Ad0: right
04:51 PM PolishProgrammer: remember to wait for conversion end, its all in the datasheet
04:51 PM Lambda_Aurigae: Ad0, if you need 3 ADC reads simultaneously you will need to use 3 chips.
04:55 PM PolishProgrammer: squeaky dave, rofl
04:56 PM Chillum: hehe everyone always knows who I mean when i say that
04:57 PM PolishProgrammer: dont forget mike, he does cool stuff too
04:57 PM Lambda_Aurigae: not everyone
04:57 PM PolishProgrammer: i recently had a chance to pick up a hene laser, unknown condition, for 50 bucks cash
04:58 PM Ad0: Lambda_Aurigae: I'll survive
04:58 PM PolishProgrammer: but i did not because it was unknown condition, on a pavement in a rainy day
04:58 PM Ad0: I just need to know the minimal code to do it
04:58 PM Ad0: :)
04:59 PM Lambda_Aurigae: Ad0, it's in the datasheet.
04:59 PM PolishProgrammer: you can wrap it in a method that takes the channel and returns the uint_16t
04:59 PM PolishProgrammer: or uint16_t, i can never remember
05:00 PM Ad0: yeah
05:00 PM Emil: PolishProgrammer: what kind of HeNe-laser?
05:00 PM Emil: chances are 50 bucks is wayyyy overboard
05:00 PM Ad0: https://www.marcelpost.com/wiki/index.php/ATtiny85_ADC
05:00 PM Emil: since you cannot use it for anything but perhaps data transfer and scientific measurements
05:01 PM PolishProgrammer: no idea... it looked like torn out of some expensive equipment. it had a HV-psy
05:01 PM PolishProgrammer: ill see if its there and try to haggle, im willing to give no more that $10
05:01 PM Emil: PolishProgrammer: you didnt miss anything; really
05:01 PM PolishProgrammer: i think so
05:01 PM Emil: 15e perhaps if it is cool
05:02 PM PolishProgrammer: ive got a couple of IR ones tho
05:02 PM Emil: lasers arw only cool if you cut with them or can rig them for easy data transfer
05:02 PM PolishProgrammer: im not an expert on theese
05:02 PM Emil: Making science is also badass
05:02 PM PolishProgrammer: i think data transfer is more promising
05:03 PM Emil: but you really dont gain much
05:03 PM PolishProgrammer: i cant focus them though
05:03 PM Emil: For datatransfer just buy any laser diode
05:04 PM Emil: instead of a real mirror laser
05:04 PM Emil: smaller, more cost efficient and easier to use and replace
05:04 PM PolishProgrammer: i was thinking of making a laser projector
05:04 PM PolishProgrammer: like a vectoroscope
05:04 PM Emil: you gain nothing buy using a hene then; really
05:04 PM PolishProgrammer: back in a sec
05:07 PM PolishProgrammer: but still a hene is a hene and 10$ is not much
05:08 PM PolishProgrammer: and if it was the kind that has 6 wavelengths...
05:10 PM PolishProgrammer: im looking at that oshpark pcb and the pin headers' pins aren't aligned on the render. press-fit ? :D
05:24 PM PolishProgrammer: thanks for all the tips! its late here, i have to sleep. see you
05:47 PM Emil: Seriously
05:48 PM Emil: HeNe is nothing special :D
06:50 PM daveylib: Hey guys! Have someone tried to connect to the internet via GPRS using SimCom chip (AT commands)?
06:51 PM Lambda_Aurigae: daveylib, I'm sure someone has....
06:52 PM daveylib: I have a problem with some command (AT+CIPSEND). After sending the data I have to send Ctrl+Z (0x1A char), but it doesn't really work.
06:53 PM daveylib: It's an output from SIM800 module http://pastebin.com/Lz9emeey
06:54 PM daveylib: It looks like I didn't send Ctrl+Z. Control diode on the module is flashing every ~250 ms.
06:55 PM JanC_ is now known as JanC
06:56 PM daveylib: It's part of my code http://pastebin.com/LmAvcrKX
06:57 PM daveylib: Do someone know the answer how to fix my problem?
06:57 PM Lambda_Aurigae: if they do they will speak up.
06:58 PM Lambda_Aurigae: looks to me like ardweeny code.
06:59 PM daveylib: Yep, it's ATmega328 (Arduino Nano).
06:59 PM Lambda_Aurigae: which leaves me out.
06:59 PM Lambda_Aurigae: I don't do arduino
07:04 PM daveylib: Maybe only "GET exploreembedded.com/wiki/images/1/15/Hello.txt HTTP/1.0" in http request isn't enough...
07:08 PM enhering: daveylib: try gsm.write(0x1A); instead of gsm.write((char)26);
07:09 PM enhering: or gsm.print("GET exploreembedded.com/wiki/images/1/15/Hello.txt HTTP/1.0\r\n\r\n\0x1a");
07:10 PM enhering: or gsm.print(0x1A)
07:12 PM daveylib: Nope, it doesn't work. I've tried gsm.print("GET exploreembedded.com/wiki/images/1/15/Hello.txt HTTP/1.0\r\n\r\n\0x1a");
07:12 PM daveylib: I've tried also gsm.write(0x1A); and gsm.print(0x1A); before...
07:12 PM enhering: can you reconfig the CTRL-Z to some other character?
07:12 PM enhering: usually those modules are highly customizable
07:13 PM Lambda_Aurigae: read
07:13 PM Lambda_Aurigae: the
07:13 PM Lambda_Aurigae: datasheet
07:13 PM Lambda_Aurigae: it will tell you all about the device.
07:13 PM Tom_itx: NO!
07:13 PM enhering: This is the *last* option, Lambda_Aurigae
07:13 PM daveylib: I don't really know... Here is a datasheet https://cdn-shop.adafruit.com/product-files/1946/SIM800+Series_TCPIP_Application+Note_V1.01.pdf
07:13 PM Lambda_Aurigae: I don't want to read it.
07:13 PM Lambda_Aurigae: I'll never have or use one.
07:14 PM daveylib: Hahah :P On the page number 7... there is a list of commands how to configure tcp connection
07:14 PM daveylib: I've got problem only with the last command (AT+CIPSEND).
07:16 PM daveylib: I don't even get "SEND OK" information, so the problem is definitely in the way how I send ctrl+z character.
07:17 PM daveylib: Here's the tutorial, which I use https://www.exploreembedded.com/wiki/Setting_up_GPRS_with_SIM800L
07:17 PM enhering: I have just readi it.
07:18 PM enhering: There is an option for a fixed length send, withouth the need for CTL-Z
07:18 PM enhering: CTRL-Z
07:18 PM enhering: There is also this post: http://forum.arduino.cc/index.php?topic=19391.0
07:20 PM enhering: This should be the right format: Serial.print("Stuff\x1A");
07:20 PM enhering: Or this: gsm.print("GET exploreembedded.com/wiki/images/1/15/Hello.txt HTTP/1.0\r\n\r\n\x1A");
07:21 PM daveylib: Okay, I'm gonna try this now
07:21 PM enhering: This channel helped me. Now I'm helping somebody. That seems to be all that is needed to know about life.
07:22 PM enhering: Or not.
07:23 PM daveylib: It doesn't work. :/
07:23 PM specing: if you need arduino help -> #arduino
07:24 PM enhering: I hate mosquitos. Why they were ever created?
07:24 PM Lambda_Aurigae: enhering, to make you appreciate flies
07:24 PM enhering: makes sense.
07:24 PM Tom_itx: if elephants could fly...
07:24 PM Lambda_Aurigae: as much as anything.
07:25 PM Lambda_Aurigae: birdy birdy in the sky why'd you do that in my eye?
07:25 PM enhering: But that would put me in the center of creation. I'm not, for sure.
07:25 PM Lambda_Aurigae: birdy birdy in the sky, God I'm glad cows can't fly!
07:26 PM enhering: nice verses.
07:26 PM Lambda_Aurigae: In my heart and in my mind I've traveled roads that twist and wind.
07:27 PM Lambda_Aurigae: The mysteries of life I have explored but now my mind and soul are bored.
07:27 PM Lambda_Aurigae: The angels of heaven have called for me. The dogs of hell have beckoned me.
07:27 PM Lambda_Aurigae: Now I must meet the mightiest to prove my worthiness to exist.
07:27 PM Lambda_Aurigae: by Ray Moore, 1986
07:27 PM Lambda_Aurigae: titled Existence
07:28 PM enhering: Beautiful
07:28 PM Lambda_Aurigae: got me an A in English class and a trip to the school psychologist.
07:28 PM Lambda_Aurigae: they thought I was suicidal.
07:28 PM Lambda_Aurigae: I wrote that as the teacher was taking up homework papers...that was my homework.
07:28 PM Lambda_Aurigae: write a poem that included an animal.
07:28 PM enhering: Carnival is starting soon in Brazil. That makes me feel suicidal too
07:28 PM Tom_itx: well you're still here so i guess they were wrong
07:29 PM enhering: I should record what I'm listening now, from the window, so ou can understand how bad is it.
07:29 PM enhering: Like lots of people hitting one another with musical instruments
07:30 PM enhering: and singing dissonant songs
07:30 PM daveylib: I use gsm.print("GET exploreembedded.com/wiki/images/1/15/Hello.txt HTTP/1.0\r\n\r\n\x1A"); I've even change the length of CIPSEND from 63 to 99, but it doesn't work...
07:30 PM Lambda_Aurigae: "The mightiest" is ME...myself....
07:30 PM enhering: is there a soundbin somewhere?
07:30 PM Tom_itx: i wish windows had a decent dvd burner
07:30 PM Lambda_Aurigae: they couldn't understand that I thought I was mightier than god.
07:31 PM enhering: You were, Lambda_Aurigae. They just could not see it.
07:31 PM Lambda_Aurigae: Tom_itx, cdburnerxp
07:31 PM Tom_itx: how dcould anyone be mightier than her?
07:31 PM Lambda_Aurigae: Tom_itx, if there is a god she best have one hell of a sense of humor or we are all fucked.
07:32 PM Tom_itx: will it do dvd too?
07:33 PM Tom_itx: just data disk is what i need this trip
07:33 PM Lambda_Aurigae: does for me.
07:34 PM Lambda_Aurigae: burns dvd iso images anyhow.
07:34 PM Lambda_Aurigae: and should create dvd data disk easily.
07:34 PM Tom_itx: i'll give it a try
07:34 PM Lambda_Aurigae: is freeware..closed source.
07:35 PM Lambda_Aurigae: enhering, I'm still greater than anybody's imaginary friend.
07:35 PM Tom_itx: rue is his own best friend
07:35 PM Tom_itx: they talk to each other alot here
07:35 PM Lambda_Aurigae: oh hell, I have the best conversations with myself.
08:04 PM Tom_itx: ok at least the disk is spinnin
08:04 PM Tom_itx: g
08:23 PM hetii: Hello ;)
08:24 PM hetii: Any clue about python stk500 programmer that use GPIO by linux fs ?
11:57 PM rue_shop3: stk200?