#avr | Logs for 2014-05-05

Back
[00:01:10] <clixxIO> ok well back another time
[00:02:10] <Casper> so...too bad that there is no /1000
[00:12:26] <Casper> for 32.768k crystal... is there any real difference between all of them?
[00:12:33] <Casper> digikey have like 25 models
[01:12:46] <Brittany> Is it depressing that I've written 100 iterations of an AVR program today, and it clocks in at a mighty 42 lines now?
[01:15:03] <myself> that's pretty typical
[02:51:43] <superware> I have an ATmega328 with two external interrupts, if these interrupts are occurring too fast (motor quadrature encoder spinning too fast) - the mcu is resetting http://pastebin.com/xKw9U0cg any idea why?
[02:55:38] <superware> anyone?
[03:28:53] <superware> can a table-lookup cause the mcu to reset? it seems _count += lookup_table[enc_val & 0b1111]; does, please see http://pastebin.com/xKw9U0cg
[04:04:24] <Brittany> Trying to understand Lockbits. If I were to set LB1 and LB2 to 0, that would supposedly prevent read back or further programming.
[04:04:54] <Brittany> I'm not sure I want to do that since I would like to be able to write new programs to the flash memory in the future.
[04:05:01] <Brittany> Am I misinterpreting what 'further programming' means?
[05:11:37] <Tom_itx> Brittany, don't set the lock bits then
[05:12:37] <Tom_itx> will cause you nothing but grief
[05:23:32] <perole> weirdness, I'm routing an eagle PCB with a pour for gnd, but it only connect half the pins on a tqfp?!?
[05:25:08] <perole> http://kirurg.org/drop/eagle-gnd.png
[06:05:40] <anton02> do you need a h-bridge for a servo to turn in different directions?
[06:07:45] <Kev> anton02 a servo doesn't work that way
[06:08:03] <anton02> Kev: how does it work then
[06:08:38] <Kev> you send a pwm signal and there a link between the pwm value and the angle
[06:08:59] <anton02> oh so there must be a built in h-bridge on the servo i see
[06:09:23] <Kev> http://en.wikipedia.org/wiki/Servo_control
[06:09:24] <anton02> Kev: mustn't there?
[06:09:39] <anton02> i wonder if you could hax it and take it out for other uses
[06:10:21] <anton02> Because the reality is that the servo will need to reverse the polarity of the voltage for the windings to rotate in the opposite direction
[06:10:44] <Kev> yeah
[06:11:06] <Kev> but it's integrated you don't need to worry about that
[06:11:28] <anton02> yeah
[06:17:50] <Lambda_Aurigae> anton02, all depends on the servo...but if you are using standard hobby servos, they have built in motor control hardware...you just need to send the appropriate pulses.
[06:18:48] <Lambda_Aurigae> if you are wanting to use the built in electronics to drive other motors you might do some searching on modifying servos for continuous rotation..
[06:34:14] <Lambda_Aurigae> http://chuckleaduck.com/comic/modern-conveniences/
[06:51:44] <anton02> where can you get a steering rack from? Everything seems to be replacements for other RC cars and not your own use.
[06:52:17] <Lambda_Aurigae> try vexlabs
[06:52:17] <anton02> a steering kit for 2 front wheels controlled by a servo'
[06:52:38] <Lambda_Aurigae> vex robotics rocks.
[06:52:41] <Lambda_Aurigae> bit pricy
[06:52:43] <Lambda_Aurigae> but good stuff.
[06:53:39] <Lambda_Aurigae> http://www.vexrobotics.com/vex/products/accessories/motion/275-1188.html
[06:55:17] <anton02> http://kiwibots.co.nz/vex-store/motion/swerve-drive-kit-detail
[06:55:46] <Lambda_Aurigae> that looks like vex gear.
[06:56:19] <anton02> i specifically searched for it when you told me
[06:57:07] <Lambda_Aurigae> that's just the wheels for the swerve drive.
[06:57:21] <Lambda_Aurigae> the link I posted is just the bracket...at the bottom are the other bits you need.
[06:57:40] <Lambda_Aurigae> they have special servos for vex that fit the holes properly.
[06:57:59] <anton02> that linear one doesnt use a servo does it
[06:58:14] <Lambda_Aurigae> servo or continuous servo/motor
[07:00:45] <Lambda_Aurigae> could do it with lego also.
[07:02:03] <anton02> swerve kit seems a bit less complicated than the linear one. Also takes less space
[07:02:23] <Lambda_Aurigae> still need some way to move them.
[07:03:31] <Lambda_Aurigae> http://content.vexrobotics.com/docs/inventors-guide/276-0506-INST-0410.pdf
[07:03:37] <Lambda_Aurigae> that's how they are meant to be used.
[07:04:54] <anton02> yeah i saw that. The swerve kit seems so simple you could just make one yourself. At least its given me the idea of what to do.
[07:05:21] <anton02> Just put a gear flat on top of a wheel and interface it with a servo
[07:05:24] <Tom_itx> perole, you could draw a short GND trace for them and see if they connect then
[07:10:28] <anton02> can i make a universal tv control using avr
[07:10:38] <anton02> and an IR emitte
[07:10:51] <Tom_itx> i dunno, can you?
[07:11:07] <anton02> yes
[07:14:42] <Tom_itx> can't see it being practical but probably so
[07:21:36] <perole> Tom_itx: I did, and that worked - it is some spacing/width issue with the polys
[07:21:57] <perole> when routing a short trace, it looks way cleaner than the 'auto fill'
[07:34:29] <kennyd> Would it be possible to use a software USB implementation (like VUSB) to interact with a USB 3g modem?
[07:45:48] <Kev> kennyd no vusb makes a device, not a usb host
[07:46:24] <kennyd> Kev: Whoops, probably should have done more research before throwing out ideas lol. Thank you however for the correction.
[07:46:31] <kennyd> I am going to go usb host route anyways
[07:48:36] <anton02> why do people bother with gear motors when you could easily just do this. in this pic the stars represent a gear. http://i.imgur.com/SYKEpJs.jpg
[07:58:29] <anton02> did a bit of math and it seems that could only give you about 20:1 ratio
[09:19:24] <superware> is the only difference between x1/x2/x4 quadrature decoding is resolution, or also counting accuracy?
[09:27:32] <darsie> hi
[09:27:42] <darsie> can avrs be damaged by overclocking?
[09:31:43] <superware> good question
[10:47:42] <hetii> Hi
[10:47:44] <hetii> :)
[10:47:50] <bss36504> Howdy
[10:47:58] <hetii> What means double !! in //digitalWrite(dataPin, !!(val & (1 << (7 - i)))); ?
[10:48:22] <bss36504> Uh, that’s a bit weird…
[10:48:46] <The_Coolest> it means not not
[10:48:51] <bss36504> I guess it would just be double negation if it is legal syntax. The compiler might complain
[10:49:55] <hetii> ye, but what is the purpose of using !! instead just (val & (1 << (7 - i)) ?
[10:50:07] <bss36504> literally no difference.
[10:50:31] <The_Coolest> coz dumb? or wanted to confuse a noob?
[10:50:32] <The_Coolest> :P
[10:51:04] <hetii> here i found it: http://forum.arduino.cc/index.php?topic=45529.0
[10:53:44] <grahamc> it does make a difference - it forces it to be a boolean
[10:54:11] <grahamc> well, that is what that is for in loosely typed languages
[10:56:04] <The_Coolest> yeah, possibly to convert whatever value into 0 or 1
[10:58:20] <hetii> ok thanx for explanation ;)
[11:06:38] <Daulity> hi
[11:06:51] <Daulity> anyone got any experience with nrf24l01 ?
[11:09:16] <Kev> hey
[11:09:27] <Kev> i'm working with a couple right now
[11:11:51] <Kev> Daulity do you have a question ?
[11:17:23] <Daulity> I would like to listen to my rc transmitter it's also on 2.4ghz and record what it's talking, would this be possible ?
[11:18:46] <Kev> nah i'm afraid not
[11:19:52] <Daulity> why not
[11:20:49] <Daulity> anyway i just found this. looks like a controle similair to what i have
[11:20:55] <Daulity> https://www.youtube.com/watch?v=dus7GxoRIEk
[11:25:54] <Kev> his rc transmitter most likely uses an nrf24
[13:15:03] <Hello__> hello guys, can anyone help me with issues on my SPI connection?
[13:15:20] <bss36504> What’s it doing/not doing?
[13:15:35] <bss36504> Protip: Just ask, people will answer if they can
[13:16:07] <Hello__> the thing is, i connected my Raspberry Pi to the AVR device with SPI interface , i want it to transmit string for example,by sending chars one by one
[13:16:16] <Hello__> and the issue is
[13:16:31] <bss36504> Rpi is 16 bit SPI if I recall
[13:16:54] <Hello__> i think so as well
[13:17:00] <bss36504> ok
[13:17:01] <Hello__> that sometimes there are distortions depending on length
[13:17:08] <Hello__> or any different factors
[13:17:18] <myself> tell me about your power filtering capacitors :)
[13:17:24] <myself> how many, what types, what values, and where?
[13:17:26] <Hello__> like programm uploaded on Avr device
[13:17:50] <bss36504> distortions to what? the individual bytes or a whole string? Also, I agree with myself. There is likely a hardware issue here.
[13:18:01] <bss36504> especially if you have been able to recieve *something*
[13:18:11] <Hello__> for example i send 51234s i recieve at different times
[13:18:15] <Hello__> 51233s
[13:18:20] <Hello__> 51234s
[13:18:25] <Hello__> s5234s
[13:18:44] <Hello__> if the length of the string is bigger,then distortion will increase
[13:18:59] <Hello__> if i adjust values of bytes sent per each time distortion changes
[13:19:00] <myself> did you read what I wrote?
[13:19:11] <Hello__> oooh,sorry
[13:19:32] <bss36504> There should be very little distortion with SPI. It’s not asynchronous, there is no synthesized clock on the slave end, so it’s likely a software (on the slave) issue, or a hardware issue with the slave.
[13:19:34] <Hello__> one sec about that
[13:19:40] <myself> First motto of software: It's a hardware problem until proven otherwise.
[13:19:49] <myself> First motto of hardware: It's a power problem until proven otherwise.
[13:21:39] <myself> First motto of power: Throwing more capacitors at the problem is easier than real engineering and often works just as well.
[13:21:54] <bss36504> haha
[13:21:55] <bss36504> nice
[13:22:01] <bss36504> you sound like my boss
[13:22:36] <myself> And this is why noobs need oscilloscopes.
[13:22:51] <bss36504> “bss36504, how much decoupling is on there?” “literally 400uF divided amongst a bunch of caps, it’s all good”
[13:23:22] <bss36504> But oscilloscopes are expensive for people starting out. It’s hard to justify even a few hundred for something that you might not be that into in another couple months.
[13:23:35] <myself> And this is why noobs need hackerspaces.
[13:23:43] <bss36504> I suppose so
[13:24:50] <myself> Besides, nobody ever said electronics was a cheap hobby. (Or anyone who did, was selling a starter kit with carefully chosen recipes, guaranteed to bite the buyer in the butt when they try to experiment without a 'scope.)
[13:26:49] <Hello__> i can't find the values of capacitors :( It's university provided model and they didnt direct it anywhere
[13:27:00] <Hello__> but i checked now with 4-5 other same d evices
[13:27:08] <Hello__> same problem
[13:27:37] <Hello__> and i have also mentioned that changing code downloaded on AVR device
[13:27:53] <Hello__> also affects distortion, maybe SPIF flag can't be turned low so fast
[13:28:13] <bss36504> changing the SPIF would not be the issue
[13:28:24] <bss36504> check your connections
[13:28:32] <bss36504> how is the RPI connected to the AVR?
[13:28:59] <Hello__> pi CLK to the avr CLK, Mosi - Mosi, Miso - Miso, grounds are connected as well
[13:30:16] <bss36504> Right, I meant the physical integrity of the connections
[13:30:49] <myself> solder? breadboard push pins? connectorized wire?
[13:33:22] <tzanger> Hello__: you've been at this for a few days now and you haven't been able to give us the data we need to help you
[13:33:35] <Hello__> http://cs619318.vk.me/v619318461/523c/ygxSxEqwdvk.jpg
[13:34:08] <Hello__> i think the picture can show in better way t han my poor description
[13:34:27] <Hello__> so basically there are just wires going out of raspberry pi into the some kind of holes where pins are located
[13:34:40] <Hello__> they are not soldered, i can pull them out and in any time
[13:35:00] <Hello__> red - purple same wire
[13:35:04] <tzanger> those are standard 0.100" headers and female sockets
[13:35:06] <Hello__> just extension of different colour
[13:35:21] <Hello__> ok i ll keep that in mind
[13:36:11] <Hello__> all transfered information appears on lcd ,and i mentioned if i change the length of a string appearing on lcd
[13:36:17] <Hello__> the shown information changes as well
[13:36:46] <Hello__> for example if its just sprintf("the next letter is %c," char(SPDR));
[13:37:04] <Hello__> the information recieved by spi will be shorter
[13:37:27] <Hello__> but if i do just sprintf("%c", char(SPDR)); than the same size as spi recieved information
[13:44:12] <bss36504> That sprintf call is incorrect, unless you cut it down to show us. How big is the buffer you are sprintf-ing into?
[13:44:47] <Hello__> while(!(SPSR & _BV(SPIF)));
[13:44:54] <Hello__> Read = SPDR;
[13:45:01] <Hello__> sprintf(Reading, "%c", (char)Read);
[13:45:10] <Hello__> if (SPSR & _BV(SPIF))
[13:45:21] <Hello__> { display_string(Reading);}
[13:45:25] <Hello__> that's all in main
[13:45:38] <bss36504> what is the declaration for Reading?
[13:45:50] <Hello__> display_string comes from lcd library
[13:45:53] <Hello__> char Reading[50]; uint8_t Read;
[13:46:03] <bss36504> Oh well that seems adequate
[13:46:05] <bss36504> hmm
[13:46:07] <bss36504> strange
[13:46:13] <Hello__> and i have tried to do same in interrupt handling
[13:46:20] <bss36504> do you access to an o-scope?
[13:46:28] <Hello__> i wish i had, i ll be able only tomorrow
[13:46:51] <Hello__> maybe u have an idea then why interrupt handling doesnt work for me
[13:46:53] <Hello__> basically code is
[13:47:03] <Hello__> sei(); // enable global interrupts SPCR = _BV(SPIE); // local interrupt for SPI
[13:47:05] <Hello__> in main
[13:47:15] <Hello__> ISR (SPI_STC_vect) { Read = SPDR; sprintf(Reading, "%c", (char)Read); if (SPSR & _BV(SPIF)) { display_string(Reading); } }
[13:47:24] <Hello__> oh sorry,it's nasty way to show u
[13:47:37] <Hello__> ISR (SPI_STC_vect)
[13:47:38] <Hello__> {
[13:47:46] <Hello__> Read = SPDR;
[13:47:52] <Hello__> sprintf(Reading, "%c", (char)Read);
[13:48:00] <Hello__> if (SPSR & _BV(SPIF))
[13:48:01] <Hello__> {
[13:48:05] <Hello__> display_string(Reading);
[13:48:06] <Hello__> }
[13:48:07] <Hello__> }
[13:48:23] <Hello__> don't know why ,but this is just simply doesnt work
[13:48:25] <Hello__> at all
[13:51:37] <tzanger> Hello__: well first char() isn't a function. so sprintf("%c", (char)SPDR is what you want
[13:51:44] <tzanger> but sprintf() is a HUGE waste for printing a character
[13:52:43] <tzanger> while (!(SPSR & _BV(SPIF))) { buf[i++] = SPDR; buf[i] = 0x00; };
[13:53:06] <tzanger> put a bounds check in there too so you don't scribble memory if you go off in the weeds, then puts(buf); to print it
[13:53:47] <tzanger> you can't (or rather shouldn't) call huge functions like sprintf or printf or display_string() in an ISR
[13:54:01] <tzanger> an ISR is meant for "get in, do what you need and get out as fast as possible"
[13:54:18] <tzanger> i.e. that while() line I printed would be acceptable in an ISR
[13:54:37] <tzanger> and if you read all the caharacters set a volatile flag so that main() knows it's got something to print and print there
[13:54:57] <bss36504> Actually, tzanger raises a good point. Whether you’re in an ISR or an infinite loop, if you are too slow with recieving data, you would miss and/distort your results.
[13:55:29] <Hello__> okay let me check that,i guess that's a good assumption
[13:55:37] <tzanger> this is why I asked you to set a breakpoint and see if you're receiving what you expect. but you seemed to indicate yesterday that you were receiving 99% of what you wanted
[13:55:54] <Hello__> oh,mate that wasn't me yesterday
[13:55:58] <tzanger> so I figured you were doing something too slow. If you're sprintf()ing to add characters to a char array you're definitiely off on the wrong foot
[13:56:03] <tzanger> Hello__: you're not brittany?
[13:56:09] <Hello__> no,it's my group mate
[13:56:13] <tzanger> ah
[13:56:19] <Hello__> she said that sharing grounds
[13:56:21] <Hello__> worked for her
[13:56:26] <Hello__> but doesn't work for me
[13:56:40] <tzanger> yep we are a helpful bunch here provided you don't piss us off. :-)
[13:57:03] <Hello__> :)
[13:57:09] <tzanger> well it's not a matter of sharing the ground, it's a matter of your circuitry needs to have a common reference level, or be designed to work without one
[13:57:52] <Hello__> don't you remember te way she checked incoming information?
[13:58:00] <Hello__> like lcd or led ,what did she use
[13:58:12] <Hello__> she not online :(
[13:58:19] <tzanger> tbh I don't pay that much attention, I bounce in, help if I can, bounce out
[13:58:24] <tzanger> got my own problems to solve too :-)
[13:59:24] <Hello__> coming back to put a boudn check
[13:59:31] <Hello__> i didn't quite get what did you mean exactly
[14:05:54] <tzanger> well you have a specific amount of memory reserved for the receive buffer right?
[14:06:02] <tzanger> char buf[50] for example
[14:06:09] <Hello__> in avr - yes
[14:06:21] <tzanger> if you aren't careful the Rpi might want to send 342573523432623426324 bytes
[14:06:24] <tzanger> what happens then?
[14:06:36] <Hello__> doesnt fit in
[14:06:43] <tzanger> well no, it fits just fine
[14:06:53] <tzanger> you just end up writing beyond the area you expected to write
[14:07:02] <tzanger> and the compiler's used that memory for something else
[14:07:06] <tzanger> all hell breaks loose
[14:07:13] <tzanger> so you do something like this
[14:08:29] <tzanger> while (!(SPSR & _BV(SPIF)) && i < sizeof(buf) - 1) { buf[i++] = SPDR; }; buf[i] = 0x00; if (i == sizeof(buf)) { // flag overflow condition }
[14:08:52] <tzanger> the while loop will break for two reasons now: no more data or no more room for data
[14:09:09] <tzanger> btw you usually have a timeout in there as well because you don't want to wait forever for data but that's a lesson for another day
[14:10:43] <Hello__> i must be initially 0 ?
[14:11:31] <Hello__> ye it should be
[14:12:32] <Hello__> why do we overwrite buf[i] = 0x00;
[14:20:10] <tzanger> Hello__: C strings must be zero-terminated
[14:20:35] <tzanger> otherwise when you printf() or puts() you will run off the end of your received data and into either old data, garbage or god knows what
[14:20:40] <tzanger> and I'm not overwriting the last character
[14:20:53] <tzanger> I'm forcing the char after the last rx'd one
[14:21:15] <tzanger> buf[i++] = SPDR means i gets incremented after it's read for the index into buf
[14:21:28] <tzanger> so if i=3 when that line executes, buf[3] = SPDR, i is now 4
[14:56:23] <Mous> hello, when i use timer/counter what does the Clock Bits do (the scaling ones)?
[14:57:47] <Mous> here its how the table looks like but i am having hard time guessing what it does http://puu.sh/8Azs2.png
[14:58:40] <Mous> i have this idea that it only divides the speed of the timer but i am sure
[15:05:19] <Kev> it's the speed of the counter
[15:06:32] <Kev> if your avr is clocked at 1mhz
[15:07:33] <Kev> (1mhz is once per 1µs)
[15:07:45] <Kev> and the prescaler is /128
[15:08:08] <Kev> it'll add one to the counter every 128µs
[15:09:46] <Hello__> yaaaaaau,i found a problem
[15:09:51] <Hello__> u did a right assumption
[15:09:57] <Hello__> saying that sprintf and displaystring
[15:10:00] <Hello__> is delaying too hard
[15:10:12] <Hello__> i just made it output the recieved information not during recieving
[15:10:16] <Hello__> but after
[15:26:32] <Hello__> thanks a lot to everyone who called out to help
[15:31:10] <Mous> the m in the 1mhz is meant to be mili or Mega?
[15:31:31] <megal0maniac_afk> Mega
[15:31:43] <Mous> ok
[15:31:44] <megal0maniac_afk> It should be M
[15:34:49] <Mous> Kev, ok so when i have 32KHz clock (not sure if its 32000Hz or 32768Hz because two sources says diff things) then with /128 it would be 4.096µs (calculated with the 32kHz)?
[15:40:00] <LoRez> use a 32768Hz crystal
[15:41:17] <Mous> seams od to me when i think about it :D logic gets me there slower clock -> bigger time so why did i made the time scale as the clock *facepalm*
[15:46:00] <Mous> hmm so i calculated the new values and i dont like them :D
[15:46:39] <Mous> i want to make stopwatch that is precise but this is not helping
[15:47:46] <Jordan_U> Mous: How precise?
[15:48:08] <Kev> Mous like he said, if you need an accurate clock you should use the xtal that is the most suited and the more accurate possible
[15:48:20] <Mous> 00:00:00 minutes:seconds:miliseconds
[15:48:34] <bss36504> Realistically, if you have a Mhz+ clock frequency, you have a ton more resolution than anything a person will notice.
[15:51:10] <Kev> Mous a 32768hz clock with a 128 prescaler will overflow an 8bit counter once a sec
[15:51:38] <Mous> really hmm where did i miscalculated
[15:52:45] <Mous> yeah it would
[15:54:07] <Mous> /64 would be every 0,5s then hmm
[15:55:12] <Kev> it's harder to get a ms precision though
[15:55:18] <Mous> yes
[15:56:22] <Mous> my first idea was to use daley loop :D and it worked great it was only like 0.5s off :)
[15:56:50] <Jordan_U> Mous: Did your delay loop use _delay_ms or _delay_us ?
[15:57:19] <Mous> my delay loop was just two "for"
[15:59:19] <Kev> Mous it's not accurate enough for a clock or a stopwatch
[16:00:41] <Mous> yeah thats why i am fighting with it
[16:04:17] <Mous> i would need pretty fast clock
[16:04:47] <Mous> so how does this xtal works
[16:09:05] <Kev> you can try with a 11.0592MHZ xtal with a bit of magic you can have an accurate ms measurement
[16:09:20] <Mous> :D
[16:18:02] <Mous> Kev, do you know about some good source on how to use the xtal i dont know how :(
[17:47:07] <Lambda_Aurigae> darsie, to answer your overclocking question...they can as they may overheat when running too fast at full voltage.
[17:49:44] <Mous> http://store.steampowered.com/app/283920/ wow i actually played this game and now it on steam for 7€ screw it :D
[18:20:47] <Lambda_Aurigae> http://www.vagrearg.org/content/switchtoggle
[18:43:49] <darsie> Lambda_Aurigae: thx
[18:44:03] <Lambda_Aurigae> thx?
[18:44:10] <Lambda_Aurigae> shouldn't it be thx-1138?
[18:44:11] <darsie> <Lambda_Aurigae> darsie, to answer your overclocking question...they can as they may overheat when running too fast at full voltage.
[18:44:16] <darsie> :)
[18:47:30] <Lambda_Aurigae> I have found that some features of the AVR will start to malfunction with overclocking...specifically anything to do with analog.
[18:48:13] <Lambda_Aurigae> a little overclocking is ok..too much and things start to fail as you go up...though not drastically failing, just lockups or not giving good results...
[18:48:34] <Lambda_Aurigae> then eventually you reach a point where it just can't work right and you get reboots and lockups and it just won't run.
[18:49:01] <darsie> ok
[18:49:02] <Lambda_Aurigae> but if you run it too long too fast you can physically damage it if it overheats,,,although I doubt you will have a stable chip at all at those kinds of speeds to start with.
[18:49:26] <Lambda_Aurigae> I've seen atmega32 overclocked to 20MHz(speced at 16MHz max)
[18:49:54] <Lambda_Aurigae> and I've overclocked the atmega1284p to 24MHz(speced at 20MHz max) without issues though I didn't test everything.
[18:50:43] <darsie> Did you use crystals or an external clock?
[18:50:49] <Lambda_Aurigae> crystals.
[18:54:04] <Lambda_Aurigae> speaking of which, I need to get a few more 20MHz oscillators.
[19:22:40] <N2TOH> Linear tech has some nice i2c and SPI programable oscillators
[19:28:05] <Lambda_Aurigae> oh?
[19:28:09] <Lambda_Aurigae> free samples?!?!?!
[19:28:31] <N2TOH> yeah I think they will do 2 or 3 of each kind
[19:28:44] <N2TOH> you want the part number?
[19:29:09] <Lambda_Aurigae> on their site now.
[19:29:23] <N2TOH> http://www.linear.com/parametric/Silicon_Oscillators
[19:29:52] <N2TOH> LTC6903/4 for the serial config parts
[19:29:58] <Lambda_Aurigae> biggest problem with all those.....surface mount.
[19:29:59] <N2TOH> 1KHz to 68MHz
[19:30:12] <N2TOH> I have some on sparkfun adapters
[19:30:35] <N2TOH> SMT to dip adapter
[19:30:40] <Lambda_Aurigae> I could make adapters
[19:30:52] <N2TOH> you near Philly?
[19:31:26] <Lambda_Aurigae> nope.
[19:31:34] <Lambda_Aurigae> unless, by near, you mean in the same country.
[19:31:43] <N2TOH> HA
[19:32:04] <Lambda_Aurigae> I have the stuff to make boards here. I have in the past when I needed something that was available SMT only.
[19:32:09] <N2TOH> so yeah to solder the parts onto an adapter board is not too tough
[19:32:32] <Lambda_Aurigae> that's the harder part for me, due to shaky hands from nerve damage.
[19:32:48] <N2TOH> I forget how much spark fun wanted but it was so heap I was like the hell with it and bought $20 worth
[19:33:09] <Lambda_Aurigae> way back when I got a bunch of them from schmartboards.
[19:33:29] <Lambda_Aurigae> including some that do tqfp 100 and tqfp 144 chips.
[19:34:00] <N2TOH> https://www.sparkfun.com/products/717
[19:34:12] <N2TOH> SOT23 to DIP under a buck each
[19:34:13] <Lambda_Aurigae> they had a big sale early on and these are easier to use than the sparkfun ones.
[19:36:08] <N2TOH> anyways with the serial config oscillator you can change the clock speed on the fly
[19:36:16] <Lambda_Aurigae> schmartboard boards are much more expensive though.
[19:36:29] <N2TOH> $0.95USD
[19:36:48] <Lambda_Aurigae> I've done on the fly clock changing with physical prescaler.
[19:37:12] <N2TOH> this is a single part solution
[19:37:16] <Lambda_Aurigae> yup.
[19:37:39] <Lambda_Aurigae> I did it with an 8MHz oscillator and an 8bit counter once.
[19:37:43] <N2TOH> wish I could get an ATMEGA 1284p in a ceramic package
[19:37:50] <Lambda_Aurigae> for heat?
[19:38:01] <N2TOH> yeah, can you say overclock?
[19:38:19] <Lambda_Aurigae> already done it.
[19:38:21] <Lambda_Aurigae> 24MHz.
[19:38:29] <Lambda_Aurigae> but I didn't test the ADC at that speed.
[19:38:46] <Lambda_Aurigae> with the old venerable atmega32 overclocked to 20MHz the ADC was flaky as hell.
[19:39:03] <N2TOH> thus the joy of being able to slowdown when needed
[19:40:07] <Lambda_Aurigae> have also done multiple speeds with a 1 of 4 selector and 4 oscillators.
[19:40:26] <Lambda_Aurigae> but, yeah, single part would be awesome.
[19:40:47] <N2TOH> only sucky part is that is spools up at near 1KHz
[19:41:09] <Lambda_Aurigae> so, starts slow and you have to clock it up, eh?
[19:41:11] <N2TOH> so your AVR would have to set it each time it's powered up
[19:41:26] <N2TOH> yes, starts slow then has to clock up
[19:42:27] <N2TOH> I will tinker with more later as I'm currently investigating how to write an interperter for the 1284
[19:42:49] <Lambda_Aurigae> interpreting what?
[19:43:03] <Lambda_Aurigae> I'm slowly porting a C interpreter to the 1284
[19:43:38] <N2TOH> machine language to create a virtual machine with more resources
[19:43:59] <Lambda_Aurigae> your own processor/language or an existing?
[19:44:06] <N2TOH> existing
[19:44:12] <Lambda_Aurigae> what processor?
[19:44:18] <N2TOH> the 1284p
[19:44:38] <Lambda_Aurigae> I mean, what processor are you emulating?
[19:44:49] <Lambda_Aurigae> or you emulating AVR?
[19:45:09] <N2TOH> yes the AVR 1284p, did I mention I have the source code for AT&T system 7?
[19:45:28] <N2TOH> written in K&R C
[19:45:35] <Lambda_Aurigae> think you posted the link to those some time back.
[19:46:10] <N2TOH> I already managed to get AVR GNU to munch on it with a few switches set and not barf or chuck errors
[19:47:26] <N2TOH> would be amusing to package it into a double DB9 adapter shell
[19:47:29] <N2TOH> with USB
[19:48:19] <Lambda_Aurigae> could fit an arm processor in such a shell.
[19:48:43] <N2TOH> yes, but it's more amusing to use an 8 bit chip
[19:48:49] <Lambda_Aurigae> agreed.
[19:49:08] <N2TOH> anything smaller then credit card would suffice
[19:49:34] <Lambda_Aurigae> I like the 8052 chips for such projects though due to being able to put additional memory on the chip.
[19:50:19] <N2TOH> I know, thus my interest in the AVR emulator/virtual interperter mode of operation.
[19:50:33] <Lambda_Aurigae> look at picoc
[19:50:35] <N2TOH> I found one guy at in Cali who was not willing to share his source
[19:50:52] <Lambda_Aurigae> it's a C interpreter.
[19:51:06] <N2TOH> he also has unreleased code
[19:51:47] <Lambda_Aurigae> oh...have you looked at simulavr?
[19:51:56] <N2TOH> it has the ability to seamlessy run code from internal flash and interp code from an external device without the need to make code alterations
[19:52:35] <N2TOH> I don't think so, is it written in C, and could it be compiled with AVR-GNU C?
[19:53:11] <Lambda_Aurigae> simulavr is written in C and compiles with GCC...so it might compile with avr-gcc without too much problem.
[19:53:34] <N2TOH> :)
[19:54:14] <Lambda_Aurigae> they rewrote it in C++
[19:54:22] <Lambda_Aurigae> but the old one is still available.
[19:54:34] * N2TOH points my brower to Google
[19:54:39] <Lambda_Aurigae> now, it doesn't support the atmega1284p directly but shouldn't be difficult to do.
[19:54:47] <Lambda_Aurigae> http://www.nongnu.org/simulavr/
[19:56:33] <Lambda_Aurigae> hmm.
[19:56:40] <Lambda_Aurigae> looks like the new version supports atmega1284a
[19:57:07] <Lambda_Aurigae> not sure on code sizes though..
[19:57:15] <Lambda_Aurigae> it would likely need some major rework to fit on an atmega1284p
[19:57:23] <N2TOH> the plot thickens
[19:57:42] <Lambda_Aurigae> as does the gravy
[19:59:00] <N2TOH> as I understand it the AVR is a modified Harvard arch, that has the ability to put stuff into the data space from the program space.
[19:59:13] <Lambda_Aurigae> yes.
[19:59:29] <N2TOH> I'm looking for a software solution that will violate that restriction, so I can run UNIX from an SD card.
[19:59:45] <Lambda_Aurigae> and, the ability, albeit limited, to put stuff into program space from data space.
[19:59:54] <Lambda_Aurigae> picoc
[20:00:30] <Lambda_Aurigae> https://code.google.com/p/picoc/
[20:00:59] <N2TOH> I found it, now my question is can the same thing be done at the machine code level?
[20:01:09] <Lambda_Aurigae> could.
[20:01:42] <Lambda_Aurigae> if that guy could do it with arm processor simulator on an avr, why not avr on avr, eh?
[20:02:13] <N2TOH> so that there need be little if any difference between the code on external media and that flashed in to th chips itself. where your could flash it into memory if a speed boost is needed
[20:02:42] <N2TOH> that is my inspiration for the project.
[20:02:48] <Lambda_Aurigae> that's why I use 8052 for this kind of project.
[20:02:57] <N2TOH> the not so awful UNIX computer on a chip
[20:03:11] <Lambda_Aurigae> most 8052 chips can map both program and data space to external memory...even both to the same memory space.
[20:03:35] <Lambda_Aurigae> I would think it would be more called the "almost kindasorta functional unix computer on a chip.
[20:03:37] <Lambda_Aurigae> "
[20:04:24] <N2TOH> if you ask a random uC nerd about 8051/8052 and AVR what are they more likely to be aware of?
[20:04:58] <Lambda_Aurigae> nerd or hack-kiddy?
[20:05:33] <N2TOH> also why does it seem the pdip 40 ATMEGA1284p is the red headed step child of the AVR lineup?
[20:05:39] <N2TOH> lol hack-kiddy
[20:05:40] <Lambda_Aurigae> 8051/8052 for the real nerds....AVR for the hack-kiddy who started with his ardweeny.
[20:06:02] <Lambda_Aurigae> what's wrong with the atmega1284p? other than it being rather pricy?
[20:06:18] <N2TOH> yes other then that
[20:06:37] <Lambda_Aurigae> I think the high price is due to the large amount of SRAM onboard though.
[20:06:58] <Lambda_Aurigae> I just wish they would put out an AVR with a combination of flash and sram for program space.
[20:07:00] <N2TOH> that or low inital production numbers
[20:07:02] <Lambda_Aurigae> that would ROCK.
[20:07:41] <LoRez> would also violate the architecture
[20:07:47] <Lambda_Aurigae> not really.
[20:07:49] <N2TOH> the ATMEGA 1meg SRAM
[20:08:00] <LoRez> much really
[20:08:16] <N2TOH> it's already a modified arch, you could use fuse bits to set the restrictions
[20:08:24] <N2TOH> IE a fuse bit to do what I want
[20:08:25] <Lambda_Aurigae> why would having sram in place of flash violate the architecture?
[20:08:42] <LoRez> because you could change the code you ran, it would no longer be harvard
[20:08:53] <N2TOH> fine by me
[20:08:56] <Lambda_Aurigae> you can do it with self-programming chips anyhow.
[20:09:08] <Lambda_Aurigae> just have to do it in blocks rather than byte by byte.
[20:09:15] <Lambda_Aurigae> and have a limited amount of rewrites.
[20:09:28] <Lambda_Aurigae> harvard just means data and program space are separate.
[20:10:05] <N2TOH> my memory is failing at this hour. on what side is the sram again?
[20:10:20] <Lambda_Aurigae> N2TOH, on the avr, sram is on the data side.
[20:10:25] <N2TOH> crap
[20:10:36] <Lambda_Aurigae> what I want is one with sram on the program side too.
[20:11:09] <N2TOH> would be nice to be able to draw the line between the two sides in the sram
[20:11:49] <Lambda_Aurigae> the 8052 is modified harvard as well...separate data and program space...but they also have an external memory bus that can map external parallel memory to data and/or program space.
[20:12:17] <N2TOH> how does the AVR currently violate that rule by allowing programs to place data into the data space?
[20:12:31] <Lambda_Aurigae> it doesn't.
[20:13:06] <N2TOH> ok then how does it initalize the data space
[20:13:46] <Lambda_Aurigae> I think from power on the sram is set to 0x00..not sure if there is an initialization or just that's how it powers up.
[20:14:11] <Lambda_Aurigae> on a reset the data sram is left alone though..
[20:14:15] <N2TOH> I say this as it's a "modified" harvard arch
[20:14:44] <N2TOH> it's in Atmel docs that you can store inital varable to seed the data memory
[20:15:28] <Lambda_Aurigae> I don't think that's the AVR doc particularly but the compiler docs.
[20:15:38] <Lambda_Aurigae> int a=5;
[20:15:50] <Lambda_Aurigae> will initialize the variable a to start at value 5.
[20:15:58] <Lambda_Aurigae> but that's done in your user software.
[20:16:24] <N2TOH> the more that I think about it, with it's 32 registers I would have to write a tight program that implements the processor in data space and then interperts the "program" and then places the result back in the data space.
[20:16:41] <Lambda_Aurigae> yup.
[20:16:44] <N2TOH> not unlike how the PDP-11 worked with it's micro code configuration
[20:18:03] <N2TOH> rather then emulating another instruction set it would really be mimicking it not unlike a fun house mirror
[20:18:56] <N2TOH> literally a program that mimics the processor in the data space.
[20:19:18] <N2TOH> if I write that is ASM, it would be laughable small
[20:19:58] <Lambda_Aurigae> it won't be clock compatible...
[20:20:23] <N2TOH> I could cripple the native code
[20:20:24] <Lambda_Aurigae> you will have to settle on something like 20 clock cycles per instruction or such then buffer things out.
[20:20:42] <N2TOH> I know their will be a trade off
[20:21:06] <N2TOH> I can burn the extra cycles with things like BIOS disk access
[20:21:13] <Lambda_Aurigae> write all the command routines...then see how close they come to a single number of cycles per real avr cycles.
[20:21:19] <N2TOH> and have the SD card routenes canned up in the flash
[20:21:40] <Lambda_Aurigae> unless you don't care about clock for clock accuracy.
[20:21:59] <N2TOH> not so much so long as it can be accounted for
[20:22:32] <Lambda_Aurigae> some code is clock cycle reliant....specially some of the stuff to do with video generation but you won't be doing that interpreted.
[20:22:58] <N2TOH> I am looking to use the SD card to hold additional utilities that will now fit in the 128K of flash
[20:23:23] <N2TOH> who said anything about video generation on this chip?
[20:23:49] <N2TOH> if I want video I'll use another chip
[20:23:50] <Lambda_Aurigae> it was just an example of needing accurate knowledge of how long each instruction takes.
[20:38:05] <clixxIO> morning
[20:38:16] <Lambda_Aurigae> morning clixxIO
[20:38:24] <N2TOH> quiting from memory the revision of UNIX I'm looking at had around 57K for the kernal and then the core memory and tape drive
[20:39:03] <N2TOH> so yeah picoc would be useful in that situation
[20:39:46] <clixxIO> Lambda_Aurigae: I was so happy this morning, I found the missing AVR-GCC that was stopping the library working
[20:40:13] <clixxIO> -fpic = position-independant-code
[20:40:40] <N2TOH> please elaborate
[20:40:43] <clixxIO> MS-DOS was so easy
[20:40:57] <N2TOH> do you have source code?
[20:41:08] <clixxIO> If you are making a library with GCC, you need to specify -fpic
[20:42:29] <clixxIO> for libarary making, otherwise it resolves call addresses [I'm assuming]
[20:42:50] <Lambda_Aurigae> that forces it to use only relative jumps and no absolute jumps.
[20:43:15] <clixxIO> oh ok
[20:44:53] <clixxIO> So now I have a 'Serial' object and it's talking
[20:46:34] <clixxIO> so I now have this [ok-it needs a cleanup] https://github.com/clixx-io/clixx.io/blob/master/examples_attiny/tempreporter/tempreporter.cpp
[20:47:36] <clixxIO> I have to merge it all into callbacks - because my library wasn't working I had to put everything in main()
[21:02:36] <clixxIO> hmm.. I think I will clean that code up. It looked ok within geany during the small hours of the morning