#avr | Logs for 2016-01-10

Back
[00:24:40] <straylight> Hi folks
[00:25:15] <straylight> on an atmega328p using its internal RC oscillator, can I set the FSTRT and SUT fuses to short delays safely?
[00:25:30] <straylight> or does the internal RC need some time to settle
[00:32:39] <Casper> are you doing timing critical stuff?
[00:33:07] <Jartza> is 65ms startup too slow?
[00:33:44] <Casper> all oscillator take some time to settle, it is only important if you need timing critical stuff at startup
[00:40:20] <straylight> probably the most timing critical thing is the bootloader
[00:41:02] <straylight> I'd like it if I can serial program it reliably
[00:43:00] <Casper> serial as uart?
[00:43:19] <Casper> if so, use the delay to be on the safe side, beside, you won't notice the 65ms delay anyway
[00:44:01] <straylight> ok, cheers
[00:44:50] <straylight> next question: can I run it somewhere between 128kHz and 8MHz using the internal RC? I only see a CKDIV8
[00:45:07] <straylight> I'd be going for 2 or 4MHz
[00:45:42] <Casper> btw
[00:45:54] <Casper> internal oscillator and serial port don't mix well together
[00:46:06] <Casper> the internal RC is unstable
[00:46:11] <Jartza> check datasheet for CLKPS
[00:46:28] <Jartza> there's lot of dividers
[00:46:37] <Casper> I strongly advice to use a 18.432MHz crystal (or other uart friendly crystal)
[00:46:56] <Jartza> or slow speeds
[00:47:02] <Jartza> 9600bps is doable with 8MHz internal
[00:49:46] <Jartza> straylight: notice too that CLKPR register has a feature to prevent accidental setting of CLKPS bits
[00:50:10] <straylight> I don't know what that means but I'm going to have a look at the datasheet now
[00:50:43] <Jartza> simplified it means you first need to write CLKPCE bit to 1 in that register and all the other bits to zero
[00:51:05] <Jartza> and right after that (within 4 clock cycles) write CLKPCE bit again to 1, together with wanted prescaler bits
[00:51:18] <Jartza> CLKPR = (1 << CLKPCE);
[00:51:40] <Jartza> CLKPR = (1 << CLKPCE) | (1 << CLKPS0);
[00:51:45] <Jartza> that would set prescaler /2
[00:51:51] <Jartza> being 4MHz
[00:52:37] <straylight> oh, ok - gotcha
[00:52:47] <Jartza> but you need both of those, first line enables the change of the bits, second one changes the bits :)
[00:57:35] <straylight> Jartza: I was reading http://www.gammon.com.au/power and noted that for turning off BOD temporarily (also a timed sequence) he says you must do sleep_cpu() directly after, or it doesn't work
[00:58:16] <straylight> is there a similar something you have to do after changing the prescaler to make it stick? (other than like turning interrupts back on if needed)
[00:59:00] <Jartza> it never "sticks"
[00:59:11] <Jartza> if you reset your MCU it's back to whatever fuse says
[00:59:16] <Jartza> so either "no prescaler" or "/8"
[00:59:52] <Jartza> but if you just go to sleep, that doesn't change the prescaler
[01:00:09] <straylight> yeah - so if I'm using a bootloader that'll run at 8MHz
[01:00:41] <Jartza> then just disable the /8 fuse
[01:00:55] <Jartza> no need to change the prescaler
[01:01:19] <Jartza> and if you want to disable the BOD, it's better to do with fuse too
[01:02:03] <straylight> yeah definitely
[01:02:27] <straylight> he seems to only do the sleep thing for BOD and not disabling any other stuff, so I think it's specific to that
[01:03:36] <Jartza> well, BOD is only disabled by software when MCU enters sleep
[01:04:24] <Jartza> setting BOD disable bit isn't enough, as it's only read when entering sleep :)
[03:12:46] <sabor> http://www.seeedstudio.com/depot/LinkIt-Smart-7688-p-2573.html?cPath=122_142
[03:12:55] <sabor> http://www.seeedstudio.com/depot/LinkIt-Smart-7688-Duo-p-2574.html?cPath=122_142
[03:13:36] <sabor> oops, wrong channel :)
[03:45:19] <julius> hi
[05:12:35] <cehteh> Jartza: when writing to CLKPR, you first set the CLKPCE bit and then write the value .. while writing the value the CLKPCE bit doesnt (or even should) not be set
[05:25:34] <Jartza> mm yeah, that might be
[07:58:27] <jayaura> Hi, I am about to design an avr development board for learning embedded design. I want it to be programmable from usb. i understand that i can use dfu-programmer. but only question is, how should I connect the atmega in my schematic? Simply connect usb lines from host to the avr's d+ and d- (through a 22ohm resistor, as per datasheet) ?
[08:00:41] <LeoNerd> Plus also the 3V3 zenner diodes, I believe
[08:00:48] <LeoNerd> The datasheet is usually pretty good at explaining the connection
[08:04:01] <jayaura> LeoNerd, 3v3 is needed only if the d+ and d- pins are 3v3 compatible, isnt it?
[08:04:26] <jayaura> I mean if the pins are 5v compatible, do i still need the 3v3 zener ?
[08:06:05] <LeoNerd> ah, notsure
[08:35:48] <jayaura> LeoNerd, anyways thanks for the information
[08:45:19] <Lambda_Aurigae> you will also need a dfu bootloader on the chip.
[08:49:07] <Lambda_Aurigae> if you are using the atmega16u4 or 32u4 an internal regulator to provide 3.3V for the USB system. D+ and D- are 3.0V to 3.6V...feeding them 5V can cause damage.
[08:51:00] <jayaura> Lambda_Aurigae, thanks. I thought usb pins would be 5v compatible. The dfu bootloader is not flashed on the chip from factory ?
[08:51:22] <Lambda_Aurigae> jayaura, dfu bootloader preloaded depends on the chip.
[08:51:32] <Lambda_Aurigae> you haven't said which one you are using.
[08:51:43] <Lambda_Aurigae> usb D+ and D- are NOT 5V tolerant.
[08:51:56] <Lambda_Aurigae> specially on the PC side.
[08:52:49] <Lambda_Aurigae> this is why the extra resistors and zener diodes are used on units using v-usb without the usb hardware.
[08:53:56] <jayaura> Lambda_Aurigae, I see. i was planning to use atmega16u4. Just now i found from the datasheet that it doesnt not come with bootlaoder pre programmed.
[08:54:04] <Lambda_Aurigae> bingo.
[08:54:10] <jayaura> :)
[08:55:28] <jayaura> I am just brainstorming the design. Anyways since this is my first board, I will populate all headers spi jtag i2c. I'll be able to get the bootloader from atmel? or do i need to make one on my own ?
[08:55:46] <Lambda_Aurigae> atmega16u4-au has pre-loaded bootloader
[08:56:03] <jayaura> okay
[08:56:04] <Lambda_Aurigae> atmega16u4-mu does not.
[08:56:11] <Lambda_Aurigae> page 421 of the datasheet.
[08:56:38] <jayaura> yes, i'm also at the same page :)
[08:57:03] <Lambda_Aurigae> atmega16u4rc-au also has bootloader but is running on the internal RC oscillator so no guarantee that it will actually run.
[08:58:27] <Lambda_Aurigae> if you are going to design your own board I recommend reading the ENTIRE datasheet at least twice.
[08:58:42] <Lambda_Aurigae> lots of little bits and pieces in there that you will miss the first time around.
[08:58:51] <jayaura> I see
[08:59:17] <Lambda_Aurigae> pay particular attention to the design guidelines in each section where such exist.
[08:59:26] <jayaura> okay
[08:59:54] <jayaura> Lambda_Aurigae, what makes the ATmega16U4RC-AU bootloader not to properly work as you mentioned?
[09:00:21] <Lambda_Aurigae> variations in temperature and supply voltage can make the internal RC oscillator drift.
[09:00:31] <Lambda_Aurigae> and usb comms requires a very stable clock.
[09:01:00] <Lambda_Aurigae> page 259 talks about crystal-less operation.
[09:01:16] <Lambda_Aurigae> you can only run low speed usb on the internal oscillator.
[09:01:21] <jayaura> well if i force the device to bootloade (hwen), irrespectivev of the host, the device has to be in bootloader mode right
[09:01:24] <Lambda_Aurigae> for full speed, you must have an external clock source.
[09:01:25] <Jartza> hmmm
[09:01:52] <Lambda_Aurigae> forcing it to bootload causes it to jump to the bootloader program...that puts it into bootloader mode.
[09:02:09] <jayaura> ofcourse the later part of the commuinication has dependency on the clock which i can understand
[09:02:30] <Lambda_Aurigae> going into bootloader mode can be done with a clock of 10Hz
[09:02:34] <Lambda_Aurigae> or 1Hz
[09:02:44] <Lambda_Aurigae> but it won't actually work for usb.
[09:02:51] <jayaura> yes exactly. i get the point
[09:02:53] <Lambda_Aurigae> I've run AVRs at 1Hz before just for the fun of it.
[09:02:59] <jayaura> haha
[09:03:10] <Lambda_Aurigae> 555 timer with variable resistor to adjust the clock speed.
[09:03:12] <Lambda_Aurigae> was fun.
[09:03:35] <Lambda_Aurigae> I'm not sure what crystal or external clock those chips need to run the bootloader by default though.
[09:03:35] <jayaura> maybe we can try running it at 72hz and see who is faster with a simple math :D
[09:03:41] <Lambda_Aurigae> I'm not seeing it in the datasheet.
[09:04:35] <Lambda_Aurigae> use a zero crossing detector on your mains and pull off 60Hz(or 50Hz for europe and other strange areas) to run it.
[09:06:30] <jayaura> Lambda_Aurigae, I will need to go through the datasheet more thoroughly. especially the usb part on how the device tells its a full speed or high speed.
[09:07:05] <jayaura> and then i think its our duty to ensure that there is a stable clock if I'm choosing high speed
[09:07:08] <Lambda_Aurigae> full speed vs high speed is configured by the software....but you have to have a minimum clock speed for high speed.
[09:07:42] <Lambda_Aurigae> and to get it stable at the higher speed you have to have a crystal stabilized clock source..
[09:07:46] <jayaura> but the device has to tell the host that it supports full/host speed
[09:07:54] <Lambda_Aurigae> that's all in software.
[09:08:04] <Lambda_Aurigae> in the bootloader software.
[09:09:02] <jayaura> Lambda_Aurigae, that means I dont know in what mode the bootloader shows up as!
[09:09:02] <Lambda_Aurigae> look at the bootloader datasheet.
[09:09:13] <jayaura> ah okay
[09:09:17] <Lambda_Aurigae> http://www.atmel.com/Images/doc7618.pdf
[09:13:20] <jayaura> Thank you very much Lambda_Aurigae for sharing the insight :) I'll go read all those literature before I start drawing schematics!
[09:15:21] <Lambda_Aurigae> just remember, always read the documentation twice then go back and hit highlights.
[09:15:42] <jayaura> sure thing!
[09:15:48] <Lambda_Aurigae> when I started with AVR I read datasheet for the atmega32 multiple times before I ever got my first chip.
[09:16:34] <Lambda_Aurigae> figured out what I wanted, ordered the chip, then downloaded the datasheet and multiple appnotes and read and read and read.
[09:17:04] <Lambda_Aurigae> half the questions answered in here could be found just by reading the datasheet.
[09:17:11] <jayaura> hmm needs lot of patiencee
[09:17:26] <Lambda_Aurigae> when I started with AVR there was no #avr channel on freenode.
[09:17:32] <jayaura> I see
[09:18:20] <Lambda_Aurigae> and I still use my parallel port interfaced skt200 clone made with a 74ls244 chip and some wires.
[09:19:00] <jayaura> its been years since I spotted something with a parallel port. that why i wanted this thing to work out of the box from usb
[09:19:33] <Lambda_Aurigae> this quad core amd fx-4150 has both parallel and serial ports on the motherboard.
[09:19:39] <Lambda_Aurigae> built it about 2 years ago.
[09:19:51] <Lambda_Aurigae> motherboards with parallel and serial are still available.
[09:19:57] <Lambda_Aurigae> and it wasn't even very expensive..
[09:20:13] <Lambda_Aurigae> was the cheapest board with 4 memory slots I could find in fact.
[09:20:25] <Lambda_Aurigae> gigabyte dual bios too.
[09:20:29] <Jartza> https://www.youtube.com/watch?v=swg2WneeWgU
[09:20:31] <Jartza> :)
[09:20:35] <jayaura> i dont have a desktop. may be i can also get a parallel port now a days, but nevver really wanted a desktop :P
[09:20:51] <Lambda_Aurigae> Jartza, cute.
[09:21:10] <Lambda_Aurigae> jayaura, my dell i5 has a parallel and serial port on the little portable docking station I have for it too.
[09:21:20] <Jartza> Lambda_Aurigae: attiny5 is :)
[09:21:35] <Lambda_Aurigae> and my HP I7 laptiop has a serial port built in...but no parallel port.
[09:21:46] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxTFFiMnB1Q0N3X28/view
[09:22:08] <jayaura> Lambda_Aurigae, oh, thats surprising to know even laptops have serial port! Neever saw one like it
[09:22:27] <Lambda_Aurigae> they are available....people just don't order with them anymore.
[09:22:32] <Lambda_Aurigae> I need the serial port for my job.
[09:22:41] <jayaura> Lambda_Aurigae, is it some business class laptop ?
[09:22:50] <jayaura> like workstation or so
[09:22:51] <Lambda_Aurigae> usb serial adapters don't generally work as they generally(not always) don't support hardware flow control.
[09:22:52] <Jartza> well... USB is serial port too ;)
[09:23:02] <Lambda_Aurigae> Jartza, ok...rs232 serial port.
[09:23:07] <Jartza> Universal Serial Bus :)
[09:23:29] <Lambda_Aurigae> jayaura, kinda...special order...not a massive machine but it does the job well.
[09:23:47] <Lambda_Aurigae> the i7 needs more ram though...only 4GB.
[09:24:43] <Lambda_Aurigae> the i5 runs ksp nicely though....and has 6GB ram.
[09:25:26] <Lambda_Aurigae> and the i5 was scrounged...
[09:25:59] <jayaura> ;)\
[09:26:03] <Lambda_Aurigae> computer was given to me...I found the memory and 500GB harddrive in dead copiers.
[09:28:03] <Lambda_Aurigae> and I dumpster dived the docking station from behind a company that was upgrading all their computers.
[09:30:34] <jayaura> I see
[09:32:51] <Lambda_Aurigae> but my desktop here is only 2 years old as I said before....the old ports are still available.
[09:56:53] <Jartza> I need some more memory to my laptop
[09:57:05] <Jartza> I'm planning to put linux on it, it's been unused for like 3 years
[09:57:31] <Jartza> it used to be my windows-machine (which I hate) but I only used it like 10-15 times
[09:57:38] <Jartza> when I was teaching some windows-subjects
[09:57:57] <Jartza> other than that, I really don't use windows
[10:16:18] <Jartza> Lambda_Aurigae: did you see my attiny5 go LSD?
[10:16:19] <Jartza> https://www.youtube.com/watch?v=aZzrJ3UyIDo
[10:16:21] <Jartza> :/
[10:19:22] <lorenzo> btw do you know if atmel ships samples?
[10:19:51] <lorenzo> a few years ago it was pretty much impossible to get anything from them
[10:25:35] <lorenzo> let's try :)
[10:48:44] <Chillum> Jartza: trippy
[10:48:55] <Chillum> is that using the composite lib?
[12:02:10] <Jartza> Chillum: wut?
[12:02:13] <Jartza> it's attiny5 :)
[12:02:25] <Jartza> that's bitbanged 8-color VGA from 3 pins
[12:02:58] <Chillum> I see. I thought perhaps the http://playground.arduino.cc/Main/TVout library
[12:03:13] <Chillum> Did not know one could do VGA
[12:03:37] <Chillum> ahh, nm the tvout needs a chip with an adc of course
[12:03:58] <Chillum> I am pre-coffee right now, about to drink some. My apparant IQ will rise 50 points, above 90!
[12:08:07] <Jartza> well, attiny5 is 6-pin chip with 32 bytes of RAM and 512 bytes of flash :)
[12:08:39] <Jartza> I disable the reset to get 4 usable pins, but one is taken by external oscillator
[12:08:53] <Jartza> so I need to drive VGA out from 3 pins :)
[12:10:44] <Jartza> Chillum: https://drive.google.com/file/d/0B2dTzW9TMeBxTFFiMnB1Q0N3X28/view
[12:10:54] <Jartza> that sot23-6 on the red breakout is the MCU :)
[12:11:33] <Chillum> neat
[12:11:44] <Chillum> ohh it is so tiny!
[12:12:02] <Chillum> cute
[12:14:26] <Jartza> https://www.youtube.com/watch?v=g0IYBAw0j0Y
[12:14:29] <Jartza> that's a bit less trippy
[12:18:18] <nuxil> oh nice
[12:18:39] <nuxil> much improvement on the colors
[12:27:18] <Chillum> reminds me of old visualizations
[12:27:43] <Chillum> remember acid warp?
[12:28:42] <Jartza> yea
[12:29:00] <Jartza> nuxil: yeah, now 8 colors play with me nicely
[12:29:15] <Jartza> I actually drive single-color VGA out from single pin :D
[12:29:58] <Jartza> sync signals + red
[12:30:32] <Chillum> if I had to choose r g or b I would go with green, like my old Apple IIgs monitor
[12:30:51] <Jartza> I would go with amber :)
[12:34:11] <Jartza> https://www.youtube.com/watch?v=swg2WneeWgU
[12:34:12] <Jartza> lol
[13:13:16] <Lambda_Aurigae> lorenzo, depends on your atmel rep. I have had good luck getting samples from them over the years...dozens since 2002 or so.
[13:14:25] <Casper> in canada, it is said to be impossible to get samples
[13:14:49] <Lambda_Aurigae> I've heard of people having mixed luck in other countries.
[13:14:59] <Lambda_Aurigae> I've taken my rep out for lunch and beer in the past.
[13:31:28] <phinxy> is this step down voltage regulator (lm2596 dc-dc) output voltage stable if the input varies a couple volts or does it just divide the voltage?
[13:31:29] <phinxy> http://www.instructables.com/id/The-Introduction-of-LM2596-Step-Down-Power-Module-/
[13:37:08] <phinxy> if i had two of them could i put them in series and check for myself?
[14:12:46] <Lambda_Aurigae> it should give you a stable output no matter what the input is as long as it is above the minimum start voltage
[14:14:16] <Lambda_Aurigae> if you drop below 4.2V input it will drop the output voltage.
[14:16:37] <Lambda_Aurigae> and overall your input voltage must be 1V higher than your desired output voltage.
[14:20:02] <Lambda_Aurigae> although, how the hell that is any kind of instructable I have no clue...it doesn't teach how to actually make something or remake something...it is just an advertisement for that board.
[15:12:25] <Jartza> LOL
[15:12:33] <Jartza> thought that "what if I make PCB for that attiny5 vga"
[15:12:33] <Jartza> http://gerblook.org/image/4xb4mfEx9McoUv6wsGVY6P/top.png
[15:12:34] <Jartza> :D
[15:13:29] <Thrashbarg> you could make it as a pass through adapter and troll people with it
[15:13:30] <Jartza> not routed yet, but just placed the parts so that they would be routeable
[15:14:06] <Jartza> 11.2mm x 30.9mm
[15:14:39] <Thrashbarg> make random spots appear on their screen every so often
[15:14:42] <Jartza> too bad the oscillator takes so much power so I can't steal it from monitor
[15:14:46] <Jartza> Thrashbarg: heh :)
[15:14:57] <Jartza> could actually be very doable
[15:15:11] <Jartza> no need even to generate sync signal manually
[15:15:17] <Thrashbarg> yea
[15:15:21] <Jartza> though it should adapt to many different syncs
[15:15:39] <Jartza> with something like 1920x1080 not much can be drawn with attiny :)
[15:15:46] <Thrashbarg> haha perhaps
[15:15:58] <Thrashbarg> enough to make a random line flash or something
[15:18:17] <Jartza> yea
[15:18:34] <Jartza> stupid random glitches to drive people crazy :)
[15:18:49] <Thrashbarg> hehe
[15:20:51] <Thrashbarg> I can't remember the name of that circuit that emits a high pitch whistle when someone talks too loud
[15:21:08] <Thrashbarg> it's intended to subliminally train them to shut up
[15:25:14] <Jartza> heh
[15:25:22] <Jartza> I know there's that kind of collars for dogs
[15:25:28] <Thrashbarg> yea
[15:36:42] <inkjetunito> Jartza: do you happen to know where i could find a finnish technical lexicon? the nickname and channel suggest so :p
[15:38:32] <phinxy> is it possible to have microchips inside a pcb layer? i cant find the display driver on my OLED pcb
[15:39:56] <Jartza> inkjetunito: umm.... unfortunatley no :o what do you need it for?
[15:40:05] <Jartza> I've never done electronics in finnish :D
[15:40:56] <Lambda_Aurigae> phinxy, not usually...it might be a potted chip..little black blob on the board somewhere.
[15:43:16] <phinxy> Lamdba, could it be under the flat black ribbon-cable? http://www.seeedstudio.com/depot/images/product/oled1281281_02.jpg
[15:44:26] <Lambda_Aurigae> probably.
[15:44:34] <Lambda_Aurigae> no way to know as it's a crappy angle.
[15:45:04] <Lambda_Aurigae> if the controller is on the OLED panel itself then I would say it's a potted chip.
[15:45:26] <Lambda_Aurigae> bare chip with hair thin wires connected directly to traces then the whole thing covered with epoxy.
[15:46:21] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxYnJkTUVsb09kSmc/view
[15:46:23] <Jartza> wow
[15:46:24] <inkjetunito> Jartza: heh, well done. it's just for personal use. my AC terminology is likely outdated. i'm not sure if 'nollajohdin', for example, is still used
[15:46:45] <Jartza> hmm... might be :)
[15:46:53] <Jartza> at least I've heard that word mentioned
[15:46:55] <Lambda_Aurigae> Jartza, that vga signal?
[15:47:01] <Jartza> Lambda_Aurigae: hsync :D
[15:47:10] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxUkI0WWE3a0RIZ3M/view
[15:47:15] <Jartza> and that's the same signal during vsync
[15:47:23] <Jartza> that "crap" on top of hsync is actually red pixels
[15:47:25] <Jartza> :D
[15:47:28] <Lambda_Aurigae> aahh.
[15:47:38] <Jartza> there's just some level shifting magic and I'm driving hsync+vsync+single color out from single pin
[15:47:40] <Lambda_Aurigae> was gonna say, that looks awfully noisy.
[15:47:54] <Jartza> doesn't matter, the "noise" is above trigger point it seems
[15:48:44] <Lambda_Aurigae> what I thought was noise is the pixels.
[15:49:12] <Jartza> oh there's plenty
[15:49:15] <Jartza> this is on breadboard
[15:49:24] <Jartza> with lot of wires
[15:49:57] <Jartza> I mean, plenty of noise IN the pixels too :)
[15:52:16] <Jartza> I use yellow led to split the two signals ;)
[16:06:59] <Xark> Chillum: TVout just needs two resistors to generate NTSC/PAL. No ADC used.
[16:07:38] <Chillum> nice
[16:10:04] <Xark> Chillum: I tweaked a version to use character graphics (better with low-RAM). -> https://imgur.com/a/JO4Cq
[16:10:47] <Chillum> nice, now implement a file system and a scripting langauge and you have a computer
[16:11:06] <Xark> (and with 128 characters defined in RAM - allows "fake" sprites -> https://www.youtube.com/watch?v=Imk5ony8JHI )
[16:11:11] <Xark> Chillum: :)
[16:11:37] <Chillum> the old methods still work
[16:12:13] <Chillum> like how they did it on the atari 2600
[16:12:18] <Xark> Chillum: I made a 6502 emulator that can run at effective 1MHz 6502 speed while generating video -> https://imgur.com/a/dIrLJ#0
[16:12:49] <Xark> (but it only runs from RAM at that speed, so needs 1284p AVR with a bit of SRAM to be worthwhile)
[16:13:47] <Chillum> hehe
[16:18:41] <Jartza> yea... I'm not planning this to be usable product, though :D
[16:18:50] <Jartza> Chillum: https://github.com/Jartza/octapentaveega
[16:19:13] <Jartza> that's my other project. that's much more usable, sort of like external terminal made from attiny85 (BW with single attiny) that can be commanded through UART :)
[16:19:23] <Jartza> 8 colors with 3 attinys running in parallel :D
[16:19:35] <Jartza> 512 bytes of RAM, so 512 characters on screen
[16:19:37] <Chillum> so a uart display adapter, nice
[16:19:52] <Jartza> 9600bps uart and subset of ANSI-escapes (and few other) supported
[16:22:20] <Jartza> this fooling around with attiny5 is just... well, fooling
[16:23:17] <Chillum> the smallest i have used is the attiny85, from which I made a device that pretends to be a keyboard and types something
[16:24:44] <Jartza> I even know few people already who use OctaPentaVeega for something :)
[16:25:05] <Jartza> including me, naturally
[16:25:07] <Lambda_Aurigae> meme
[16:25:26] <Lambda_Aurigae> use it as a terminal output for microcontroller projects.
[16:25:35] <Lambda_Aurigae> will also be using it as a teaching aid this summer.
[16:25:44] <Jartza> friend of mine made house HVAC/Heating information panel out of arduino, OctaPentaVeega shield and nice 7" monitor
[16:26:02] <Lambda_Aurigae> both as an interface device and showing off the code.
[16:26:31] <Jartza> Lambda_Aurigae: I'd be very interested hearing out how that goes :)
[16:27:38] <Lambda_Aurigae> the kids don't do much assembly but it will be a good thing to show off what one can do with minimal hardware and assembly.
[16:27:48] <Jartza> Lambda_Aurigae: need any PCBs for them?
[16:28:10] <Jartza> I have gazillion of those B/W PCBs
[16:28:12] <Lambda_Aurigae> I've already made a couple using dip package chips.
[16:28:21] <Jartza> ahh
[16:28:33] <Lambda_Aurigae> I don't have any of the smt chips.
[16:28:54] <Jartza> yea. I had plenty of SMD versions
[16:29:04] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxaFFxam1uVW05NlE/view
[16:29:07] <Jartza> these
[16:29:36] <Lambda_Aurigae> what would you sell completed boards for?
[16:29:57] <Jartza> I haven't really calculated
[16:30:08] <Jartza> I guess BW version is not much though
[16:30:31] <Jartza> if you don't need color?
[16:30:48] <Jartza> well. color isn't much more expensive either, just 2 attinys more but mostly the same parts :)
[16:30:57] <Lambda_Aurigae> would be interested in cost of color ones too.
[16:30:58] <Jartza> VGA connector is the most expensive part
[16:31:11] <Lambda_Aurigae> might could buy like 4 of each if they aren't too much...don't need more than that.
[16:31:28] <Jartza> I need to calculate them in few days
[16:31:33] <Lambda_Aurigae> no hurry.
[16:31:44] <Lambda_Aurigae> I don't have the money right now anyhow.
[16:31:58] <Jartza> yea
[16:32:24] <Lambda_Aurigae> but put together a price list..I'm sure I'm not the only one here who would be interested.
[16:32:40] <Lambda_Aurigae> I've bought stuff from others here in the past.
[16:33:36] <Jartza> yea
[16:34:09] <Jartza> good thing is I've saved every mouser/digikey/farnell invoice, so it should be relatively easy job :)
[16:34:28] <Jartza> it should be easy to pinpoint which contains the parts for the VGA :)
[16:34:29] <Lambda_Aurigae> kewl.
[16:34:37] <Lambda_Aurigae> build in something for your time assembling too.
[16:34:48] <Jartza> sure
[16:35:09] <Jartza> though I don't want to rip people off with these
[16:35:25] <Lambda_Aurigae> it's a novel product.
[16:35:36] <Lambda_Aurigae> no reason you shouldn't make something on it.
[16:36:15] <Jartza> I think the arduino shield might be "best selling" option
[16:36:32] <Jartza> if bundled together with arduino library maybe
[16:36:46] <Jartza> like something with "vga_move_cursor(x,y)" functions etc
[16:36:50] <Jartza> arduino-style
[16:38:35] <ub|k> hi
[16:38:54] <ub|k> wondering if anyone has ever interfaced an AVR with an SSD13xx OLED module through SPI
[16:39:11] <ub|k> there are lots of Arduino examples, not so many AVR ones
[16:39:33] <Lambda_Aurigae> I'm sure plenty of people have.
[16:39:37] <Jartza> of course that arduino-shield can be used as the "color version" too
[16:40:05] <Xark> ub|k: Arduino is pretty much just AVR (with some lib code). I suspect you can port it to plain AVR easily.
[16:41:09] <Jartza> I've done plenty of displays, can't outright remember if one of them were SSD13xx but I'm pretty sure I've touched that one too :)
[16:42:08] <ub|k> Xark: yeah, i imagined so, but the the whole SPI config part is confusing
[16:42:24] <phinxy> I got a library which is one .h file and a couple .c files. Why is it not enough for me to link the external directory in toolchain > gnu-c-compiler > directories?
[16:43:08] <Xark> ub|k: AVR SPI is really pretty simple... what do you find confusing?
[16:43:17] <phinxy> visual studio is able to find variable names for me when i type in code but the compiler says undefined reference
[16:43:51] <phinxy> i can recommend u8glib
[16:44:08] <Xark> phinxy: It generally works the same. Can you post an example of your command line and error?
[16:44:30] <Xark> ub|k: Yeah, u8glib is popular (but a bit large and supports lots of displays).
[16:44:32] <ub|k> Xark, first of all, what are the arduino defaults wrt SPI clock rate (using SP12X,SPR1,SPR0 = 1,0,0)
[16:44:53] <ub|k> plus clock polarity and phase
[16:44:57] <Xark> ub|k: You generally set it to 8MHz SPI clock.
[16:44:58] <phinxy> if you dont include any of the fonts and extra features its not that large.
[16:45:41] <ub|k> hm... the arduino code says SPI_CLOCK_DIV2
[16:46:00] <Xark> ub|k: Yeah, 16MHz CPU clock /2 = 8MHz SPI clock
[16:46:33] <Xark> ub|k: The Arduino SPI code is tiny, so just look at it. :)
[16:47:17] <ub|k> Xark: https://github.com/adafruit/Adafruit_SSD1305_Library/blob/master/Adafruit_SSD1305.cpp#L35
[16:47:27] <phinxy> Xark, i dont see any -I in my gcc command
[16:47:36] <ub|k> otoh, there's 4000000
[16:51:41] <ub|k> i don't understand what SPI_HAS_TRANSACTION means either
[16:52:10] <Lambda_Aurigae> it's part of the arduino spi lib.
[16:52:28] <phinxy> Oh, its the linker who is complaining
[16:59:36] <Xark> ub|k: That TRANSACTION stuff just allows different code to "share" SPI and save/restore parameters.
[16:59:53] <Xark> (i.e., a slow SPI device and a fast SPI device on same bus)
[17:03:23] <ub|k> Xark: ah, i see
[17:04:35] <Xark> ub|k: It is defined like that because older Arduino libs didn't support it (so would stomp other SPI settings).
[17:05:15] <phinxy> okay i had to build u8glib first and include it static
[17:05:35] <phinxy> Why cant the compiler handle that automatically?
[17:10:06] <ub|k> Xark: I am actually using this as a base: http://www.tinkerer.eu/AVRLib/SPI/
[17:11:31] <ub|k> (properly configured, i believe)
[17:20:08] <ub|k> Xark: one thing i don't understand trying to "translate" the code that works on Arduino: am I supposed to set DS (SS) manually? the arduino libs do that, but shouldn't the SPI interface do that automatically?
[17:20:23] <ub|k> i think the arduino lib uses software SPI by default, maybe that's why?
[17:20:44] <Xark> ub|k: Generally it is done manually.
[17:20:44] <LeoNerd> You always need to manage the SS line yourself, yes
[17:21:08] <Xark> ub|k: Good thing too, with multiple devices (where you need several CS).
[17:21:27] <ub|k> but that's ~SS (PB4) on atmega32
[17:21:42] <ub|k> so, i just set PB4 as if it were any output pin?
[17:22:05] <ub|k> or is there some other register i should change in order to set that pin?
[17:23:18] <Xark> I think AVR only uses SS in slave more or something. You just use some other pin with usual GPIO.
[17:23:22] <Xark> mode*
[17:23:32] <Xark> (or that pin, manually)
[17:29:43] <ub|k> Xark: thanks!
[17:30:22] <ub|k> hm... I assume what arduino calls "transfer(uint8_t)" is what AVRLib/SPI calls "spi_fast_shift"
[17:32:41] <ub|k> can i debug SPI traffic using e.g. an arduino?
[17:32:53] <ub|k> i mean, plugging it into the same bus and listening to what i'm sending?
[17:33:17] <Xark> ub|k: Well, with a logic analyzer or similar, sure.
[17:33:43] <Xark> ...maybe with software (just monitoring SPI bus)
[17:33:53] <Xark> (Essentially DIY LA)
[17:34:25] <ub|k> Xark: i mean debugging the SPI commands sent by the AVR using another AVR (e.g. arduino)
[17:36:31] <Xark> ub|k: Maybe. Arduino has no provisions for this...
[17:45:55] <ub|k> Xark: any idea why the arduino code sets back the data mode and the clock divider before sending each command?
[17:46:43] <Xark> ub|k: Hmm, IIRC it is restoring the saved "transaction mode" (i.e., SPI parameters in case other code trashed them).
[17:47:19] <ub|k> ok, not applicable here
[17:47:30] <ub|k> hm... can't seem to make it work
[17:50:27] <ub|k> hm.. if someone wants to have a look... https://gist.github.com/anonymous/3328655aa048c8e02d92
[17:50:37] <ub|k> in case i'm doing something really wrong
[17:52:12] <phinxy> u8glib is like half an fps on my i2c oled display
[18:16:33] <ub|k> shouldn't MOSI be at 0 by default?
[18:16:44] <ub|k> i.e. when nothing is being sent
[18:24:41] <phinxy> i added pull-up resistors to my i2c data pins and now i successfully run it at 400khz
[18:24:51] <phinxy> i wonder if i can push it further
[18:40:07] <Lambda_Aurigae> it's supposed to have those resistors.
[19:59:49] <Jartza> phinxy: pull-ups are always needed for i2c. there are generic guidelines for selecting correct values, depending on speed, voltage, capacity etc.
[20:00:22] <phinxy> it worked in slow mode (100khz) without any pull-up
[20:00:30] <Jartza> some good starting values for 3.3V are 100kHz:4.7k, 400kHz:3.6k
[20:00:48] <Jartza> phinxy: maybe you had internal pull-ups enabled.
[20:01:04] <Jartza> those are quite weak though, but if you're lucky you get it working on slow speeds :)
[20:01:45] <phinxy> should i disable internal pullups when i use a external one? can it break?
[20:02:21] <Jartza> you should, yes.
[20:02:45] <Jartza> nothing breaks, except your i2c might not still work correctly.
[20:03:46] <Jartza> I got i2c working @1MHz with attiny clocked @20Mhz with 1.6k pull-ups
[20:04:14] <Jartza> oops
[20:04:16] <Jartza> not megahertz
[20:04:33] <Jartza> oh yes it is. 1000kHz
[20:04:42] <Jartza> seems I can't calculate in my head at 3:40am :D
[20:06:10] <Jartza> anyway, the pull-up resistors affect the signal rise-time
[20:06:39] <Jartza> the smaller the resistor, the faster the rise-time
[20:06:49] <Jartza> but also power consumption rises
[21:01:37] <Piecat> Hey guys. Sorry if this is a common question. I've tried googling it, and I'm not having much luck.
[21:01:56] <Piecat> I keep getting the error: "make: *** No rule to make target `clean'. Stop."
[21:02:12] <Piecat> And I'm not really sure why. The directories are in the system PATH variable
[21:02:20] <Piecat> winAVR was installed using administrator
[21:02:23] <Tom_itx> you don't have a clean section in your makefile
[21:02:57] <Piecat> This happens for regular build too...
[21:03:09] <Piecat> Maybe I'm missing a step here
[21:03:12] <Tom_itx> example:
[21:03:13] <Tom_itx> clean:
[21:03:13] <Tom_itx> rm -rf *.o $(PRG).elf *.eps *.png *.pdf *.bak
[21:03:13] <Tom_itx> rm -rf *.lst *.map $(EXTRA_CLEAN_FILES)
[21:03:43] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/avr/adc_test/makefile
[21:03:49] <Tom_itx> there's one of my makefiles
[21:04:22] <Piecat> So, I need that in the directory of my project, don't I?
[21:04:36] <Tom_itx> i'd say so
[21:04:49] <Piecat> Ahhh. Derp
[21:04:52] <Piecat> well, thanks for the help
[21:05:00] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/avr/atmega32/rs232_rx_test/makefile
[21:05:05] <Tom_itx> there's another makefile
[21:05:27] <Tom_itx> probably quite similar to the first