#avr | Logs for 2012-07-01

Back
[03:07:40] <rue_mohr> anyone here not in the usa?
[03:07:49] <rue_mohr> australlia anyone?
[03:07:53] <rue_mohr> england?
[03:08:06] <rue_mohr> china?
[03:16:38] <specing> europe.
[04:16:29] <Richard_Cavell> Australia
[04:27:21] * inflex is AU
[04:27:31] <inflex> waaaaait a second... Richard... /me -squints-
[04:28:45] <Richard_Cavell> What are you squinting for?
[04:28:55] <Richard_Cavell> I'm an Aussie and I like AVR
[09:31:31] <wopi> Hi People, I have trouble to read my ds18s20 via ATMEGA8 with gcc. Can somebody have a look ? http://is.gd/ET2s6Y
[09:32:02] <wopi> I got only ones from first two bytes of the scratchpad
[09:43:20] <wopi> exit
[09:45:19] <OndraSter> enter
[09:59:59] <Xeno1987> hi
[10:00:04] <Xeno1987> german?
[10:00:19] <OndraSter> Xeno1987, english
[10:00:22] <Xeno1987> need some help with HATMega 16
[10:00:59] <Xeno1987> at the university we have the homework to programm an 4x3 PIN Keypad
[10:01:20] <Xeno1987> i use AVR Studio 4.19
[10:01:34] <Xeno1987> we only work with simulation
[10:02:29] <Xeno1987> I can tell quickly the task
[10:02:50] <Xeno1987> The keystroke Matrix is connected to PORTA
[10:03:32] <Xeno1987> whereby PA7-PA5 is Output(low) and PA3-PA0 as Input(Pull-Up)
[10:04:12] <Xeno1987> If no key pressed, PA3-PA0 is High
[10:04:55] <Xeno1987> at the moment someone press a key the following row is set to low
[10:05:25] <Xeno1987> note: it is not possible to enter at same time more than one key
[10:05:48] <Xeno1987> in order to detect a keystroke do following:
[10:07:32] <Xeno1987> if one key is hit (one of PA3-PA0 not high anymore), 2 colums of 3 should set to be high
[10:08:10] <Xeno1987> after this you should call get_row(this part is given by professor)
[10:09:33] <Xeno1987> if the key which was hit lies in the column which was set to low, you should return row(1-4) to R16 otherwise 0
[10:09:59] <Xeno1987> This procedure should be done for the other 2 combinations of the columns
[10:11:00] * OndraSter has no idea how it is wired up
[10:11:15] <Xeno1987> The Pin could be as long as you want therefore you should save the entered sequence under the LAbel Code in RAM
[10:11:58] <OndraSter> I like schematics, I like code
[10:12:07] <Corwin> i like trains
[10:12:15] <OndraSter> I hate trains tbh
[10:12:36] <Xeno1987> the verfication should start after entering #
[10:12:39] <CapnKernel> I like boobs
[10:12:43] <CapnKernel> They're like train sets
[10:13:04] <CapnKernel> Designed for children, but men like to play with them.
[10:13:06] <Xeno1987> the pin itself should be saved under LAbel PIN at the ROM
[10:13:15] <OndraSter> CapnKernel, :D
[10:13:29] <Xeno1987> so can anyone help me
[10:13:36] <Xeno1987> i will post my code
[10:13:49] <CapnKernel> Xeno1987: Possibly, but you haven't told us what the problem is.
[10:14:11] <CapnKernel> Can we do your homework for you? No.
[10:14:21] <Xeno1987> no sry
[10:14:52] <Corwin> post the code then
[10:14:56] <Xeno1987> the problem i have is that i dont know how to check the three combinations of the columns
[10:15:01] <Xeno1987> *Tresorprogramm welches die Eingabe eines Pins am Tresor
[10:15:01] <Xeno1987> *simulieren soll
[10:15:01] <Xeno1987> */
[10:15:01] <Xeno1987> .include "m16def.inc"
[10:15:06] <OndraSter> NOT HERE
[10:15:07] <Corwin> omg
[10:15:08] <OndraSter> pastebin
[10:15:10] <OndraSter> oh
[10:15:12] <OndraSter> flood lol
[10:15:14] <OndraSter> that was quick
[10:15:19] <CapnKernel> Foot, smoking hole!
[10:15:23] <OndraSter> PASTEBIN
[10:15:25] <OndraSter> not here
[10:15:26] <Xeno1987> sry
[10:15:29] <Xeno1987> one moment
[10:16:52] <Xeno1987> http://pastebin.com/a53Hrc0c
[10:17:31] <Xeno1987> sry the comments are in german
[10:18:46] <Xeno1987> did you get it
[10:18:50] <OndraSter> yes
[10:18:50] <Xeno1987> ?
[10:18:53] <Xeno1987> ok
[10:18:59] <OndraSter> but I am having hard time understanding it
[10:19:11] <OndraSter> the only thing I understand is "Initialisierung des SP"
[10:19:13] <Xeno1987> should i translate the comments
[10:19:30] <Xeno1987> it would take 5 min
[10:24:47] <OndraSter> I still don't know how you read the keyboard
[10:24:58] <OndraSter> there should be 3 pins for ROW and 4 for COLUMN (or the opposite)
[10:25:39] <Corwin> thats what PORTA is for in his code
[10:26:01] <OndraSter> yeah
[10:26:44] <Xeno1987> ok
[10:26:52] <Xeno1987> i have translate it
[10:27:05] <OndraSter> but somewhere he uses pullups, somewhere he has it as output, somewhere as input
[10:27:08] <OndraSter> I got lost there
[10:27:16] <Corwin> heh
[10:27:29] <Xeno1987> http://pastebin.com/5zb9eXVx
[10:28:21] <Xeno1987> no we should only use PORTA every row/column is set to one Bit of the Port
[10:28:43] <Xeno1987> With DDRA i say to COntroller make it Input or Output
[10:28:50] <OndraSter> do you have schematics how it is wired up?
[10:28:53] <OndraSter> or what kind of keyboard it is?
[10:29:03] <Xeno1987> one moment it is a pdf
[10:29:48] <Xeno1987> http://www.iti.uni-luebeck.de/uploads/media/TGI_UEbung12.pdf
[10:31:29] <OndraSter> I think I understand it (slowly)
[10:31:36] <Xeno1987> yea
[10:31:43] <OndraSter> you set the half as input with pullups, the second half as outputs LOW
[10:32:03] <OndraSter> then when some key is pressed, you switch them. Inputs are outputs low and vice versa
[10:32:03] <Xeno1987> it is one of the hardest exams in my study
[10:32:13] <Xeno1987> yes right
[10:32:14] <OndraSter> you read always the half and then the bottom
[10:32:22] <OndraSter> then you OR those two
[10:32:23] <Corwin> heh.... second task in that PDF is guitar tuner... will be harder :)
[10:32:36] <Xeno1987> oh no
[10:34:09] <Xeno1987> but my code is correct until now or
[10:35:03] <Corwin> not exactly correct
[10:35:43] <Xeno1987> after reading PINA
[10:36:18] <Corwin> i see it is some subroutines put together to one file... not programm
[10:37:03] <Xeno1987> the subroutines getrow, granted, denied, wait1hour i dont need to programm
[10:37:15] <Corwin> like READ and KEY_OK has no RET at the end
[10:37:16] <Xeno1987> their given
[10:37:36] <Corwin> meaning mcu will process Initialization, then follow to read, then to key_ok...
[10:37:38] <Xeno1987> because i should write the main at end
[10:37:51] <Xeno1987> so i let it open
[10:37:58] <Xeno1987> until i understand this part
[10:38:03] <Corwin> ok then
[11:38:01] <DanFrederiksen> can you read out the programs from AVRs or can you protect the code?
[11:38:19] <OndraSter> you can protect it
[11:38:22] <OndraSter> with bit lock bits
[11:38:28] <OndraSter> with lock bits*
[11:38:36] <DanFrederiksen> ok
[11:39:03] <DanFrederiksen> and that can't be hacked?
[11:39:13] <DanFrederiksen> reasonably
[11:39:28] <timemage> definitely doesn't make it easy.
[11:39:33] <DanFrederiksen> so it's not just an illusion of security
[11:39:42] <OndraSter> no
[11:39:49] <DanFrederiksen> like copy protection on computer software
[11:39:57] <OndraSter> you can always grab a drill, get rid of the plastic on the chip, use a magnifying glass...
[11:39:59] <OndraSter> aka the chinese way :D
[11:40:00] <timemage> DanFrederiksen, i'd say no. look up decapping.
[11:40:19] <DanFrederiksen> really difficult is ok
[11:40:44] <DanFrederiksen> OndraSter, are flashbits actually visible? :)
[11:40:55] <OndraSter> no idea :D
[11:41:20] <DanFrederiksen> bit of a mystery how flash mem works
[11:41:34] <Tom_itx> don't xmegas also use encryption if you use it?
[11:44:05] <OndraSter> encryption as ...?
[11:44:09] <OndraSter> they have hardware AES and DES
[11:44:15] <OndraSter> but the flash is just flash
[12:17:17] <RikusW> http://markshroyer.com/2012/06/c-both-true-and-false/
[12:43:23] <Other019> hi
[12:44:09] <RikusW> hi
[12:44:15] <Other019> i lost all my motivation, but lcd works
[12:44:17] <Other019> ...
[12:44:25] <OndraSter> heh
[12:44:27] <Other019> only in 8 bit mode :(
[12:44:39] <OndraSter> during init you need to send three times value 4 I think
[12:44:45] <OndraSter> with some minimal timing between them
[12:44:56] <Tom_itx> i recall something to that effect as well
[12:45:08] <Other019> if U have good and tested libs can U give me a link?
[12:45:15] <OndraSter> arduino :D
[12:45:23] <Tom_itx> yes, peter fleury has a good one
[12:45:49] <Tom_itx> http://homepage.hispeed.ch/peterfleury/avr-software.html
[12:45:50] <Other019> I'm afraid of arduino :P
[12:45:59] <Tom_itx> i've used his
[12:46:58] <Tom_itx> check the header file for the number of lines and width as they will map differently in memory
[12:47:02] <Other019> Tom_itx. THX very much
[12:47:17] <Tom_itx> read his docs
[12:47:22] <Other019> ok
[12:47:31] <Tom_itx> nibble or byte mode too
[12:47:49] <Tom_itx> nibble is sufficient as they are inherently slow devices anyway
[12:48:50] <Other019> I'll read it eaven if U didn't write about it, but when i can't start my program :)
[12:49:15] <Other019> Maybe tommorow i'll tryit
[12:49:20] <Other019> *try it
[13:10:08] <RikusW> Is there serial interface LCDs available ? (instead of 44780...)
[13:12:40] <Tom_itx> i made one
[13:12:58] <Tom_itx> there may be i2c
[13:13:01] <Tom_itx> i dunno
[13:14:17] <RikusW> how did you make it ? avr to 44780 ?
[13:14:36] <Tom_itx> 2313
[13:14:58] <OndraSter> :)
[13:15:06] <OndraSter> too bad it won't fit attiny13 anymore :(
[13:15:12] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/toaster_oven/toaster_oven_index.php
[13:15:22] * RikusW wonders why the 44780 didn't have some serial interface in the first place...
[13:15:23] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/toaster_oven/serial_lcd_sch.png
[13:15:32] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/toaster_oven/serial_lcd_brd.png
[13:15:43] <Tom_itx> cost?
[13:16:24] <Tom_itx> you're welcome to the files if you want them
[13:16:32] <RikusW> thanks
[13:17:06] <Tom_itx> iirc inflex wrote most of the code for it
[13:17:13] <RikusW> I just downloaded the HD44780U datasheet
[13:17:31] <Tom_itx> i've got that up there somewhere too
[13:17:33] <RikusW> but don't have the hw....
[13:17:47] <OndraSter> as far as I know there is no serial in 44780
[13:18:24] <OndraSter> you can get away with tiny13 and 595
[13:18:30] <OndraSter> two pins in total from tiny
[13:18:56] <OndraSter> one to dump data to the 595 and one to clock the E pin on the display
[13:18:59] <Tom_itx> yeah i've heard of things like that
[13:19:12] <RikusW> over here t2313 is more expensive than a m168 =-O
[13:19:21] <OndraSter> lol
[13:19:23] <Tom_itx> but i've never tried it
[13:19:34] <Tom_itx> so mod the board
[13:19:36] <OndraSter> Tom_itx, I don't suppose there is any reason why it shouldn't work
[13:19:48] <OndraSter> on the other hand tiny has no I2C
[13:19:53] <OndraSter> software I2C :/
[13:20:32] <RikusW> I got m168 for ZAR20 and m324A for R30, t2313 was like R28....
[13:20:38] <OndraSter> heh
[13:20:43] <OndraSter> grab the cheapest one then
[13:21:05] <RikusW> 1Euro = R10,50
[13:21:18] <RikusW> or was it almost R11...
[13:26:56] <Tom_itx> use a U2 then you can have USB LCD
[13:26:58] <Tom_itx> :)
[13:27:10] <RikusW> yep
[13:44:28] <sabesto> is there no other way then using ASF with xmega/uc3?
[13:45:13] <RikusW> You can use it directly, with significantly more work and knowledge involved...
[13:45:42] <sabesto> like, the registers are not listed
[13:45:43] <RikusW> Tom_itx: why didn't you use 8 bit mode ? there seems to be enough free pins on the 2313..
[13:46:17] <RikusW> abcminiuser is the uc3 expert around here, ask him when he is around
[13:46:46] <RikusW> or try #avr32
[13:46:57] <sabesto> ive just started messing with asf, seems ok but i want to know whats going on
[13:47:17] <RikusW> the registers should be listed in the datasheets...
[13:47:24] <sabesto> they are not :P
[13:47:33] <OndraSter> they are
[13:47:37] <OndraSter> but not in the device datasheet
[13:47:41] <OndraSter> but device line datasheet
[13:48:48] <sabesto> i'll have a look
[16:51:17] <Tom_L> first avr sample...ever: http://www.youtube.com/watch?v=Pn0uvCfu1h0&list=PL7E1F2259CB2137D8&index=1&feature=plcp
[16:58:08] <drgreenthumb> neat
[16:58:15] <drgreenthumb> heh the "ancient history" of 1997 :)
[16:58:34] <Xark> But kind of cool it is still running of the original battery. :)
[16:58:40] <Xark> off*
[16:58:44] <drgreenthumb> it kicks PIC and 8051s ASS! ;D
[17:01:31] <OndraSter> yeah
[17:13:26] <OndraSter> hmmm I am thinking whether it is possible to make some kind of soft-debugging on xmegas... but since there is no equivalent of "DR" registers from x86 it doesn't seem possible
[17:13:42] <OndraSter> also since it is running native code
[17:13:57] <OndraSter> and not interpreted anything
[17:37:42] <Xark> OndraSter: Yeah, seems like a tricky problem. Perhaps a high frequency interrupt source, so you execute interrupt handler in between every instruction (assuming mainline doesn't disable interrupts...)?
[17:37:54] <OndraSter> he
[17:37:55] <OndraSter> heh
[17:38:02] <OndraSter> and always check in stack return address?
[17:38:07] <OndraSter> not something I want to do really
[17:38:13] <OndraSter> let alone purely in software
[17:38:22] <Xark> OndraSter: Probably better off interpreting machine code...
[17:38:28] <OndraSter> yeah
[17:38:30] <OndraSter> .NET for AVR
[17:38:30] <OndraSter> mmmm
[17:38:34] <OndraSter> I'd tap that
[17:41:04] <OndraSter> I wanted to push "Arduino" to new level :)
[17:41:07] <OndraSter> higher level*
[17:41:59] <OndraSter> having netduino right beside me
[17:42:04] <OndraSter> that integrates into visual studio
[17:42:12] <OndraSter> supporting breakpoints, debug, ... right through USB
[17:42:14] <OndraSter> NOT BAD!
[17:42:19] <OndraSter> actually even through ethernet
[17:43:59] <Xark> OndraSter: If you purchased something like AVaRICDE/AVR Dragon, then I believe you could do similar with AVR & gdb. I guess there are cycle accurate emulators too that support gdb...
[17:44:12] <OndraSter> oh it is not for me :)
[17:44:27] <OndraSter> I wanted to make advanced "Arduino"
[17:44:31] <OndraSter> that supports debugging
[17:44:39] <OndraSter> without reflashing on each breakpoint
[17:45:02] <Xark> OndraSter: Yeah, that is much harder [impossible?] due to architecture constraints (as you mentioned).
[17:45:05] <OndraSter> yeah
[17:45:23] <OndraSter> (also upgrade the "next-gen arudino" to xmega)
[17:45:38] <OndraSter> I like the idea of arduino, I hate the way it looks and works
[17:45:51] <OndraSter> the arduino "sketches" and application
[17:45:54] <OndraSter> it is more WTF than anything
[17:46:33] <Xark> OndraSter: I suppose the best (without hardware) would be something where you have the PC emulate the sketch and have a tiny "stub" on AVR that sets hardware bits (so "as if" the code was running on AVR hardware).
[17:46:41] <OndraSter> hmm
[17:46:43] <OndraSter> yeah
[17:46:51] <OndraSter> so there would be both "debug" and "release" options
[17:47:03] <OndraSter> I thoguht about that as well
[17:47:11] <OndraSter> I had something similar implemented when I was developing LED display
[17:53:16] <OndraSter> I do have to wonder
[17:53:23] <OndraSter> how fast would DOS emulator run on XMega :)
[17:53:39] <OndraSter> XMega can push 320x240 video to LCD with RGB interface just fine
[17:54:06] <OndraSter> decompressed video ofc
[18:01:48] <Xark> Hmm, Xmega...not ATmega? I am not familiar with that architecture.
[18:01:57] <OndraSter> ATXmega
[18:02:06] <OndraSter> better megas :)
[18:02:08] <OndraSter> by far
[18:02:14] <OndraSter> and they are not that much more expensive
[18:02:20] <Xark> Is it a superset or incompatible?
[18:02:23] <OndraSter> superset
[18:02:38] <Xark> OndraSter: Interesting. Is Arduino stuff compatible?
[18:02:43] <OndraSter> no
[18:02:53] <OndraSter> if megas had 3 registers per peripheral in average
[18:02:58] <OndraSter> this has 20 registers per peripheral :o
[18:03:05] <OndraSter> you can get 256kB flash, 16kB RAM, 4kB EEPROM, 16 channel (two ADCs at once!) 12bit 2MSPS ADC
[18:03:13] <OndraSter> 2 channel 12bit 1MSPS DAC (real DAC, not PWM!)
[18:03:20] <OndraSter> 32 PWM channels (or 24?)
[18:03:29] <OndraSter> welll, a lot of PWM channels
[18:03:32] <OndraSter> USB
[18:03:35] <OndraSter> DMA
[18:03:36] <OndraSter> Event system
[18:03:42] <OndraSter> another 1000 peripherals
[18:03:45] <OndraSter> for less than 5 bucks
[18:03:52] <Xark> Yeah. I think I accidentally downloaded the instruction set docs for Xmega (and was like "wow, I never knew this opcode existed" for a bit...)
[18:04:00] <OndraSter> yeah, they have few more
[18:04:04] <OndraSter> mostly for 16bit stuff
[18:05:15] <Xark> Hmm, 32Mhz clock too...
[18:05:20] <Xark> http://www.akafugu.jp/posts/products/akafuino/
[18:05:43] <OndraSter> yeah, 32MHz
[18:06:09] <OndraSter> akafuino is nothing like what I am doing
[18:06:12] <OndraSter> for what I need to order board
[18:06:13] <OndraSter> s
[18:06:19] <OndraSter> check out atxmega256a3u
[18:06:21] <OndraSter> and its peripherals
[18:06:39] <OndraSter> $4.98/pcs with 1piece order @ mouser
[18:07:09] <Xark> Cool. I was just googling to see if there were Arduino varients using Xmega (yes, but very few surprisingly).
[18:07:23] <OndraSter> well whole arduino "framework" has to be ported
[18:07:27] <OndraSter> there are new registers etc
[18:08:10] <Xark> OndraSter: Sure. But not really too much to Arduino (in the grand scheme of OSes/libs).
[18:08:23] <OndraSter> ?
[18:08:34] <OndraSter> HOLY S.IT the akafuino X is priced at 49.99 bucks
[18:08:35] <OndraSter> US bucks!
[18:08:49] <OndraSter> well, that FTDI chip makes most of the price...
[18:08:54] <Xark> OndraSter: Cheaper than Arduino Mega at least. :)
[18:08:57] <OndraSter> heh
[18:09:03] <OndraSter> but the akafuino has 32kB flash :P
[18:09:15] <OndraSter> I was scared to price my project at 20€
[18:09:26] <OndraSter> or something around that
[18:09:31] <OndraSter> (still need to get the boards)
[18:09:38] <OndraSter> and make USB bootloader some kind of!
[18:09:48] <OndraSter> I don't like using somebody else's code :X
[18:10:00] <OndraSter> all the licensing stuff and what not drives me mad
[18:10:14] <OndraSter> also I don't trust anybody else's code
[18:11:36] <OndraSter> I have got so much projects in my mind...
[18:11:41] <OndraSter> but not enough money
[18:11:43] <OndraSter> _D
[18:11:44] <OndraSter> :D
[18:11:57] <Xark> Heh. Yeah.
[18:12:04] <OndraSter> time - sure
[18:12:07] <OndraSter> but not money
[18:12:29] <Xark> Now you have made me want to get an Xmega chip to toy with...but I can only see one Sparkfun breakout board for $25 (and it is not a USB enabled part...)
[18:12:37] <OndraSter> heh
[18:12:39] <OndraSter> you'd like my one
[18:12:50] <OndraSter> but I don't have FRIGGIN MONEY TO ORDER THE PARTS FOR IT right now
[18:12:51] <OndraSter> arrgh
[18:13:06] <OndraSter> I need EVERYBODY to pay the money they owe me
[18:13:21] <OndraSter> like... RIGHT NOW
[18:13:23] <OndraSter> arrgh
[18:23:49] <OndraSter> hmm
[18:24:00] <OndraSter> for extra half euro I suppose I could change the LDO for switchmode power supply
[18:24:09] <OndraSter> LMR10510X
[18:24:30] <OndraSter> 0,47€ for the SMPS controller + few 0.nothing for parts vs 0.2€ for LDO
[18:26:49] <OndraSter> but... who would fit that on the PCB!
[18:33:24] <nevdull> Xark: you can get 64pin TQFP adapater from http://www.futurlec.com/SMD_Adapters.shtml for $1.30 and then use http://www.instructables.com/id/Build-an-AVR-Xmega-Prototyping-Board/ to build your own :)
[18:34:28] <Xark> nevdull: Cool. Thanks for the links.
[18:34:35] <nevdull> sure thing. good luck!