#avr Logs

Mar 15 2017

#avr Calendar

12:06 AM sabor_ is now known as sabor
12:46 AM Emil: enhering: got my money back :D
12:46 AM daey_ is now known as daey
12:47 AM scrote: if PINB & 0x2 yeilds true then that means PB1 is pressed. correct?
12:47 AM Emil: enhering: in ebay seller is responsible for return cost, apparently mine was quite nuclear :D (but seriously though, damn these shipping costs are ATROCIOUS)
12:48 AM Emil: scrote: no
12:48 AM Emil: yes
12:48 AM Emil: yes correct
12:48 AM polprog: shouldnt it be 0x02?
12:49 AM Emil: polprog: I think the compiler doesnt care if it is byte aligned or not
12:49 AM polprog: i dunno
12:50 AM Emil: scrote: the mentioned registers are all part of the same gpio circuitry, but they control different aspects of it
12:51 AM Emil: scrote: one usually dois it like this: PINx&(1<<PIN)
12:52 AM Emil: it takes the same amount of cycles because its compile time optimised
12:53 AM scrote: typo. I mean 0x02
12:53 AM Emil: one could also dedine a wrapper unsigned char bit(unsigned char n){return(1<<nn);}
12:53 AM Emil: or a macro
12:54 AM Emil: both should result in full optimisation unless you are silly and have them off
12:57 AM Emil: scrote: you can also use 0b10101010
12:57 AM Emil: if you wish
01:00 AM polprog: i always used PINx & 0xsomething
01:03 AM Emil: so naughty
01:03 AM Emil: hardcoding things
01:03 AM Emil: ;)
01:04 AM Emil: Though good job security if you do so
01:04 AM polprog: im not hardcoding stuff
01:05 AM Emil: 0xNumber is hardcoding :D
01:06 AM polprog: you think i should #define them like BUTTON_UP 0x04, and the port like so?
01:06 AM polprog: maybe i should...
01:06 AM Emil: I'd recommend for it
01:07 AM polprog: i guess you are right. thats a good idea
01:08 AM Emil: Like, you could have been doing *somenumber=somevalue, too. You are just using the defines from the libraries
02:56 AM daey: Emil: idk. is that really helping to secure a job? They will only find out after they fired you.
02:58 AM daey: that being said i do recommend the pdf "How To Write Unmaintainable Code"
03:05 AM inflex: "Write it in Perl"
03:07 AM NoHitWonder2: when you get a job, you have to follow company's coding conventions so it doesnt really matter how you code before that
03:08 AM _ami_: NoHitWonder2: thats true if you are working on closed source code. but now a days most of the components used are opensource so you have to following the coding convention of the particular open source project you are working on.
03:09 AM NoHitWonder2: true
03:14 AM daey: NoHitWonder2: chapter 18: Bypassing Company Coding Standards
05:29 AM Emil: daey: well, they mighr buy consulting from you afterwards ;)
05:37 AM Emil: https://www.se.rit.edu/~tabeec/RIT_441/Resources_files/How To Write Unmaintainable Code.pdf
05:40 AM Thrashbarg: Emil: How%20to%20make%broken%links.pdf
05:40 AM Thrashbarg: lol :P
05:47 AM Arlenx: I'm trying to produce PWM on timer2 with this tin code: http://pastebin.com/0eh6E5BQ but it's not working. any idea why?
05:52 AM Arlenx: it works now :)
05:58 AM Shadouw: Why? ;-)
06:00 AM polprog: who are you, denvercoder? what did you see?
06:00 AM Emil: Thrashbarg: if you copypaste to browser it'll work
06:01 AM Emil: Thrashbarg: you have no idea the trouble I went through because google on mobile wouldnt give me a direct link
06:17 AM Thrashbarg: Emil: indeed. I'm not having a go I'm just being silly lol
06:59 AM Emil: ;)
07:02 AM daey: Emil: or sue you into 'free consulting' :P
07:07 AM Emil: daey: That's when you delete gym, facbook up and hit lawyer
08:05 AM darsie: Hmm, are we supposed to highlight rue_house? ;)
08:08 AM darsie: Does chess fit in avr?
08:26 AM Emil: darsie: I think there is some rudimentary chess playing algorithm that can fit to some avrs
08:27 AM darsie: ok
08:28 AM darsie: Like, it knows all rules, but doesn't play very strong?
08:30 AM Emil: yes
08:31 AM Emil: "Strong" is mostly that it can calculate ahead. "Really Strong" is when it can think ahead.
08:32 AM darsie: So you think deep blue (?) thinks rather than calculates?
08:33 AM darsie: https://en.wikipedia.org/wiki/Deep_Blue_%28chess_computer%29
08:33 AM Emil: Calculates
08:54 AM Ad0: there are those 32 bit AVRs
09:05 AM darsie: I'd just like to play against an avr powered by a small solar panel.
09:21 AM Emil: http://lmgtfy.com/?q=avr+chess+computer
09:23 AM rue_house: darsie, ?
09:24 AM darsie: thx :)
09:33 AM bss36504: polprog: sup?
09:59 AM polprog: bss36504: usual business. boring. i failed chem test today
10:14 AM darsie: https://github.com/Danjovic/ChessMate
10:33 AM Emil: darsie: wtf :D
10:33 AM Emil: damn
10:33 AM darsie: chess on ATmega328
10:34 AM Emil: never realised that an avr is only ~100th of a standard desktop processor
10:34 AM darsie: That much?
10:34 AM Emil: Thought it was like a thousath or ten thosandth at least
10:34 AM Emil: thousandth*
10:34 AM Emil: But 1%
10:34 AM Emil: Damn, that's quite amazing to think about
10:35 AM darsie: It's about 1/100th the clock, but then it probably has lower instruction power/pipelining etc.
10:35 AM Emil: I should make a 100 avr multicore pc ;)
10:35 AM Emil: darsie: well, looking at the performance
10:35 AM Emil: darsie: (100k vs 1k)
10:35 AM darsie: yeah
10:35 AM darsie: what?
10:37 AM darsie: ahh
10:37 AM darsie: node speed
10:38 AM polprog: Emil: i was thinking about paralell avr processing
10:38 AM Emil: polprog: yeah
10:44 AM bss36504: polprog: shitty, I was never much good at chem
11:23 AM polprog: bss36504: i'm more of a physics person. that chem was mainly memorized stuff
11:23 AM polprog: nvm, it's over
11:26 AM cousteau`: how do I handle an interrupt? As soon as I enter the interrupt I disable it so that it doesn't get re-triggered, or do I just act normally and finally clear a flag to re-launch it?
11:26 AM cousteau`: (specifically, TIMER1_COMPA)
11:26 AM Emil: cousteau`: when you enter interrupt that is not made special with naked and so on
11:27 AM Emil: the flag is cleared automatically in the preamble generated by gcc
11:27 AM cousteau`: ah, so gcc creates a preamble when I say ISR()?
11:27 AM bss36504: yes
11:27 AM Emil: And also nested interrupts must be enabled specifically
11:27 AM polprog: you can indeed disable interrupts but only if you need it
11:27 AM cousteau`: and an epilogue as well?
11:27 AM Emil: So no need to disable the interrupts
11:27 AM Emil: cousteau`: ISR generates everything
11:27 AM cousteau`: cool, that simplifies it :)
11:28 AM Emil: cousteau`: yeah, but the overhead is around 40 cycles in out
11:28 AM Emil: together*
11:28 AM Emil: 20 in, 20 out
11:28 AM cousteau`: ah :(
11:28 AM polprog: remember that if you have a long piece of code, then set a flag inside the ISR and do the rest in main()
11:28 AM cousteau`: ok this limits the functionality of this
11:28 AM Emil: But it's still better than polling ;)
11:29 AM * cousteau` was considering making a super-short interrupt that will get triggered once every 16 clock cycles, registers a port, checks some stuff and leaves
11:29 AM cehteh: in some cases you can use the interrupt to wake your main loop only, even a EMPTY_INTERRUPT() will do then
11:29 AM xentrac: "registers a port"?
11:29 AM cehteh: 16cycles are impossible
11:29 AM bss36504: Semi-related: What file is the ISR macro defined in?
11:29 AM Tom_L: why would you interrupt every 16 cycles? that's ridiculous
11:30 AM cousteau`: so... well, I'll be limited to, like... maybe 100 kHz
11:30 AM Tom_L: that's all the chip would be doing if it could even do that
11:30 AM cehteh: when you need that short things then you prolly better do a manual loop with ISR's disabled (if timing is critical)
11:30 AM bss36504: every 16 cycles is practically polling anyway
11:30 AM Emil: cousteau`: what are you doing
11:30 AM cousteau`: Tom_L: was thinking on making an oscilloscope with arbitrary sampling rate; 16 cycles at 16 MHz would allow 1 Msa/s
11:30 AM cehteh: what do you want to do?
11:30 AM Emil: pls
11:30 AM Emil: then poll
11:30 AM cehteh: you can do that in hardware
11:31 AM cehteh: no need for isr's
11:31 AM cehteh: set up timer to trigger the ADC
11:31 AM xentrac: cousteau`: using an external ADC? because I don't think there are any AVRs with a 1Msps ADC
11:31 AM Emil: cousteau`: and it would ber "oscilloscope"
11:31 AM bss36504: Wait, how would you even do a conversion that fast? No way you could get 1Ms/s with a 16MHz AVR
11:31 AM cousteau`: no no, digital read
11:31 AM bss36504: Certainly not with the in built ADC
11:31 AM xentrac: oh, more like a logic analyzer then
11:31 AM bss36504: Oh, but even then
11:31 AM cousteau`: the ADC goes at like 10 kHz I think
11:31 AM cehteh: 15
11:32 AM bss36504: just moving the information to some sort of communication module is borderline impossible at that speed
11:32 AM LeoNerd: 1Ms/sec is hardly oscilloscope-grade
11:32 AM cousteau`: yeah, logic analyzer, sorry
11:32 AM cehteh: bit more with some tricks
11:32 AM cehteh: anyway
11:32 AM LeoNerd: Maybe if you only ever work in audio frequencies
11:32 AM Emil: the adc does a max of 125kS/s
11:32 AM Tom_L: is this just because you want to?
11:32 AM cehteh: how many channels do you want to watch?
11:32 AM Tom_L: there are cheap LA out there
11:32 AM cehteh: yes AVR's are not the best for that
11:32 AM cousteau`: I mean, if 1 Msa/s is impossible, I'll just go to lower max frequencies, no big deal
11:32 AM cehteh: but still its not impossible
11:32 AM Tom_L: saleae is one of the best though imo
11:33 AM cehteh: you make a timer/naked isr which only queues the actual port values to some small queue
11:33 AM cehteh: that isr should be high priority
11:33 AM polprog: bus pirate's not bad too
11:34 AM bss36504: This is one of those discussions where I will be inherently biased. I hate building tools, it's such a waste of time IMO when I can convert the hours and hours of my time into money to buy the "real thing"
11:34 AM cehteh: then you can handle the write out with some lower pri isr's
11:34 AM cehteh: should be reasonable simple
11:34 AM bss36504: Only tools I would consider building are low-precision lab equipment stuff; power supplies, reflow oven, maybe a function generator.
11:34 AM cehteh: but there is a hard limit how fast that can go
11:34 AM Tom_L: bss36504 you'll never convince rue_house of that :)
11:34 AM hetii: Hello:)
11:34 AM bss36504: Tom_L: Oh, I know
11:34 AM polprog: bss36504: yeah, there's no point building an LA when there are cheap versions just for the sake of having an LA, but you can learn stuff while doins so
11:34 AM cousteau`: polprog: I have a Logic Pirate; it's not real time
11:35 AM hetii: Q: any clue if I can use lpc-link v1.1 to reflash STM32 mcu?
11:35 AM cousteau`: so I decided to make a more real-time-ish Arduino-based one
11:35 AM bss36504: polprog: Sure, if its for learning then have at it, just me personally I'd rather build something more...constructive
11:35 AM bss36504: Also why wouldnt you just use a better processor for the job?
11:35 AM polprog: bss36504: sure thing.
11:35 AM bss36504: Unless you're a masochist
11:35 AM polprog: like an ARM, i dunno
11:35 AM bss36504: lol yup
11:35 AM polprog: something faster, maybe FPGA
11:36 AM Tom_L: saleae use fpga iirc
11:36 AM bss36504: The core is irrelevant in this case even, just something *faster*
11:36 AM * polprog hasn't used any programmable chips except avrs and raspi
11:36 AM bss36504: Tom_L: Pretty sure also
11:36 AM bss36504: polprog: Well then if it's a learning experience...
11:37 AM bss36504: If I'm trying to learn a totally new thing, I like to limit the "new stuff" to one big thing. Like if I can drive LCDs on an AVR but I didn't know anything about ARM, I wouldn't build a friggin embedded linux SBC as my first ARM project
11:37 AM polprog: i remember there was a guy on hackaday who was freerunning a RAM stick and then reading it, making it a fast LA
11:38 AM bss36504: Sure, but he probably had a pretty good handle on what went into making a LA. Not to shit on cousteau`, but he asked about how to do something with an ISR, which does not inspire the level of knowledge required to really push the boundries he's trying to push
11:39 AM bss36504: Start small, work your way up is my process
11:39 AM bss36504: Rome wasn't built in a day, yadda yadda...
11:39 AM polprog: yeah
11:39 AM polprog: that's how it should be done
11:41 AM cousteau`: ok so I'll start with slowish interrupts, maybe measure how long it takes for them to complete
11:41 AM polprog: use a timer for that
11:41 AM skz81: <Emil> the flag is cleared automatically in the preamble generated by gcc > nope !
11:42 AM cehteh: cousteau`: you can always use the naked interrupts for such simple things
11:42 AM cehteh: thats *much* faster
11:42 AM cousteau`: ok, I'll read into that
11:42 AM cehteh: you only need a small static queue with one write and one read end, thats simple to do as well
11:43 AM cousteau`: "The user code is responsible for preservation of the machine state including the SREG register"... ok I didn't think of the stack and the registers and all the cleanup I should actually do
11:44 AM skz81: <Emil> And also nested interrupts must be enabled specifically >> huh.... If you ask for nested interrupt, then, maybe, unsure how to ask for them to GCC's... anyway I like rather sei() in a naked ISR when needed :p
11:44 AM cousteau`: but thanks, now I know what I need to do if I want to push the limits
11:44 AM cehteh: cousteau`: receipe for naked interrupts: write normal interrupt handler in C. dump the generated asm .. copy that over as inline asm, modify that to your liking
11:45 AM polprog: apropos pushing limits: https://www.youtube.com/watch?v=KVRvWmcxnA0
11:45 AM cehteh: if you naked isr only needs to append something to a queue that would be a few asm instructions only without tampering with other registers mabe even without sreg
11:46 AM cousteau`: heh
11:46 AM Emil: skz81: if you enable interrupts again
11:46 AM Emil: skz81: sei is exactly what enables nested interrupts
11:46 AM Emil: if you call it within an ISR
11:46 AM cousteau`: well, what was supposed to be a super simple circular buffer has ended up as something ~25 lines of C
11:47 AM cehteh: be careful that your nested isr's dont explode :D
11:47 AM skz81: Emil, what I said is that gcc, by default at least WON'T sei in the ISR prolog
11:47 AM Emil: skz81: I know
11:47 AM Emil: skz81: like I said
11:47 AM cehteh: cousteau`: sounds like too much code :)
11:47 AM cehteh: i do it in 1-2 lines
11:47 AM Emil: they must be enabled specifically if wanted
11:47 AM Emil: skz81: was there something unclear? :D
11:48 AM skz81: Emil >> the prolog as nothing to do with seting or clearing the int flag,
11:48 AM Emil: skz81: mate, please read what I wrote :D
11:49 AM skz81: "cleared automatically in the preamble generated by gcc"
11:49 AM Emil: the global
11:50 AM Emil: hardware clears the specific interrupt flag (most of the time)
11:54 AM cousteau`: cehteh: I also want to do some trigger stuff
11:55 AM cousteau`: otherwise yeah, it'd be 2 lines
11:56 AM cousteau`: buffer[counter++] = PORTD; if (counter == limit) dump_buffer();
12:09 PM cehteh: cousteau`: you should do the triggering outside of the timer/sampling isr
12:10 PM cehteh: pcint int0 or int1 just for the trigger
12:10 PM cousteau`: but I need to sample in order to know that a signal changed
12:10 PM cehteh: mhm or maybe not, well just do the bare minimum in the timers isr
12:10 PM cousteau`: the trigger comes from the signals I'm monitoring themselves, not external trigger
12:10 PM cehteh: yes you can sample all the time and push that to the queue
12:11 PM cehteh: then in your mainloop you read the queue and if trigger is present then enable TX or something like that
12:17 PM cousteau`: ...for some reason I'm not being able to read the port properly...
12:17 PM bss36504: cousteau`: use PIND
12:17 PM Emil: cousteau`: https://emil.fi/avr
12:17 PM bss36504: PORTx is for output, PINx is for input
12:17 PM cousteau`: m(
12:18 PM cousteau`: the datasheet was, like, not clear at all
12:18 PM Emil: bullshit
12:18 PM Emil: the datasheet is very clear on this :D
12:18 PM cousteau`: "Writing to the pin register provides toggle functionality for IO. Refer to Toggling the Pin."
12:18 PM cousteau`: That's all I got from the datasheet
12:18 PM Emil: yes
12:18 PM cousteau`: ...maybe the datasheet is clearer somewhere else and I shouldn't be just reading register descriptions
12:18 PM Emil: "writing to the pin register"
12:19 PM Emil: "writing"
12:19 PM Emil: not reading
12:19 PM bss36504: DDRx is for data direction, reading inputs is done from PINx, writing to outputs is done by writing PORTx. If you want an input to have a pullup, write to the PORTx register
12:19 PM Emil: cousteau`: no, the register descriptions are god tier
12:19 PM Emil: those are pretty much the only thing you need for most of the things
12:20 PM Emil: bss36504: pullup, when DDRx is input, that is
12:20 PM Emil: well, you could say that direct connection is a very, very strong pullup :D
12:21 PM bss36504: yes, I thought that would be obvious :P
12:21 PM cousteau`: Emil: ...are you reading the same datasheet as me?
12:21 PM bss36504: Link us your datasheet, cousteau`
12:21 PM bss36504: the exact one you're looking at
12:21 PM cousteau`: Atmel ATmega328/P [DATASHEET] Atmel-42735B-ATmega328/P_Datasheet_Complete-11/2016 page 118
12:22 PM Emil: cousteau`: WRITING
12:22 PM Emil: WRITING!=READING
12:22 PM cousteau`: Emil: yeah but it says absolutely zero about reading! My point was that that was the ONLY description I got
12:22 PM Emil: cousteau`: if you write to PINx register on m328p (and many others), you can toggle the output
12:22 PM Emil: ...
12:22 PM cousteau`: yeah I know if you write to PINx register you toggle the output, that's the only thing I got clear from the datasheet!
12:22 PM Emil: cousteau`: can you not read? :D
12:23 PM cousteau`: but it says nothing in that page that that's the register I have to read
12:23 PM cousteau`: if I want to read the pun
12:23 PM cousteau`: pin
12:23 PM cousteau`: so god tier my ass
12:23 PM bss36504: That's a weird datasheet, look at this one that covers the whole family: http://www.atmel.com/images/Atmel-8271-8-bit-AVR-Microcontroller-ATmega48A-48PA-88A-88PA-168A-168PA-328-328P_datasheet_Complete.pdf
12:24 PM bss36504: Look at section 14.2.n, starting on page 76
12:24 PM cousteau`: bss36504: yeah I had the two datasheets and I had no idea which one was the good one
12:24 PM bss36504: evidently the one I sent, since yours is apparently missing information ;)
12:24 PM Emil: http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-42735-8-bit-AVR-Microcontroller-ATmega328-328P_Datasheet.pdf page 118
12:25 PM Emil: cousteau`: stop being a whiny bitch :D
12:25 PM bss36504: Actually, I take that back. In your datasheet section 18.2.n tells the same stuff.
12:25 PM bss36504: Emil has some sass in him today
12:26 PM Emil: 18.2.4 specificially
12:26 PM Emil: specifically*
12:26 PM bss36504: indeed
12:27 PM Emil: Independent of the setting of Data Direction bit DDxn, the port pin can be read through the PINxn
12:27 PM Emil: Register bit.
12:27 PM cousteau`: ok so as I was saying before Mr. Stupid Internet decided to die...
12:28 PM cousteau`: Emil: so yeah, I admit that the page is literally called "Port B Input Pins Address"
12:29 PM cousteau`: but I didn't see that; I was just reading the description m(
12:29 PM bss36504: RTWFM: Read the WHOLE fucking manual :)
12:29 PM cousteau`: but anyway, 18.4.4 is pretty useless
12:30 PM bss36504: How so?
12:31 PM cousteau`: Emil: so what was god tier was 18.2.4, not the register description
12:31 PM bss36504: I think Emil was referring to the peripherals that have actually interesting registers
12:31 PM cousteau`: ok so maybe other registers
12:32 PM bss36504: For example, any peripheral except the GPIO
12:35 PM Emil: part name=string description=string image=link links=link list quantity=integer price=float tags=string list
12:58 PM Emil: Should I add anything else?
12:58 PM Emil: Making a parts/inventory list
01:03 PM cousteau`: ok so the good news is that my oscilloscope worked
01:03 PM cousteau`: the bad news is that Arduino Serial Plotter definitely sucks as data output. But hey, it works
01:03 PM xentrac: congratulations
01:04 PM Emil: cousteau`: you want high speed serial output?
01:04 PM cousteau`: so I guess it'd be nice to make my own oscilloscope
01:04 PM xentrac: does sigrok have like a standard easy protocol to implement to send it data?
01:04 PM cousteau`: Emil: that shouldn't be critical as I'm sending chunks of data. I don't need to get the digital values in real time, just at an acceptable frame rate
01:05 PM Emil: cousteau`: https://emil.fi/jako/koodi/spimic.c modify as needed
01:05 PM Emil: cousteau`: you can send data out at 1MBaud if you wish
01:05 PM xentrac: it would be pretty awesome to have an AVR program that would turn any random Arduino into a sigrok-compatible logic analyzer
01:05 PM Emil: xentrac: there is one
01:06 PM xentrac: Emil: oh wonderful! where?
01:07 PM Emil: http://codeandlife.com/2013/08/30/super-simple-50-khz-logic-analysis-with-attiny2313-and-ftdi-friend/
01:07 PM Emil: xentrac: do you even google ;)
01:07 PM Emil: There is also one that you can stream data directly with iirc
01:09 PM xentrac: oh awesome! thank you!
01:09 PM xentrac: haha, it doesn't even need an ATMega
01:10 PM Emil: Yeah it's mostly about what you do with it
01:10 PM xentrac: oh hmm, you can't run it online with sigrok; you have to capture the data and then convert it
01:10 PM xentrac: so this isn't really what I was hopeing for
01:10 PM xentrac: hoping for
01:10 PM Emil: if it's purely logic then you don't need the multiply instruction
01:11 PM Emil: xentrac: you could stream it, too
01:11 PM Emil: xentrac: a simple script in between and you could probably point sigrok at it or have sigrok read the serialport
01:12 PM xentrac: maybe, but I assume sigrok has some protocols already defined to talk to existing logic analyzers and do things like trigger them to capture data
01:12 PM Emil: indeed it does, and serial is one of them iirc
01:12 PM xentrac: but "serial" isn't a protocol
01:12 PM xentrac: it's a wire upon which you can run protocols
01:14 PM darsie: RS232
01:16 PM cousteau`: Emil: that looks good, but my idea was to register chunks of data and then send all of that
01:16 PM cousteau`: that's why I'm messing with interrupts and all this hell
01:16 PM Emil: xentrac: point is that you can easily extend the code
01:16 PM Emil: cousteau`: why?
01:16 PM Emil: cousteau`: no benefit in sending out in chunks
01:17 PM Emil: really
01:17 PM cousteau`: ...and in fact, I'm not 100% sure but I *think* you can use an FTDI directly as a logic analyzer. There are high chances that I'm wrong though.
01:17 PM cousteau`: Emil: higher speed
01:17 PM Emil: cousteau`: nope
01:17 PM Emil: well, in theory
01:17 PM cousteau`: so that I can see very fast signals
01:17 PM cousteau`: even if it's at a very low frame rate
01:17 PM Emil: but you are limited by flash speed
01:17 PM Emil: and size
01:17 PM cousteau`: ...y'know what I mean?
01:17 PM xentrac: so I am back at "it would be pretty awesome to have an AVR program that would turn any random Arduino into a sigrok-compatible logic analyzer"
01:17 PM xentrac: and yes, I could write one
01:17 PM Emil: you can take ~1800 samples if you don't use any etra ram
01:17 PM Emil: and if you bitpack then of course more
01:18 PM xentrac: but it would be even more awesome from my point of view if cousteau` did it without me having to do any of the work ;)
01:18 PM cousteau`: like, read 256 samples at a very high speed, spit them out at a sorta low speed
01:18 PM Emil: xentrac: you just want samples really fucking fast? I have one written
01:18 PM Emil: cousteau`: 256 samples is nothing :D
01:18 PM Emil: But since this is logic levels
01:18 PM Emil: you can just bitpack
01:19 PM Emil: for example 7 samples per byte (one bit to say that this is a sample)
01:19 PM cousteau`: ...not if I'm monitoring a whole 8-bit port... or what do you mean by "bitpack", RLE?
01:19 PM Emil: You don't even need framing that way
01:19 PM cousteau`: ah ok
01:20 PM Emil: if you take 256 samples, you can run for a whole of 16 microseconds :D
01:21 PM Emil: if you take 1600 that would be 100 microseconds
01:21 PM Emil: To push them to flash takes some 3 cycles iirc
01:21 PM xentrac: cousteau`: that makes a lot of sense to me
01:21 PM Emil: So your maximum samplerate is something like 4MHz if you are lucky
01:22 PM xentrac: you don't need to push them to flash if they fit in SRM
01:22 PM xentrac: SRAM
01:22 PM Emil: xentrac: mean ram
01:22 PM Emil: meant*
01:23 PM Emil: Anycase, to push 1600 samples out at 1MBaud takes at least 16ms
01:23 PM Emil: (probably around 20ms because overhead)
01:24 PM Emil: So you can take a 100 microsecond snapshot every ~20ms
01:24 PM Emil: (that samplerate is then 4MHz, which is "okay")
01:24 PM xentrac: yep, that's an extremely useful capability to have
01:25 PM xentrac: especially if you can trigger it in some kind of customizable awy
01:25 PM xentrac: way
01:25 PM xentrac: a higher sample rate would of course be better
05:33 PM robinak is now known as robink
05:34 PM Lambda_Aurigae: darsie, chess was available on the commodore vic-20 and that only had 5K of ram to play with....and that was for program and data space...the better one was a cartridge that still relied on the 5K of ram for data and had a 16K rom chip for program....
05:35 PM Lambda_Aurigae: darsie, so, an atmega1284p should be able to run a basic chess game without much problem I would think.
05:35 PM darsie: ok
05:35 PM darsie: But I don't think I'll make or port one.
05:35 PM darsie: Anyways, I found one
05:35 PM Lambda_Aurigae: now, it wasn't a master level chess opponent, the vic-20 game, but it was playable and enjoyable when I was 16.
05:45 PM Chillum: ahh the vic-20, from a simpler time
05:46 PM Lambda_Aurigae: mine still works
05:46 PM Lambda_Aurigae: I still play games on it!
05:46 PM Lambda_Aurigae: on my projector
05:46 PM Lambda_Aurigae: with a 15 foot diagonal projection screen.
05:46 PM Lambda_Aurigae: the pixels are the size of my thumb.
05:47 PM Lambda_Aurigae: I still have functioning c-64 machines and a c-128
05:48 PM Lambda_Aurigae: need to fix the keyboard on the c-128 though...a couple of keys got busted off.
07:12 PM NoHitWonder2: i have few c64s too
07:12 PM NoHitWonder2: nice machine
07:12 PM Lambda_Aurigae: I prefer the vic-20 overall.
07:12 PM Lambda_Aurigae: c-128 next
07:12 PM Lambda_Aurigae: then the c-64
07:15 PM Lambda_Aurigae: the vic-20 was so simple to build expansion boards for..the interface was very simple.
07:16 PM Lambda_Aurigae: the c-128 had everything the c-64 had but they fixed a lot of the little problems and quirks.
07:18 PM Lambda_Aurigae: I loved running CPM on the c-128 too.
07:19 PM Lambda_Aurigae: never did figure out how to program for the z80 on that box though.
07:19 PM Lambda_Aurigae: but I stopped programming on the c-128 back in about 1989 or so when I moved up to the Amiga.
07:54 PM arij is now known as arij_work
07:59 PM Chillum: I just remember trying to write an epic game and running out of ram
08:00 PM Lambda_Aurigae: hehe.
08:01 PM Lambda_Aurigae: I ended up writing a basic compiler.
08:01 PM Lambda_Aurigae: in basic
08:01 PM Lambda_Aurigae: then used it to compile itself.
08:01 PM Lambda_Aurigae: had to add 16K of ram to the vic-20 to make that work though.
08:02 PM Lambda_Aurigae: I cheated bigtime though...I compiled the basic commands into assembly but still used the built in kernel and basic rom routines.
09:20 PM arij_work is now known as arij
11:24 PM xentrac: nice, Lambda_Aurigae