#avr | Logs for 2015-08-23

Back
[00:00:56] <postmodern> so using Peter Fleury's UART library, set the baudrate to 4800, but when i try to receive data over a TTL cable and screen, the data is corrupted
[00:01:24] <postmodern> setting the baudrate lower in screen (600), i can get back a few valid characters
[01:50:48] <ferdna> .
[02:18:52] * Casper throws a mcdo honey pack thingy at ferdna
[02:19:57] * Xark watches the hordes of ants start attacking ferdna...
[02:20:43] <Casper> ants are going down in numbers here
[02:20:58] <Casper> I think I destroyed 2 nests
[02:22:07] <Xark> The drought (in California) is making them a real pain to keep out of my house (pet water dishes and food etc.)
[02:22:29] <Casper> raid ant bottle
[02:23:40] <Xark> Hehe. I am zero-chem (but I have some citrus stuff that dissolves them and leaves a sent they avoid).
[02:26:00] <Casper> that stuff... is scary
[02:26:06] <ferdna> :)
[02:26:16] <Casper> it's basically sugar, water and borax
[02:26:25] <Casper> borax dehydrate them
[02:26:41] <Casper> you put some drop on it's path..
[02:26:51] <Casper> ... and they fight for some space to drink it!
[02:27:26] <Casper> so you put some drops, and you come back 5 minutes later and say: fuck what the hell have I done? Where's the torch!
[02:27:55] <Casper> it is actually possible to see the drop getting smaller and smaller as the ants drink it
[02:28:09] <Casper> and you actually can see the ant getting bigger and bigger
[02:29:10] <ferdna> good night'
[02:29:21] <Casper> one nest got destroyed in about 2 weeks, another in 3 days
[02:29:30] <Casper> nite ferdy
[05:01:35] <Jartza> updated schematics: https://github.com/Jartza/attiny85-vga/blob/master/schematics.txt
[05:01:39] <Jartza> :)
[08:00:05] <krgx22> question: Arduino documentation says, that serial data received while ISR is active may be lost, but I can't afford to miss any received character. I'd like to know if I can loose any data if timer interrupt takes less than to receive one byte of data over serial?
[08:20:29] <antto> are you polling for data or receiving it in an interrupt?
[08:34:28] <Yoduza> avr simulations for winxp ?
[08:41:32] <krgx22> -antto I am receiving it in an interrupt.
[08:42:18] <antto> well, don't do too many things from the interrupts, and don't disable interrupts for too long
[08:47:06] <krgx22> Ok. But what if timer interrupt happens just before serial pin goes from idle to low and timer interrupt method finishes before serial goes back to idle state. Will controller miss it or acknowledge change and read bit after timer interrupt finishes?
[08:56:44] <krgx22> @Yoduza - I use simulavr on Linux, but it should also work on Windows. It is included in WinAVR package (http://sourceforge.net/projects/winavr/files/WinAVR/20100110/) in /WinAVR/bin/simulavr.exe
[08:58:20] <Yoduza> simulavr in Fedora sources ?
[08:58:29] <Yoduza> Gentoo ?
[09:00:48] <krgx22> on Ubuntu - it is in official repositories
[10:09:38] <Getty> I am asking again, i got a 1Hz clock on Timer2 on an atmega64 and we were unable to make an interrupt get called every sec., what we DO were able to make was getting called every 2 seconds
[10:10:00] <Getty> yeah for "solving" we actually ignored now that signal, its not like we need it, but it makes us crazy that we cant make it work like we want
[10:10:17] <Getty> anyone here experience in that direction?
[14:12:45] <Jartza> evening
[14:39:53] <Lambda_Aurigae> hideyho Jartza
[14:42:10] <Jartza> hello Lambda_Aurigae
[14:42:17] <Jartza> Lambda_Aurigae: https://github.com/Jartza/attiny85-vga
[14:42:17] <Jartza> :)
[14:42:22] <Jartza> there's the code, and schematicw
[14:42:31] <Jartza> drawn on nice 80's style ascii-art
[14:42:38] <Jartza> blog-post still to come
[14:42:55] <Lambda_Aurigae> nice.
[14:43:37] <Jartza> I'm still making some tiny cleanup & commenting to code, adding the cursor (and ansi for cursor on/off), but other than that it's about done
[14:46:40] <Jartza> I had a lot of ideas to improve it but then I'm afraid it's never ready
[14:46:52] <Jartza> so I decided to cut the feature creep and just write the blog post :)
[14:46:57] <Jartza> it can be then improved later
[14:48:25] <Jartza> and to be honest, I think it already is quite impressive :)
[14:49:52] <Jartza> mainly I gave up with the idea of adding fonts, but of course that's doable later
[14:50:01] <Jartza> then I also had an idea of "graphics" mode
[14:50:08] <Jartza> that would be 65x56 pixels :D
[14:50:41] <Jartza> oops, 64x56 of course
[14:51:13] <Jartza> that would actually be quite simple, it would just interpret byte in screen buffer to pixels
[14:51:28] <Jartza> and draw 2x4 pixels instead of 5x8 pixel font letter
[14:51:42] <Jartza> but maybe later
[14:52:00] <Jartza> the nice idea you gave me though, would be to split the screen, part text, part graphics
[14:52:22] <Jartza> even better would be to tell the start row and end row of graphics and other parts would be text
[15:00:54] <Xark> Jartza: TRS-80 style "graphics". :)
[15:02:28] <Jartza> something like that
[15:03:30] <Jartza> except trs had 2x3 pixels iirc
[15:03:44] <Jartza> I would just interpret it as 2x4, but principle would be the same
[15:04:21] <Jartza> and I would use ANSI (or something) to tell which rows use the "graphics" mode, instead of bit in screen buffer (as I'm already using all 8 bits to get background color)
[15:05:01] <Xark> Jartza: Yeah. It sacrificed lower-case for 2x3 IIRC. You would be a different mode (with no font).
[15:05:39] <Jartza> yeah
[15:05:57] <Jartza> my resolution is worse than trs-80 still :D
[15:06:05] <Xark> :)
[15:07:21] <Jartza> I could do better if I had more memory
[15:07:52] <Jartza> but one have to live with what has been given ;)
[15:08:01] <Jartza> it was my choise to make this thing work with attiny85
[15:08:16] <Jartza> it was the whole point of the project :)
[15:12:21] <Jartza> but the idea of switching in the middle of the screen is nice
[15:12:34] <Jartza> like, having 6 lines of text and then 8 lines of graphics
[15:12:41] <Jartza> the graphics would be 64x32 pixels
[15:12:48] <Jartza> you can draw _something_ to it
[15:13:03] <Jartza> and each 2x4 pixel block can have same colors as the text
[15:13:09] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxNGdTYTRxeS1GcVU/view
[15:13:11] <Jartza> like this
[15:13:34] <Xark> Nice.
[15:13:52] <Jartza> I have to look into it after I've "released" this
[15:13:58] <Jartza> maybe I'll write enhanced version in future
[15:14:25] <Jartza> the ANSI-escapes worked much much better I expected
[15:14:28] <Jartza> had some fun with them
[15:14:29] <Jartza> https://www.dropbox.com/s/wjr7k4ip8j3r82x/MOV_2897.mp4
[15:30:47] <Jartza> what would be nice was that if someone had attiny85 and vga monitor, they could try it :)
[15:30:57] <Jartza> I've only tested this with 2 different monitors, as I don't have more
[18:40:00] <postmodern> i'm using pfleury's uart library on an atmgeta328p at 9600 baud, but when i connect to it via screen, all the characters are corrupted. is there some setting i'm missing?
[18:42:22] <Lambda_Aurigae> postmodern, what is your clock source?
[18:42:56] <postmodern> Lambda_Aurigae, F_CPU is 8000000
[18:43:14] <Lambda_Aurigae> I didn't ask what F_CPU was set to .
[18:43:20] <Lambda_Aurigae> what is the clock SOURCE?
[18:43:28] <Lambda_Aurigae> internal RC oscillator, crystal, what?
[18:43:42] <postmodern> Lambda_Aurigae, um i believe uart.c uses the xtal
[18:43:53] <Lambda_Aurigae> what have you set the clock source to?
[18:43:59] <Lambda_Aurigae> the software has nothing to do with it.
[18:44:03] <Lambda_Aurigae> it is configured in the fuses.
[18:44:54] <postmodern> Lambda_Aurigae, i'm using the default clock source, haven't set anything
[18:45:05] <Lambda_Aurigae> then you are running at 1MHz internal oscillator.
[18:45:17] <Lambda_Aurigae> the internal oscillator set at 8MHz with the div/8 fuse set.
[18:45:29] <Lambda_Aurigae> that is not gonna work for squat for rs232 comms.
[18:46:24] <Lambda_Aurigae> I have run rs232 comms with the internal RC oscillator but it takes some tweaking.
[18:46:33] <Lambda_Aurigae> and it can vary depending on voltage and temperature.
[18:47:08] <Lambda_Aurigae> not a whole lot, but enough to break rs232 comms.
[18:49:00] <Valen> do you have a crystal on the board
[18:51:44] <postmodern> Valen, i don't believe so, what frequency of oscillator would i need?
[18:52:20] <Valen> http://wormfood.net/avrbaudcalc.php
[18:52:36] <Valen> Ideally one that was green at whatever speed you wanted
[18:52:39] <Lambda_Aurigae> well, if you want to run at 8MHz then an 8MHz crystal or oscillator..
[18:52:46] <Lambda_Aurigae> that chip can go to 20MHz.
[19:04:09] <Yoduza> 20MHz is a 20 MH/s hashrate ?
[19:12:30] <Lambda_Aurigae> no clue what you mean by hashrate.
[19:12:46] <Lambda_Aurigae> 20MHz is 20 million cycles per second clock rate.
[19:13:02] <Lambda_Aurigae> on an AVR it approaches 1 instruction per clock cycle.
[19:15:11] <Yoduza> 20 MH/s hashrate ~= 74 cycles of function salsa20/8 chacha
[19:15:56] <Yoduza> but need 65535 data RAM and 128KB code RAM
[19:17:46] <Lambda_Aurigae> Yoduza, you won't get that on an 8bit avr.
[19:18:03] <Lambda_Aurigae> the most you can get built into an avr is 16K of sram.
[19:18:16] <Lambda_Aurigae> and code doesn't go in ram on avr...it goes in flash.
[19:29:19] <Yoduza> all kind of ram have I2C, SPI
[19:29:33] <Yoduza> I dont know how to use DMA
[19:29:46] <Lambda_Aurigae> there is no DMA on 8bit AVR
[19:29:59] <Yoduza> Trendcend ?
[19:30:03] <Lambda_Aurigae> attiny and atmega have no DMA
[19:30:08] <Lambda_Aurigae> you have to go to atxmega to get DMA.
[19:30:17] <Lambda_Aurigae> I have no clue what Trendcend is.
[19:31:14] <Yoduza> DDR2 memory
[19:31:26] <Yoduza> atxmega ?
[19:31:29] <Lambda_Aurigae> you mean Transcend?
[19:31:44] <postmodern> awesome, i changed the fuse and disabled CLKDIV8 and now UART works
[19:31:47] <Lambda_Aurigae> I doubt you will do much with DDR2 memory on an AVR.
[19:31:58] <postmodern> although i should still get an external 8Mhz oscillator?
[19:32:12] <Lambda_Aurigae> postmodern, or a 16 or 20MHz crystal.
[19:32:23] <Lambda_Aurigae> settings for oscillator and crystal are different.
[20:22:13] <fobboyandy> hey guys. does changing the clock rate of an MCU make the MCU process information faster?
[20:23:15] <fobboyandy> or is purpose of changing clock rate only to match the frequency of a host device?
[20:23:40] <Tom_itx> if you run a faster clock rate it will process faster in relation to the rest of the world
[20:25:41] <fobboyandy> so if a loop took 10 seconds to go through at 1mhz, if i up the clock rate to 2mhz and define F_CPU to 2mhz it would take then take 5 seconds to go through the loop?
[20:25:58] <Tom_itx> theoredically
[20:26:53] <fobboyandy> F_CPU is only used to make clock rates relate to our time? even if i defined F_CPU to a higher value, it doesn't make the processing any faster in real time right?
[20:27:20] <LeoNerd> It's only used by the delay-type functions
[20:27:53] <fobboyandy> i see. makes sense thanks
[20:40:12] <Casper> fobboyandy: the frequency define the clock, each instruction use a certain number of clock cycle
[20:40:20] <Casper> the faster the clock, the faster it will process
[20:40:57] <Casper> however, some code (like the _delay_[ms|us] take the F_CPU variable to calculate some internal loop delay
[20:41:01] <Casper> and will compensate
[20:41:43] <fobboyandy> casper: gotcha thanks :D
[20:42:18] <Casper> rought example: F_CPU=1000000UL _delay_ms(1000) will calculate a loop of 1000000 cycles, while F_CPU=2000000 will make it do a 2000000 cycles
[20:42:22] <fobboyandy> i m thinking of using camera modules soon. are the 8 bit avr able to handle image processing and stuff?
[20:42:46] <Casper> the chip have no way of knowing what speed it actually run at, all what it know is the clock.
[20:42:53] <Casper> fobboyandy: most likelly no
[20:44:03] <fobboyandy> any suggestions?
[20:44:25] <Casper> first, 20MHz (max avr 8 bits speed) is sloooow, second: with external ram I think the max is still 64k of ram, good luck to fit a 640x480x8bits (=307100 bytes) in such little space
[20:44:29] <fobboyandy> the stronger mcu's are mostly smd, kinda hard to work with
[20:44:41] <Casper> might want to get a raspberry pi
[20:44:54] <fobboyandy> i wanna stay fundamental tho
[20:45:15] <fobboyandy> the ras pi is like a computer
[20:45:28] <Casper> really, you most likelly want more like a computer than a micro
[20:45:34] <fobboyandy> buy a computer to do something small?
[20:45:48] <fobboyandy> can those stronger microcontrollers do it?
[20:45:48] <Casper> thing is...
[20:45:51] <fobboyandy> like the ARM ones?
[20:46:01] <Casper> ARM are not microcontroller
[20:46:04] <Casper> but microprocessor
[20:46:15] <Casper> and yes, ARM can do it
[20:46:33] <Casper> and since you can put linux on it, it get very easy
[20:46:48] <Casper> ... sometime too easy...
[20:47:25] <fobboyandy> i might do that then. i want the process of building the device too
[20:47:27] <fobboyandy> not just programming it
[20:48:08] <fobboyandy> i might just find one soldered on the board before it ships
[20:50:11] <Casper> sadly, the notch past the microcontroller is hard to solder at home, borderline impossible...
[20:51:26] <fobboyandy> yeah. i heard there are websites that sell smd microprocessors and would solder it onto a protoboard for you
[20:53:59] <Casper> yes there is some like that
[20:54:19] <Casper> btw, to give you an idea, most routers at home are ARM powered
[20:54:31] <Casper> and can even serve as a web server
[20:54:58] <Casper> some even used one as a security camera recorder, by connecting a webcam and an hard drive via usb
[20:56:43] <fobboyandy> i actually thought that ARM stuff would cost a lot
[20:56:49] <fobboyandy> it's actually only like 10 bucks
[21:40:59] <Casper> yeah arm stuff dropped alot in price, to the point where I'm thinking sometime to move out of avr to go there, which is more and more tempting
[21:41:20] <Casper> specially since I'm considering to network some projects, which become hard with avr...
[21:41:25] <Casper> ... he's gone... woops
[21:55:39] <goddard> having an issue compiling on linux, here is my error : must be const in order to be put into read-only section by means of
[21:56:03] <goddard> any ideas how I can fix this?
[21:58:18] <Casper> the error message seems to tell you that you used a variable instead of a constant, but without the code and the full error message I can't be sure
[21:59:05] <goddard> Casper: here is the exact code https://www.pjrc.com/teensy/blinky.zip
[22:00:46] <goddard> Casper: here is the instruction page - https://www.pjrc.com/teensy/gcc.html