#avr | Logs for 2015-08-24

Back
[00:11:14] <goddard> Casper: i figured it out
[00:11:31] <goddard> Casper: was a simple fix I guess the C channel helped me.
[00:11:46] <goddard> I should of been able to figure it out
[00:12:03] <goddard> I thought it was related to the lib some how though
[00:22:10] <rue_school> the C channel helped you?
[00:22:22] <rue_school> thats amazing, I'v never seen them EVER help anyone...
[00:25:02] <Casper> I'm also surprised
[00:51:51] <goddard> haha
[01:00:43] <Casper> now... to try to make this project... and decide how I do it...
[01:01:09] <Casper> this one should be a 15 minutes project... but will be a 15 days because... well, I'm slow :D
[01:03:50] <rue_school> your just maticulous
[01:05:20] <Casper> how hard is it to... read 2 ADC channel, multiply one by X and the other by Y and display it on an lcd that I have a lib for it? :D
[01:07:21] <rue_school> lcdsend(itos(readADCChannel(1)* k);
[01:07:44] <rue_school> now just write lcdsend() itos() and readADCChannel()
[01:07:49] <rue_school> done!
[01:12:35] <Casper> you know, lcdsend... not even needed
[01:12:47] <Casper> as I have an lcd lib
[01:13:40] <Casper> I wonder if this shunt can handle 30A...
[01:50:16] <Yoduza> normal price for AVR devboard with usb,20Mhz, 64K ram, 128 rom ?
[04:27:57] <Xark> Yoduza: 64K RAM? Look elsewhere vs AVR (max 16KB RAM- or 32KB for Xmega perhaps).
[04:28:41] <Yoduza> Xark, DMA for DDR2 using ?
[04:28:55] <Xark> Yoduza: No DDR2...
[04:29:11] <Xark> Yoduza: AVR is a microcontroller. Look to ARM or MIPS perhaps.
[04:29:44] <Yoduza> SPI, I2C for more sram not effective ?
[04:30:14] <Xark> Yoduza: If you need like ~32KB and slow is OK, perhaps. However, nothing like MBs of SDRAM.
[04:32:09] <Xark> Yoduza: Figure dozens of clock cycles to access a single byte on SPI (I2C is an order of magnitude or worse slower).
[04:32:20] <Yoduza> ok, 74 hashrate for NeoScrypt not possible for AVR.
[04:32:40] <Yoduza> salsa20/8 chacha not possible
[04:33:04] <Xark> Yoduza: Perhaps consider an FPGA for that stuff.
[04:33:29] <Xark> (but non-trivial to learn)
[04:33:38] <Yoduza> xilinx not documented as well as need, altera also
[04:38:00] <Yoduza> thank you Xark
[04:38:41] <Xark> Yoduza: No problem, good luck on your project.
[14:30:01] <aandrew> TIL the attiny does 64MHz
[14:30:14] <aandrew> 8MHz RC, 8* PLL
[14:30:19] <aandrew> I always thought the PLL *was* 8MHz
[14:38:18] <Jartza> you can run attiny from internal PLL
[14:38:28] <Jartza> seems to work with 32MHz :)
[14:40:01] <Yoduza> what for are you using attiny ?
[14:42:49] <Jartza> Yoduza: I'm using attiny85 for electronic namebadge and VGA
[14:45:44] <Jartza> Yoduza: https://www.dropbox.com/s/wjr7k4ip8j3r82x/MOV_2897.mp4?dl=0
[14:45:57] <Jartza> and http:/tagsu.io/about
[15:23:33] <Strangework> Exquisite dopeness, Jartza
[15:25:50] <Jartza> :)
[19:18:33] <[w_w]> can I enter sleep mode from within an interrupt? will that effect waking up?
[19:20:39] <Casper> that.... is a good question!
[19:21:22] <Casper> but I think you may have issue with triggering back the same interrupt, iirc, the interrupt flag is cleared at RETI...
[19:22:17] <[w_w]> But I could clear it manually right? I don't care about actually getting the interrupt, just waking up when the interrupt happens.
[19:23:38] <Casper> I think so, never tried myself, so can't say for sure
[19:23:57] <Lambda_Aurigae> it should resume from the instruction following the SLEEP command.
[19:24:32] <Lambda_Aurigae> no matter where it happens...the processor should be in the same state otherwise.
[19:36:02] <[w_w]> looks like the sleep system doesn't depend at all on the interrupt flags.
[19:36:13] <Lambda_Aurigae> not from what I'm seeing.
[19:36:25] <[w_w]> just which interrupts are enabled.
[19:36:55] <Lambda_Aurigae> for waking up.
[19:41:46] <Jartza> oops, 3:18am
[19:42:43] <Lambda_Aurigae> Jartza, another 4 or 5 hours and you can go to work.
[19:42:53] <Jartza> yep
[19:43:00] <Jartza> maybe some sleep before that
[19:43:08] <Lambda_Aurigae> sleep is for the weak!
[19:43:19] <Lambda_Aurigae> you are strong.
[19:43:41] <Jartza> I'll be weak without sleep :D
[19:44:07] <Lambda_Aurigae> only for a little while just before you pass out.
[19:44:39] <[w_w]> does enabling interrupts clear any flags?
[19:44:52] <Lambda_Aurigae> don't think so.
[19:47:13] <[w_w]> for some reason When I enter sleep from within an interrupt handler, I need to enable interrupts before sleeping to be able to wake up again. without enabling interrupts it sleeps forever.
[19:47:31] <Lambda_Aurigae> how are you trying to wake it up?
[19:48:14] <[w_w]> using int0. When int0 fires I want it to do something, and optionally sleep until another int0.
[19:48:33] <Lambda_Aurigae> so, yes, you have to have interrupts on in order for int0 to fire.
[19:48:44] <Lambda_Aurigae> so interrupts need to be enabled before going to sleep.
[19:49:00] <Lambda_Aurigae> without interrupts enabled then int0 won't fire and it won't wake up.
[19:51:52] <[w_w]> by the time int0 fires the first time, interrupts are already enabled. The interrupt handler then does a sleep. I don't understand why, if I haven't disabled interrupts, I need to enable them before sleeping.
[19:53:38] <Lambda_Aurigae> when an interrupt fires it disables global interrupts....when you return from the interrupt it re-enables them.
[19:55:12] <[w_w]> ah. that makes a boat load of sense.
[19:57:50] <aandrew> kind of crazy how you can't get reliable 400kHz I2C operation with USI unless you're running at 64MHz
[19:58:16] <aandrew> 8MHz isn't enough. it'll do 100kHz (usually) but for some reason you need insaneo speed
[19:58:27] <aandrew> I'd have thought you could bitbang 400kHz i2c slave reception at 64MHz
[19:59:59] <Jartza> aandrew: but you can draw vga pixels with it! :)
[20:00:08] <aandrew> :-)
[20:00:19] <Lambda_Aurigae> [w_w], look at the assembly generated by your interrupt code.
[20:00:38] <Lambda_Aurigae> Jartza, one has to wonder, what can one do with that attiny85 clocked up to 40MHz with the PLL
[20:01:07] <Jartza> true
[20:01:08] <aandrew> IIRC Jartza is only at 20MHz to do VHA
[20:01:11] <aandrew> er VGA
[20:01:19] <Lambda_Aurigae> aandrew, correct.
[20:01:30] <Jartza> I also realized today that I still have 512 bytes of eeprom free ;)
[20:01:36] <Lambda_Aurigae> HAHA
[20:01:39] <Jartza> and started to wonder one more thing
[20:01:42] <Lambda_Aurigae> how much flash?
[20:01:48] <Jartza> umm, >4kB
[20:01:52] <Lambda_Aurigae> hmm.
[20:02:03] <Lambda_Aurigae> eeprom....background graphics mode?
[20:02:03] <Jartza> and one more thing
[20:02:19] <Jartza> I thought what if I get rid of the external oscillator?
[20:02:28] <Lambda_Aurigae> stability could be an issue.
[20:02:34] <Jartza> and run with internal PLL, just calibrate it
[20:02:41] <Lambda_Aurigae> it can drift.
[20:02:44] <Jartza> sure
[20:02:57] <Jartza> but does it drift too much to cause issues?
[20:03:03] <Lambda_Aurigae> one way to find out.
[20:03:15] <Lambda_Aurigae> what would you use that extra pin for?
[20:03:17] <Jartza> of course it should be calibrated
[20:03:48] <Jartza> I thought about crazy idea, what if I use UART to calibrate? :)
[20:03:55] <Lambda_Aurigae> possible.
[20:04:07] <Jartza> sending 0xAA to standard 8n1 UART generates nice square wave
[20:04:12] <Lambda_Aurigae> send UUUUUUUUU....adjust and calibrate
[20:04:28] <Jartza> UUUU won't work
[20:05:00] <Jartza> it's "wrong way" with start & stop bits
[20:05:31] <Jartza> start bit is "0", stop bit is "1"
[20:05:39] <Jartza> so we need 10101010 in between
[20:05:44] <Jartza> = 0xAA
[20:05:59] <Lambda_Aurigae> yup.
[20:06:11] <Jartza> that could be done at first boot
[20:06:19] <Jartza> then save the calibration value to eeprom etc
[20:06:50] <Jartza> maybe I'll try that too later
[20:07:03] <Jartza> I decided there's now enough features for the blog post, after that I can make v2 :)
[20:08:00] <aandrew> I need to figure out why my i2c reads "lag" by one call
[20:08:20] <aandrew> i.e. start addr+write reg=0x03 restart addr+read read read stop
[20:08:38] <aandrew> the read read isn't reg 3's contents, it's whatever reg was before
[20:08:43] <aandrew> read again and it's correct
[20:08:54] <aandrew> but the code doesn't do anything "wrong" that I can see
[20:09:18] <Lambda_Aurigae> what are you reading from?
[20:09:19] <aandrew> I'm using https://github.com/eriksl/usitwislave
[20:09:29] <aandrew> attiny25, using a bus pirate as the master
[20:10:19] <Lambda_Aurigae> have you tried reading an i2c eeprom?
[20:10:27] <aandrew> Lambda_Aurigae: no no
[20:10:34] <aandrew> Lambda_Aurigae: my code is on the tiny25; I'm the i2c slave
[20:10:44] <Lambda_Aurigae> to see if it is a problem with the code or the bus pirate.
[20:10:57] <Lambda_Aurigae> eliminating possible problems.
[20:10:58] <aandrew> I'm very well versed in i2c and spi for that matter, this seems to be something a little goofy in the library
[20:11:18] <Lambda_Aurigae> never used that library.
[20:11:29] <aandrew> it's just a corrected and bugfixed version of the app note
[20:11:33] <aandrew> I have to dig itno it a little more
[20:11:39] <aandrew> DW debugging is so bloody slow though
[20:12:24] <Jartza> I also added three .hex -files to github
[20:12:34] <Jartza> one for each color
[20:12:40] <Jartza> red can be used as standalone-master too
[20:12:58] <Jartza> https://github.com/Jartza/attiny85-vga
[20:12:59] <Jartza> here
[20:13:35] <Jartza> Lambda_Aurigae: instead of multiple fonts I'm going to implement TRS-80-ish "graphics mode" :)
[20:13:44] <Lambda_Aurigae> sweet.
[20:14:19] <Jartza> TRS-80 did it wasting the MSB, then the 6 lowest bits defined 2x3 pixels when the high bit was 1
[20:14:47] <Jartza> I thought to just implement some ANSI-escapeish sequence to tell row number where graphics start and where it ends
[20:15:02] <Jartza> so you could have some lines as text, some lines as graphics
[20:15:12] <Lambda_Aurigae> hmmmm.
[20:15:30] <Jartza> in graphics-mode it just wouldn't use font, instead it parses the byte in screen buffer to 2x4 pixels in that characters space
[20:15:41] <Jartza> making 64x56 pixel graphics if using full screen :)
[20:15:42] <Lambda_Aurigae> interesting.
[20:15:54] <Jartza> or 6 lines of text and 64x32 graphics, etc.
[20:16:24] <Lambda_Aurigae> adjustable line by line, eh?
[20:16:49] <Jartza> nah, just thought to use start and end row numbers
[20:17:27] <Jartza> then you can either have full text, full graphics, graphics on top, graphics on bottom or graphics in middle of screen
[20:17:52] <Jartza> it'll be HUGE pixels anyway :)
[20:17:58] <Lambda_Aurigae> hehe.
[20:19:03] <Jartza> either that, or the other font with more drawing characters
[20:19:22] <Jartza> but first the blog
[20:19:47] <Lambda_Aurigae> yes...get it blogged and we will get it spread to the world.
[20:19:53] <Jartza> yeah
[20:20:31] <Jartza> I can then blog part 2 later :D
[20:29:22] <Jartza> but now sleep time
[20:29:28] <Jartza> night all!
[20:30:00] <Lambda_Aurigae> later dude.