#avr | Logs for 2013-03-24

Back
[02:47:14] <schnuws> hello! anyone who can help me figure out how to get an usbasp to work?
[06:22:34] <caesius> what 8-bit sequence is sent across a UART when the up-arrow key is pressed?
[06:23:35] <caesius> for e.g., keypress "A" = 00001010
[06:23:46] <caesius> but I can't find what happens for the other keys...
[06:24:05] <RikusW> it might be a multibyte sequence
[06:24:30] <RikusW> what kind of keyboard ? terminal or raw ps2 ?
[06:25:00] <caesius> AVR -> serial port -> minicom running on PC
[06:25:20] <RikusW> might be an escape sequence
[06:25:37] <RikusW> 1B followed by some other byte
[06:25:49] <caesius> RikusW: I thought it might be multibyte but that confuses me, my putchar function simply sets UDR0 = c, so only 8 bits can be sent for a keypress right?
[06:26:28] <caesius> and I'm doing a "uart_putchar(uart_getchar_raw(), &uart_stream)"
[06:26:50] <RikusW> hmm then it should echo back everything..
[06:27:18] <caesius> well, minicom moves the cursor up when I press up, so it is definitely getting the info
[06:27:40] <caesius> I'm almost resorting to grabbing an oscope to see what's going over the line :)
[06:27:49] <RikusW> got two serial port on that PC ?
[06:28:04] <RikusW> connect tx to the others rx
[06:28:11] <RikusW> and do cat | hexdump
[06:28:16] <caesius> I'm using an FTDI converter. but good idea
[07:29:23] <kdehl> I want to make a serial terminal, so I need to use that MAX232 chip, but since I'm lazy and hate soldering I figured I could buy a finished module on ebay.
[07:29:51] <kdehl> I found one that has external power supply, and one that doesn't, but I can't seem to find the difference between the two...
[07:29:55] <kdehl> http://www.ebay.com/itm/RS232-To-TTL-Converter-Module-Built-in-MAX232CPE-Transfer-Chip-With-4PCS-Cables-/280839635021?pt=AU_CablesConnectors&hash=item416358c04d
[07:30:00] <kdehl> http://www.ebay.com/itm/MAX232-RS232-To-TTL-Converter-Adapt-er-Module-Board-/260781677532?pt=AU_B_I_Electrical_Test_Equipment&hash=item3cb7cc9bdc
[07:30:29] <kdehl> The schematics that I've seen don't use external power, so... What's the point of that?
[07:34:28] <Horologium> the one with cables uses USB port to provide power to the max232 chip.
[07:34:41] <Horologium> the other one you have to provide power from your circuit to the VCC and GND pins.
[07:34:53] <Horologium> that's the difference.
[07:35:03] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/misc_stuff/rs232_5.jpg
[07:35:42] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/misc_stuff/rs232_sch.png
[07:36:07] <Horologium> the one with the cables can be powered from your circuit too by not using the provided usb power cord and connecting 5V from your circuit to the power pins on the side of the board.
[07:36:09] <Tom_itx> that one gets power from the target board
[07:36:55] <Horologium> also, the one without the cables gives you RTS and CTS pins which the other one doesn't...
[07:36:56] <kdehl> Aha, I see.
[07:37:24] <Tom_itx> most µC apps don't use those though
[07:37:30] <Horologium> true.
[07:37:44] <Horologium> ardweeny uses one of them for the reset line though.
[07:38:25] <kdehl> Alright. So I guess I need to decide exactly what I want to do before I buy them... hm, hm...
[07:38:46] <Tom_itx> just get a simple one like my schematic shows
[07:38:55] <Horologium> personally, I like the max233 chip over the max232
[07:38:59] <Tom_itx> powering from the target is no big deal
[07:39:05] <kdehl> Right. Okay.
[07:39:07] <Horologium> functionally the same...but fewer external parts,,,like, none.
[07:39:15] <Tom_itx> costs more too
[07:39:18] <kdehl> Hehe. I like it that way.
[07:39:19] <Horologium> true.
[07:39:29] <Horologium> 7 dollars compared to 2
[07:39:42] <Tom_itx> i had one of those not work on one µC too
[07:39:46] <kdehl> Alright, I get the one without external power.
[07:39:58] <Horologium> Tom_itx, never had a problem with them..
[07:39:59] <Tom_itx> where mine would
[07:40:05] <Tom_itx> i have some of both
[07:40:24] <kdehl> http://www.ebay.com/itm/1PCS-RS232-To-TTL-Converter-Module-COM-Serial-Board-MAX232CSE-Transfer-Chip-/251131176552?pt=LH_DefaultDomain_0&hash=item3a7895a668
[07:40:30] <kdehl> Notice:The chip max3232 is made in China,some customer find it not compatible after purchase.
[07:40:51] <kdehl> Sounds scary, but it's even cheaper.. ;)
[07:41:10] <kdehl> Do you guys know about max3232?
[07:41:22] <Tom_itx> it may be 3v i forget
[07:41:27] <Tom_itx> 3v logic
[07:41:40] <kdehl> Hm. It says working voltabe 3.3 - 5 V
[07:41:43] <Horologium> kdehl, you have an actual serial port I take it?
[07:41:50] <kdehl> 5.5 even.
[07:42:10] <kdehl> Horologium: Not yet. But I will. Heh.
[07:42:16] <Tom_itx> yeah, don't use one of those if you don't have a serial port
[07:42:33] <kdehl> What should I use instead you mean?
[07:43:45] <Horologium> usb to serial ttl level adapter.
[07:44:10] <Horologium> http://www.newark.com/ftdi/ttl-232r-3v3/usb-to-serial-converter-cable-3/dp/34M8872
[07:44:12] <Horologium> like that.
[07:44:19] <kdehl> Um.. Okay.
[07:44:30] <Horologium> only, that one is 3.3V
[07:44:56] <kdehl> Right.
[07:45:11] <kdehl> Okay.
[07:45:14] <kdehl> Hm.
[07:45:23] <Horologium> https://www.sparkfun.com/products/9718
[07:45:28] <Horologium> that one is 5V.
[07:45:36] <kdehl> Right.
[07:45:40] <Horologium> with that no maxXXX chip is needed.
[07:46:00] <Horologium> plugs into the USB port, gives you TTL level(microcontroller compatible) connections on the other end.
[07:46:06] <Horologium> sets up as a serial port on the PC.
[07:46:50] <kdehl> Well, I guess I could use both. That USB thing is simpler, but I also would like to have it compatible with RS-232.
[07:47:06] <Horologium> that does give you RS-232 at ttl level...
[07:47:13] <kdehl> Oh it does.
[07:47:18] <Horologium> it just replaces the serial port and the max chip.
[07:47:36] <Horologium> as most modern computers don't have an actual serial port,,
[07:47:40] <kdehl> Right.
[07:48:03] <Horologium> you connect to the microcontroller where you would connect the max232 chip.
[07:48:17] <kdehl> Ah, right. Got it.
[07:48:39] <kdehl> But I was thinking I might want to, say, plug in a serial port of Commodore 64 into it, then I'd need that other one from ebay.
[07:48:48] <Horologium> nope.
[07:48:54] <kdehl> Oh.
[07:49:08] <Horologium> well,,,do you mean the one on the c64 board or an adapter that plugs in?
[07:49:12] <kdehl> Well, okay then. Heh.
[07:49:48] <Horologium> because the c64 i/o port is ttl level....you have to have an rs232 level adapter cartridge to get rs-232 non-ttl levels out of it.
[07:49:51] <kdehl> I saw that the C64 has a rs-232 compatible port, so I just figured it's just like a serial port on a PC.
[07:49:58] <kdehl> Aha.
[07:50:00] <Horologium> nope nope nope.
[07:50:05] <Horologium> must read carefully.
[07:50:07] <kdehl> Okay. Heh. Sorry.
[07:50:19] <Horologium> you need an adapter for c64 to get to rs-232 levels.
[07:50:26] <kdehl> Okay. Gotcha.
[07:50:32] <kdehl> Well, screw the C64 for now, then.
[07:50:45] <kdehl> I thought it'd be super simple.
[07:51:09] <kdehl> So the serial port on a PC is only what I need a max232 for?
[07:51:40] <Horologium> there is actually no UART on the C64 at all.
[07:51:53] <Horologium> yes.
[07:51:55] <kdehl> Oh. Okay.
[07:51:57] <kdehl> Right.
[07:53:37] <Horologium> modems on the C64 generally had their own built in UART...and there was an actual rs-232 uart cartridge for the thing...I had one years ago.
[07:54:08] <Horologium> but the user port where the modem connected just had 17 i/o pins and some power and ground.
[07:54:20] <Horologium> and serial was generally bitbanged.
[07:54:43] <kdehl> I see.
[07:55:25] <kdehl> When you say TTL levels, you mean 5 volts, right?
[07:55:29] <Horologium> yes.
[07:55:57] <Horologium> http://www.allaboutcircuits.com/vol_4/chpt_3/10.html
[07:56:00] <kdehl> If that was standard back then already, why did they screw up the voltage on the serial port like that?
[07:56:16] <kdehl> Right.
[07:57:00] <kdehl> TTL gates have a pretty large span of logical 1...
[07:57:12] <Horologium> rs-232 levels are older than c64.
[07:57:50] <kdehl> Oh yeah. Heh. Wikipedia says '69.
[07:58:28] <Horologium> and they use +/- voltage levels...
[07:58:36] <Horologium> up to +/- 15V
[07:58:55] <kdehl> Right.
[07:59:45] <Horologium> hence the inverter and level converter chip necessary to get to TTL levels.
[07:59:53] <kdehl> Well, maybe I should just ignore the rs-232, then...
[07:59:56] <kdehl> Right, right.
[07:59:57] <Horologium> but, doing it that way you get more noise immunity.
[08:00:10] <kdehl> Ah.
[08:00:37] <Horologium> the USART on the AVR is still the best way to connect it to a PC....using RS-232 protocol.
[08:00:46] <Horologium> unless you have an AVR with USB onboard.
[08:00:57] <Horologium> or want to deal with vUSB bitbanged low speed USB.
[08:01:37] <kdehl> Isn't that bypassing the standard, using rs-232 using the wrong voltage? Makes me uncomfortable.
[08:02:04] <Horologium> it works just fine.
[08:02:23] <Horologium> the RS-232 voltage levels just give you the ability to run longer cables than TTL levels.
[08:02:33] <Horologium> and at TTL levels you can get higher speeds.
[08:03:11] <Horologium> the RS-232 levels and protocol were designed before high speed integrated circuits could hide a plethora of sins done today.
[08:03:26] <kdehl> Yeah. Heh.
[08:03:49] <Horologium> and putting that max232 chip in line just gives you a conversion between ttl and rs-232 levels anyhow..
[08:04:10] <kdehl> So, all the max232 does is convert it to correct rs-232 levels, which is only useful if you have a normal serial port on a PC (or another device that uses that port).
[08:04:14] <kdehl> Right. Hehe.
[08:04:31] <Horologium> keep your wires under 1 meter between the microcontroller and the usb chip(or max232) and you are fine.
[08:04:42] <kdehl> Right.
[08:05:05] <kdehl> I think I remember serial cables could be up to five meters... could that be right?
[08:05:12] <Horologium> I've gotten 2Mb/s comms between microcontrollers over the USART
[08:05:17] <kdehl> I remember those null modem cables from the 90's.
[08:05:17] <Horologium> sounds about right.
[08:05:23] <Horologium> remember? I have them!
[08:05:27] <kdehl> Haha.
[08:05:28] <Horologium> blue laplink cables.
[08:05:30] <kdehl> Awsome.
[08:05:35] <Horologium> and yellow parallel laplink cables.
[08:05:43] <kdehl> Ah! I made my own laplink cable, couldn't afford to buy one!
[08:05:54] <Horologium> I did retail computers back then.
[08:05:59] <kdehl> Ah, cool.
[08:06:00] <Horologium> we used them all the time to transfer data.
[08:06:09] <kdehl> Horologium: I was a kid back then.. :)
[08:06:12] <Horologium> the parallel was about 4 times as fast as the serial.
[08:06:28] <Horologium> then we got personal netware..
[08:06:35] <Horologium> that blew the laplink cables away.
[08:06:47] <kdehl> Right, I remember that. And used some kind of DOS program to transfer files between the computers.
[08:06:50] <kdehl> I know.
[08:07:07] <kdehl> Coax, 10 Mbit. Those were the days.
[08:07:15] <Horologium> load up personal netware on the two computers by booting a custom boot floppy....then use xcopy to copy the data over.
[08:07:58] <Horologium> personal netware kinda died out due to microsoft coming out with windows for workgroups within a few months.
[08:08:18] <Horologium> I go back before 10Mb/s thinnet.
[08:08:31] <Horologium> I go back to the days of arcnet and even thicknet ethernet and token ring.
[08:11:22] <kdehl> Damn. I never had token ring.
[08:12:08] <kdehl> I had a NIC but no hub, they were expensive as hell. We used twisted ethernet instead, after the coax. Much cheaper. Seldom had more than two computers in a "network" anyway. Heh.
[08:12:28] <Horologium> didn't need a hub for token ring....hubs just made wiring easier.
[08:12:37] <kdehl> Arcnet I've never heard of.
[08:12:42] <kdehl> Oh.
[08:12:46] <Horologium> arcnet was like thinnet only slower.
[08:12:47] <kdehl> Just like ethernet?
[08:12:49] <Horologium> 2.5Mb/s
[08:12:52] <kdehl> Ah.
[08:12:53] <kdehl> Cool.
[08:12:56] <Horologium> and used passive hubs.
[08:13:09] <Horologium> was rg-62 cable...in a star topology.
[08:13:20] <Horologium> rather than rg-58 in a straight bus topology.
[08:13:45] <Horologium> wasn't around for very long and never made it real big like ethernet did.
[08:14:29] <kdehl> Ah, thinnet is that 10 Mbit ethernet network. Never heard the name.
[08:14:51] <kdehl> I hated those BNC connectors. They never worked.
[08:14:53] <Horologium> thinnet is 10base5
[08:15:00] <Horologium> thicknet is 10base2
[08:15:10] <Horologium> twisted pair is 10baseT
[08:15:16] <Horologium> or 100BaseT
[08:15:20] <Horologium> or 1000baseT
[08:15:21] <kdehl> Ah.
[08:15:46] <Horologium> well dwats.
[08:15:51] <Horologium> I have to go to work tomorrow.
[08:15:56] <Horologium> didn't win the powerball.
[08:16:24] <kdehl> And today at work we move 20 GB vmware profiles on a GBit network in minutes. I do it several times an hour.
[08:18:27] <Horologium> I'm waiting for terabit/s networks.
[08:19:02] <kdehl> Three years?
[08:19:03] <kdehl> Two?
[08:19:15] <kdehl> I'm just guessing, I don't even know what's available right now.
[08:23:04] <kdehl> The current reporting is that the target date for Terabit Ethernet is 2015, and talk of 100 Terabit Ethernet by 2020.[3]
[08:23:08] <kdehl> http://en.wikipedia.org/wiki/Terabit_Ethernet
[08:23:40] <Horologium> bah.
[08:23:45] <Horologium> I want terabit wireless dangit!
[08:25:16] <kdehl> And all I want is a 2400 baud serial cable.
[08:34:55] <kdehl> http://www.ebay.com/itm/1pcs-USB-2-0-to-TTL-UART-6PIN-Module-Serial-Converter-CP2102-STC-PRGMR-/251039347548?pt=LH_DefaultDomain_0&hash=item3a731c735c
[08:35:06] <kdehl> So _that_ is what I need in order to make things simple.
[08:36:19] <kdehl> http://www.ebay.com/itm/1pcs-PL2303-USB-RS232-TTL-Converter-Adapter-Module-/251082091781?pt=LH_DefaultDomain_0&hash=item3a75a8ad05
[08:36:22] <kdehl> Hah! Even cheaper!
[08:37:42] <kdehl> When it says RS232 TTL or TTL UART, that is the same thing?
[09:02:57] <sabesto> damnit, i just updated AS6 to latest version to have a look at some mega256RFR2 example code, but all of them are missing the main.c file
[09:05:32] <Horologium> kdehl, yes..same thing
[09:05:47] <kdehl> Horologium: Okay, great.
[09:05:54] * kdehl shops
[09:06:26] <Horologium> sorry for the delay..was washing dishes and fixing breakfast.
[09:06:56] <kdehl> Hehe. No problem. You've hepled me a lot already.
[09:07:16] <Horologium> don't tell my wife..she will want my help with something.
[09:07:38] <kdehl> Haha.
[09:08:22] <kdehl> Damn. ebay is some dangerous shit.
[09:08:39] <kdehl> I've bought like 15 items the past two weeks or so.
[09:08:44] <kdehl> It's so cheap!
[09:10:06] <Horologium> gotta be careful.
[09:10:10] <Horologium> you get what you pay for.
[09:10:17] <kdehl> True that.
[09:10:27] <Horologium> have seen some of that cheap chinese shit be totally useless.
[09:10:37] <kdehl> Yeah.
[09:10:53] <kdehl> Well, if it's on average less than two bucks, I can live with some stuff not working.
[09:13:53] <sabesto> been overall happy with the chinese ebay stuff
[09:14:32] <Horologium> I wouldn't use it in a production level environment but generally I've had good luck with it with a few exceptions.
[09:16:18] <Horologium> but, still, be careful.
[09:16:21] <sabesto> anyone use asf?
[09:16:31] <Horologium> not if I can help it.
[09:16:51] <sabesto> just updated everything to the latest version and the main.c file is still missing
[09:16:55] <Horologium> but, by ASF, which ASF do you mean?
[09:17:23] <sabesto> it shows up briefly while loading the example project, then dissapears
[09:17:37] <sabesto> what do you mean?
[09:18:53] <Horologium> ASF--advanced systems format
[09:19:12] <Horologium> it is a microsoft a/v format
[09:19:38] <sabesto> probably atmel software framework
[09:20:21] <Horologium> oh..never used that one either.
[09:21:01] <Horologium> wonder if it can be used without atmel studio.
[09:34:48] <sabesto> it can
[11:19:32] <kdehl> I get so happy when I stumble upon a website like http://cpuville.com/
[11:20:22] <kdehl> Not only because it's a cool project to build your own CPU and stuff, but because it's okay to still make a webpage with only text, a few links and a bunch of images, and that's it.
[11:21:06] <kdehl> No fancy modern crap. Just the basics.
[11:23:35] <kdehl> ...
[11:23:39] <kdehl> That page is from 2004.
[11:23:46] <kdehl> Never mind.
[11:31:04] <GuShh_> kdehl: I'm surprised you were born prior to 2004!
[11:31:12] <GuShh_> check out some of the other projects
[11:31:24] <GuShh_> some are hosted on the actual CPUs
[11:32:03] <kdehl> GuShh_: Why would you think I was born after '04?
[11:32:20] <kdehl> Yeah, that is really cool.
[11:32:31] <GuShh_> Because you consider 2004 as old
[11:32:40] <GuShh_> whereas plain text sites were from the 80-90s
[11:32:51] <kdehl> Ah. Heh.
[11:36:01] <kdehl> I remember making homepages, testing them in Netscape on Windows 3.1 in the 90's. So I'm old.
[11:36:07] <OndraSter> heh
[11:36:12] <OndraSter> I was born in early 90s :(
[11:36:29] <kdehl> You child.
[11:36:36] <kdehl> http://upload.wikimedia.org/wikipedia/en/3/39/Welcome_to_Netscape.gif
[11:36:41] <kdehl> Yup. Totally used that.
[11:36:43] <OndraSter> not really, I can drink alcohol and drive a car (not at the same time)
[11:37:10] <kdehl> Hehe.
[11:50:23] <Strogg> 'lo 'lo
[13:08:35] <tzanger> OndraSter: that's why you're still considered a child. :-)
[15:17:11] <OndraSter> lol tzanger
[15:45:31] <Horologium> around here the cops have drinking&driving classes.
[15:45:37] <Horologium> I want to sign up for that to learn how.
[15:50:44] <slidercrank> Horologium, you can't drink?
[15:51:22] <Horologium> I have a drinking problem
[15:51:30] <Horologium> I spill it all over when I try to drive at the same time.
[15:52:08] <Horologium> might have something to do with trying to run the blender while measuring and pouring and trying to steer all at the same time I suppose.
[16:15:28] <OndraSter> well for me the bottle makes me bend a little and I do not see clearly outside
[16:15:35] <OndraSter> you know, when the bottle is getting low
[19:10:08] <tzanger> ah I see now, section 17.7 on the attiny13 datasheet. it's more than just switching 12V on the reset pin if you need to do HVISP to reset a bad fuse write. :-)
[19:16:07] <R0b0t1> Does anyone use xmega?
[19:16:19] <Horologium__> several people do.