#avr | Logs for 2015-04-26

Back
[01:46:49] <Tekkkz> Hello! You remember me? The guy with LUFA Serial (CDC) Communication with m32u4 via USB? ok, here my problem: I want to shorten my working functions of sending and receiving data (in the code the first section) to a single line (in code: 2nd section), i created therefore some functions, USB_getc and USB_putc, put is working but get not. It isnt responding the correct data and at every data i send, the same is
[01:46:49] <Tekkkz> responding. How to fix that? What's wrong? Thanks for your help
[01:47:01] <Tekkkz> ahh^^ the code: https://bpaste.net/show/fafa92f4df7d
[01:57:49] <Tekkkz> aczid, Xark Tom_itx tpw_rules can you help?
[02:00:25] <Xark> USB_getc will return "garbage" if it is EOF...
[02:01:49] <Xark> Hmm, how about let USB_getc return EOF (so jut remove the if and always return usb_char), and then make USB_putc "ignore" the char if it == EOF?
[02:04:29] <Xark> @Tekkkz
[02:30:53] <Tekkkz> ok ill try this
[02:41:43] <Tekkkz> Xark, now it works (USB_putc(USB_getc())) but let me try something else
[02:41:43] <Tekkkz> not "else", additional
[02:44:56] <Tekkkz> Xark, check out this: https://bpaste.net/show/5c5d03787d2b
[02:45:59] <Thrashbarg> Tekkkz: you're calling the getc function twice, which will retrieve two separate characters
[02:46:09] <Thrashbarg> or at least that's what I think is going wrong
[02:46:57] <Tekkkz> hm? why calling twice?
[02:47:27] <Thrashbarg> I'm not familiar with your entire code... right so you're replacing the top bit with the bottom one
[02:48:08] <Tekkkz> ah nono, i dont have both snippets at the same time in my code
[02:48:16] <Thrashbarg> right
[02:48:17] <Thrashbarg> ok
[02:48:34] <Thrashbarg> and 0x77 = lower case W?
[02:49:09] <Thrashbarg> which echos with an equal sign
[02:50:36] <Thrashbarg> Tekkkz: in this situation I'd replace USB_putc(USB_getc()); with printf("%02X ", USB_getc()); to see the hexadecimal value of the incoming characters
[02:50:45] <Thrashbarg> however, printf probably won't work
[02:50:53] <Tekkkz> nono
[02:51:00] <Tekkkz> the first snippet
[02:51:01] <Tekkkz> USB_putc(USB_getc());
[02:51:04] <Tekkkz> works fine
[02:51:09] <Thrashbarg> yes I know, so start from there
[02:51:30] <Thrashbarg> Tekkkz: I figure that's to echo the incoming characters back to the terminal?
[02:51:55] <Tekkkz> my switch isnt working
[02:51:55] <Tekkkz> why? it is working, he correct is arriving
[02:52:02] <Tekkkz> i can make a if usb_getc == XX then ... for testing, but no printf
[02:52:11] <Tekkkz> ya
[02:52:20] <Thrashbarg> what terminal program are you using?
[02:52:45] <Thrashbarg> or what are you using to send characters
[02:52:59] <Tekkkz> python script
[02:53:07] <Tekkkz> and this works fine
[02:53:33] <Tekkkz> listen
[02:53:41] <Tekkkz> i did this: if(USB_getc() == 77){SET_HIGH(LED_STATUS);}
[02:53:44] <Thrashbarg> okay, I'm wondering if it's sending Unicode and not ASCII, or something, which is why I'd be checking the incoming characters with hexadecimal listings
[02:54:03] <Tekkkz> and it worked
[02:54:06] <Tekkkz> so my switch is wrong
[02:54:08] <Thrashbarg> ah, so you're going 77 there and 0x77 in your case
[02:54:16] <Thrashbarg> 77 = 77 decimal
[02:54:18] <Tekkkz> oh
[02:54:20] <Tekkkz> ^^
[02:54:21] <Tekkkz> my fault
[02:54:23] <Tekkkz> :D
[02:54:26] <Thrashbarg> hehe
[02:54:57] <Thrashbarg> difficult to debug that sort of stuff over IRC :P
[02:55:03] <Tekkkz> nah everytime the same: basic mistakes im making ;(
[02:55:16] <Thrashbarg> we all get used to doing that :P
[02:57:11] <Tekkkz> ahh but i have still a problem
[02:57:19] <Thrashbarg> hmm?
[02:57:29] <Tekkkz> my switch isnt sending the correct data back, but i know why
[02:57:33] <Thrashbarg> hehe
[02:57:35] <Tekkkz> but i need your help to fox this
[02:57:58] <Thrashbarg> so what's it not doing?
[03:00:08] <Tekkkz> USB_putc(61); => doesnt work, because: static void USB_putc(int data){if(data!=EOF)fputc(data, USBSerialStream);} => it is EOF or? i dont know, but with USB_putc(..getc) it works, but not when i put a value into it
[03:01:50] <Thrashbarg> EOF depends on the operating system, it's 0x1A for DOS and 0x04 for UNIX... do you want 61 decimal or 0x61 hexadecimal?
[03:02:41] <Tekkkz> dec
[03:03:02] <Tekkkz> but this doenst matter, cause it responds just '0' at every value i send
[03:03:41] <Thrashbarg> you might want to see what EOF is declared as
[03:04:11] <Tekkkz> hm? what do you mean?
[03:04:13] <Thrashbarg> there's also feof() which tells you directly if a stream is at an EOF or not
[03:04:46] <Thrashbarg> EOF is a macro which is declared as a number, and it'll be different depending on the OS
[03:04:52] <Tekkkz> hm, but i dont know how i can solve my problem now?
[03:05:06] <Thrashbarg> not sure how the ATmega environment handles the EOF declare....
[03:05:09] <Thrashbarg> ok so...
[03:05:42] <Thrashbarg> you've got USB_getc? Mind if I have a look at that?
[03:05:42] <Tekkkz> ok so? what do you mean with that?
[03:05:45] <Tekkkz> ahh
[03:05:55] <Tekkkz> yeah wait
[03:05:58] <Tekkkz> btw
[03:06:11] <Tekkkz> in my switch, it gets the right case
[03:06:18] <Tekkkz> i put a led_on statement into it
[03:06:39] <Tekkkz> just the usb_putc(77) fails and returns 0
[03:06:39] <Tekkkz> to the python script
[03:08:17] <Thrashbarg> Tekkkz: hmm ok I don't have enough information
[03:08:31] <Tekkkz> so what do you want to see now?
[03:08:49] <Tekkkz> yeah, what do you want to see? the functions and switch statement?
[03:08:56] <Thrashbarg> yeah please
[03:11:30] <Tekkkz> https://bpaste.net/show/261006f78836
[03:11:30] <Tekkkz> here it is
[03:13:41] <Thrashbarg> Tekkkz: and the problem is you're only getting \000 back
[03:14:27] <Tekkkz> 0, yes
[03:15:13] <Thrashbarg> well the code appears to be sane, at least what I can see
[03:15:41] <Tekkkz> AHHHHHHH
[03:15:48] <Tekkkz> i removed the default: case
[03:15:49] <Tekkkz> and it works
[03:15:51] <Tekkkz> lulz
[03:15:53] <Tekkkz> why?
[03:16:34] <Thrashbarg> ok so that's odd. If you've already got case 77 there it should go to that, and only to default if it didn't get anything that matched the case statements
[03:19:41] <Tekkkz> are my breaks worng or whatever?
[03:19:50] <Thrashbarg> mmm I don't think so :/
[03:22:24] <Tekkkz> hm tahts strange so
[03:22:58] <Tekkkz> and you have no idea?
[03:23:43] <Thrashbarg> nothing occurs, no
[03:23:58] <Thrashbarg> might want to ask a professional ;)
[03:24:11] <Tekkkz> haha
[03:24:11] <Tekkkz> so you arent a pro=
[03:24:13] <Tekkkz> *?
[03:24:34] <Tekkkz> !!!
[03:24:51] <Tekkkz> wait
[03:24:53] <Tekkkz> ..
[03:25:18] <Thrashbarg> nah I'm just a smart arse
[03:25:56] <Tekkkz> hm
[03:26:37] <Tekkkz> it doesnt work with the default, but when im using any case else instead of default, it works, so there is a problem at default, hm, i think i cant use default so, and it isnt necessary, so we solved everything now
[03:27:53] <Thrashbarg> yay
[03:35:47] <Tekkkz> im away, byebye
[05:03:40] <fieldman> hey im trying to work with some stuff i found online and have set up a toolchain on a linux box but im unsure about some stuff
[05:04:05] <fieldman> i downloaded some source for a project and tried to use the makefile in it but getting some errors
[05:05:01] <fieldman> a bunch of undefined references
[05:05:30] <fieldman> was wondering is there something else i need to do to setup the envitronment or perhaps need to be building this stuff in aparticular location ?
[05:12:32] <fieldman> hmm i just went to the website
[05:12:38] <fieldman> is this channel all about assembley?
[05:13:42] <fieldman> apparently not :)
[05:42:13] <DKordic`> fieldman: Hello. Some more information just in case. Web site URL? I think this is the best place for AVR assembly questions. There is also ##asm.
[05:43:30] <DKordic`> I think most people here use avr-gcc, without any "IDE".
[05:53:01] <Tekkkz> Hello, its me, again ;) Hi Thrashbarg , still there?
[05:54:16] <DKordic> Tekkkz: Hello.
[06:04:53] <fieldman> oh nah i was wondering about some stuff in c
[06:04:59] <fieldman> i thought perhaps this was asm only
[06:08:38] <fieldman> https://github.com/balrog-kun/lights
[06:08:39] <fieldman> there
[06:09:02] <fieldman> see up til now ive only ever used an IDE ... and there i see im gonna have to approach things a bit differently
[06:09:19] <fieldman> so i went ahead and installed the toolchain for this
[06:09:25] <fieldman> however getting some errors
[06:09:54] <fieldman> so im wondering if its just i havent quite setup my environment correctly etc. i figured i could just make or make all
[06:09:58] <fieldman> with the included makefile
[06:10:03] <fieldman> and all would be good! :)
[06:14:47] <Tekkkz> Ahh hm hi DKordic
[06:14:58] <Tekkkz> im asking my question now, wait
[06:19:37] <Tekkkz> here my question: https://bpaste.net/show/d8193777cf92 DKordic Thrashbarg and @other 's can you help pls?
[06:20:44] <Thrashbarg> Tekkkz: initializer element is not a constant. I.e. you can't declare a variable with anything other than a constant
[06:21:10] <Thrashbarg> you need the static uint32_t lines to declare the variable, then separate lines for xpos = etc
[06:21:19] <Tekkkz> what is the meaning of "I.e." ?
[06:21:36] <Thrashbarg> replace it with "that is to say"
[06:21:57] <Tekkkz> ahh ok
[06:22:01] <Thrashbarg> the abbreviation is of the Latin translation
[06:22:47] <Tekkkz> why seperate lines for xpos=.. ?
[06:22:56] <fieldman> i usually interchange i.e. and e.g !
[06:23:47] <Thrashbarg> heh
[06:24:01] <Tekkkz> yeah
[06:24:13] <Tekkkz> i also thought first e.g. but diff meanings and .. yo
[06:24:18] <Tekkkz> so why seperate lines?
[06:24:31] <Thrashbarg> Tekkkz: because you can't have a declaration and an assign from another variable or subroutine on the same line
[06:24:43] <Tekkkz> ahh ok
[06:26:49] <Tekkkz> uhh
[06:26:53] <Tekkkz> now there is a big error
[06:27:49] <Tekkkz> hmpf
[06:27:50] <Tekkkz> https://bpaste.net/show/f74e808f6f49
[06:27:54] <Tekkkz> so much i dont understand
[06:27:55] <Tekkkz> ;(
[06:35:47] <Tekkkz> hm ok lets first try something more easy
[06:35:59] <Tekkkz> just a byte with the eeprom-functions
[06:36:06] <Tekkkz> eeprom_write_byte((uint8_t*)20, 64);
[06:36:15] <Tekkkz> its correct, i read it from a tutorial
[06:36:16] <Tekkkz> but:
[06:36:41] <Tekkkz> https://bpaste.net/show/b49c1ae2fad1
[06:36:54] <Tekkkz> so hm, whatdoes this error means Thrashbarg ?
[06:39:50] <fieldman> http://pastie.org/10114482
[06:40:05] <fieldman> ok so theres the errors i get when trying to just use the makefile with that stuff i was trying to compile
[06:40:49] <fieldman> sucks i cant cut and paste between these virtual machines
[06:40:54] <fieldman> had to type that url out ! :)
[07:09:22] <Lambda-Aurigae> fieldman, you haven't defined your processor anywhere most likely.
[07:09:33] <Lambda-Aurigae> hence the "device type not defined" error in io.h....
[07:09:39] <Lambda-Aurigae> that will cause everything else to fail.
[07:10:31] <Lambda-Aurigae> and it appears you are running as root,,which won't stop it from compiling but is a bad idea generally for security.
[07:12:36] <Lambda-Aurigae> also, pastie seems to cut your lines off and some stuff is missing
[07:12:42] <Lambda-Aurigae> or
[07:12:49] <Lambda-Aurigae> it just needs to scroll sideways.
[07:12:55] <Lambda-Aurigae> blah...need word wrap there.
[07:13:19] <DKordic> Makefile: ``MCU = atmega328p''.
[07:13:38] <DKordic> But for some reason it is missing.
[07:13:41] <Lambda-Aurigae> yeah...saw that but something is causing that not to show up in the make command.
[07:13:48] <Lambda-Aurigae> or, in the avr-gcc command rather.
[07:16:27] <Lambda-Aurigae> I get different errors with that makefile.
[07:16:45] <Lambda-Aurigae> unable to make lights.hex....after I remove the elf requirement
[07:17:50] <Lambda-Aurigae> make: *** No rule to make target `lights.hex', needed by `hex'. Stop.
[07:17:58] <Lambda-Aurigae> something is horked with that makefile I think.
[07:19:09] <DKordic> Makefile: ``.elf.hex:''. I guess .hex is extracted from ELF. I would fix it with rm :) .
[07:19:31] <Lambda-Aurigae> it looks like it's generated by ardweeny crap.
[07:20:27] <DKordic> Exactly ``ARDUINO'' comes from?!
[07:22:35] <Lambda-Aurigae> it comes from someone built that from an arduino project.
[07:22:45] <Lambda-Aurigae> which means, it probably is relying on some setup that arduino uses.
[07:23:13] <Lambda-Aurigae> and it's too early for me to rehork arduino stuff into plain avr-gcc
[07:27:58] <fieldman> oh hey
[07:28:03] <fieldman> didnt see this conversation :)
[07:28:11] <Lambda-Aurigae> obliviously.
[07:29:26] <fieldman> totally
[07:29:27] <fieldman> hehe
[07:30:47] <Lambda-Aurigae> so, ultimately, it looks like your Makefile is really futzed up...
[07:30:59] <fieldman> most likely
[07:31:24] <fieldman> i worked thru a bunch of other stuff in this guys project
[07:31:27] <Lambda-Aurigae> generated by some arduino system then modified...but it looks like it might still be wanting the arduino system.
[07:31:37] <Lambda-Aurigae> which I refuse to install on my computer
[07:31:38] <fieldman> took quite some time since he talks like theres all kinds of assumptions
[07:31:42] <Lambda-Aurigae> so can't verify that theory.
[07:31:49] <fieldman> lol @ REFUSE !
[07:32:04] <Lambda-Aurigae> I abso-fucking-lutely refuse to touch ardweeny crap here.
[07:32:09] <Lambda-Aurigae> tried it
[07:32:10] <fieldman> hehe
[07:32:18] <Lambda-Aurigae> wanted to burn the harddrive it was installed on.
[07:32:25] <fieldman> yah i can understand that
[07:32:34] <fieldman> for me this stuff is just a means to an end
[07:32:37] <fieldman> im not a puist! :)
[07:32:41] <fieldman> purist
[07:32:54] <Lambda-Aurigae> I'm not a purist...I just find ardweeny totally idiotic.
[07:33:01] <fieldman> well i didnt say you were
[07:33:06] <fieldman> just a figure of speech ;)
[07:33:21] <Lambda-Aurigae> I use whatever works best for the project.
[07:33:23] <fieldman> i was doing this on my workstation (mac)
[07:33:37] <Lambda-Aurigae> 100% linux here.]
[07:33:39] <fieldman> then set up a virtual machine to run debian to install all that avr stuff
[07:33:47] <fieldman> and thats where im at!
[07:33:48] <fieldman> heh
[07:34:35] <DKordic> fieldman: So You want bootloader with wireless link?
[07:34:46] <fieldman> yah mon
[07:35:04] <fieldman> so far i have the bootloader on a device
[07:35:11] <fieldman> and worked thru some issues with that
[07:35:23] <fieldman> actually hold on
[07:35:27] <Lambda-Aurigae> Ive been using linux since before 2000 and using it exclusively since 2005 or so...and started with AVR back around 2001 or so,,,a bit before arduino showed up.
[07:35:29] <fieldman> let me paste a link to where i started at
[07:35:51] <fieldman> i installed slakware in the early 90's !
[07:36:01] <Lambda-Aurigae> but I also do PIC, PIC32, msp430, and 8052.
[07:36:15] <Lambda-Aurigae> I did my first slack in about 1995.
[07:36:21] <Lambda-Aurigae> just after my first freebsd.
[07:36:48] <fieldman> https://github.com/balrog-kun/optiboot
[07:36:52] <fieldman> ok so this is where i started
[07:36:59] <Lambda-Aurigae> only mickysoft windows in my house is on the wifey's laptop.
[07:37:03] <fieldman> then my previous link is also from the same guy (link on that page)
[07:37:32] <fieldman> my gf uses windows on her laptop
[07:37:35] <fieldman> looks weird!
[07:37:44] <Lambda-Aurigae> my mother-n-law is running linux!
[07:37:48] <fieldman> heh nice
[07:37:53] <Lambda-Aurigae> it was either that or I refused to service her computer.
[07:38:01] <Lambda-Aurigae> I was having to fix it every week.
[07:38:10] <Lambda-Aurigae> now with linux on it I see it once every 6 months or so.
[07:38:18] <fieldman> sweet
[07:38:51] <Lambda-Aurigae> she can't click on everything and install seventy addons and toolbars...I have her browser locked good.
[07:38:57] <fieldman> ok so on that page ... i have made the bootloader and got it on the processor
[07:39:19] <Lambda-Aurigae> ok.
[07:39:24] <fieldman> had to modify it a bit tho to set a pin high to drive a transistor so i could power on and off the radio module ... so far so good
[07:39:53] <fieldman> then he has a part where he talks about flashing somethign onto another unit to send my code to the processor
[07:40:04] <fieldman> and im stuck at getting that part made
[07:43:51] <Lambda-Aurigae> guess I don't see that.
[07:47:44] <Lambda-Aurigae> but, yeah, you will need two units,,,with one setup to send data from computer over the wireless link.
[07:48:00] <fieldman> yup
[07:48:17] <fieldman> thats the part im stuck at (the one that does the "sending")
[07:48:48] <Lambda-Aurigae> looks like he must have put the two in the same folder or something.
[07:48:56] <Lambda-Aurigae> which seems rather idiotic to me.
[07:49:13] <fieldman> i think what he has in that folder is a few utility programs
[07:49:32] <fieldman> one of which is the flasher that gets put onto the sending unit
[07:49:49] <fieldman> he only references that repository solely for that component
[07:50:14] <Lambda-Aurigae> I suggest talking to whoever wrote that.
[07:50:22] <fieldman> basically with that in place the idea is to use the arduino ide to load the program to that sending unit which will forward it along
[07:50:31] <Lambda-Aurigae> as it is all arduino code, you might could ask over in the arduino channel.
[07:50:39] <fieldman> yah no reply thus far :)
[07:51:00] <fieldman> figured since the way he has it setup i thought maybe its more geared to what this is all about
[07:51:35] <Lambda-Aurigae> email the author would be my suggestion.
[07:51:48] <Lambda-Aurigae> or write your own.
[07:51:57] <Lambda-Aurigae> which is what I would do.
[07:53:04] <fieldman> yah the email is on deck !
[07:53:05] <fieldman> heh
[07:55:36] <Lambda-Aurigae> ok..gotta go collect my tools and take them back to the shop
[08:37:03] <fieldman> hmmm i just did ... make flasher.hex
[08:37:05] <fieldman> and it made it
[08:37:14] <fieldman> maybe that will work !
[08:37:16] <fieldman> :)
[08:37:32] <x29a> try "make me a sandwich" next
[08:37:36] <fieldman> dude
[08:37:40] <fieldman> YOU make ME a sandwich
[08:37:48] <fieldman> speaking of which
[08:37:53] <fieldman> i been up all night .. breakfast time
[08:37:55] <x29a> everybody knows this command requires sudo
[08:38:05] <fieldman> i login as root
[08:38:09] <fieldman> heh
[08:41:30] <DKordic> fieldman: What was the problem?
[08:45:25] <fieldman> well i did a couple things
[08:45:34] <fieldman> full path to avr/io.h
[08:45:37] <fieldman> and some othe rpath
[08:45:45] <fieldman> but i think simply just needed to do make flasher.hex
[08:45:59] <fieldman> now ... programmer not responding ! hehe getting closer
[08:52:01] <malinus> no, you are both wrong
[08:52:10] <malinus> it's "sudo make sandwich"
[08:54:10] <bitd> Blehhh, FreeRTOS, do not want.
[08:54:22] <bitd> Aand wrong channel <.<
[09:00:37] <fieldman> ok well i flashed eeprom and flashed the hex file
[09:00:42] <fieldman> finally !
[09:00:46] <fieldman> hope it works :)
[09:02:53] <DKordic> fieldman: I think ``#include <whatever.h>'' should be used for avr-libc headers.
[09:28:33] * LeoNerd looks at the ATmega644
[09:28:43] <LeoNerd> Oooh this is nice.. dedicated hardware RESET and XTAL pins, so they don't collide with GPIOs
[09:45:33] <bitd> LeoNerd, I'm trying to move away from the 8 bitters, stop making me enthusiastic about them <.<
[09:46:59] <bitd> I think I will transition slowly by starting with a AT32UC3C
[10:55:41] <paulk-collins> hey there
[10:56:10] <paulk-collins> so I'm running my Arduino with native C and I'm toggling a pin in a while(1) loop in main()
[10:56:15] <paulk-collins> it's really not doing anything else
[10:56:27] <paulk-collins> and it does it at 167 kHz
[10:56:46] <paulk-collins> now it's an Arduino Uno, it's supposed to run at 16MHz
[10:56:50] <paulk-collins> so what is taking so long?
[10:57:57] <Lambda_Aurigae> how are you toggling?
[10:59:11] <paulk-collins> Lambda_Aurigae, http://git.paulk.fr/gitweb/?p=ardui2c.git;a=blob;f=ardui2c.c;h=9a9d5b17a7f9b5cd20b7f92688ec79b828969b97;hb=HEAD#l42
[10:59:16] <paulk-collins> takes max 30 instructions in ASM
[11:00:13] <Lambda_Aurigae> are you sure it is set to run at 16MHz?
[11:01:36] <paulk-collins> how to check and how to force that?
[11:01:50] <Lambda_Aurigae> well, look at the fuses and see how they are set for starters.
[11:01:58] <Lambda_Aurigae> does it have a 16MHz crystal attached?
[11:02:13] <Lambda_Aurigae> you have to have the fuses set right and the crystal attached for it to run at that speed.
[11:02:39] <paulk-collins> crystal is there
[11:02:56] <Lambda_Aurigae> I have no clue what an arduino uno is or what hardware it has other than some avr on a board with some interface stuff.
[11:03:30] <paulk-collins> yeah
[11:03:43] <paulk-collins> actually avrdude tells that the fuses are 0 0 0 which doesn't seem right
[11:04:11] <Lambda_Aurigae> are you reading that through the ardweeny bootloader?
[11:04:40] <Lambda_Aurigae> or through an ISP interface and a programmer?
[11:05:26] <paulk-collins> through the arduino bootloadder
[11:05:41] <Lambda_Aurigae> then that's why it reports like that.
[11:05:50] <Lambda_Aurigae> arduino bootloader doesn't work for fuses.
[11:06:06] <Lambda_Aurigae> can not read or write them.
[11:06:48] <paulk-collins> ah :/
[11:06:58] <Lambda_Aurigae> some bootloaders can read fuses
[11:07:01] <Lambda_Aurigae> but none can write them.
[11:07:21] <Lambda_Aurigae> you have to use ISP or HVSP/HVPP to write fuses.
[11:10:20] <paulk-collins> ok
[11:15:21] <paulk-collins> anyway I guess the fuses aren't the proble
[11:15:23] <paulk-collins> problem*
[11:34:31] <Casper> suspiciously slow...
[11:34:36] <DKordic> paulk-collins: Explain line 47 ``PINB |= 1 << DEBUG''. On some devices ``PINn = mask'' is like ``PORTn ^= mask''.
[11:34:43] <Casper> are you sure that your debug() isn't taking too long?
[11:35:21] <paulk-collins> DKordic, yep, I was just told that
[11:35:36] <paulk-collins> I built with optimizations and s/PINn/PORTn/ and it's better already
[11:37:25] <DKordic> paulk-collins: Check out ``$ avr-man _BV''.
[11:39:05] <paulk-collins> alright
[12:57:29] <ferdna> i need help.... i need to connect an atmega328 to a max232... but then i will need usb connection....
[12:57:32] <ferdna> can i do this?
[13:02:55] <Lambda_Aurigae> ferdna, what kind of usb connection?
[13:03:08] <ferdna> serial usb connection
[13:03:17] <Lambda_Aurigae> atmega328 to max232 is simple enough...a dozen or more schematics out there for that.
[13:03:59] <Lambda_Aurigae> so what are you using for the usb-serial adapter?
[13:05:18] <Lambda_Aurigae> are you wanting the usb-serial adapter to go through the max232?
[13:06:17] <Lambda_Aurigae> reason I ask this is that the atmega328 has only one USART....you will either need to bitbang the second UART/serial connection or chose another chip.
[13:06:24] <ferdna> Lambda_Aurigae, mmm...
[13:06:32] <ferdna> i see
[13:06:38] <Lambda_Aurigae> or, add in some kind of switching mechanism.
[13:06:40] <ferdna> so i do need another chip for this...
[13:07:23] <Lambda_Aurigae> I have no idea what you need as you have not given full specifications on what you are doing beyond needing 2 serial connections....do they need to both be on at the same time? can you bitbang one of them?
[13:08:56] <Lambda_Aurigae> if they both need to be active at the same time and you can't bitbang one, then, yes, you will need a different AVR.
[13:10:47] <Lambda_Aurigae> if you need to stay in the atmega series, you will need to go to a 40pin chip to get dual USARTs
[13:12:16] <LeoNerd> If one of the UARTs is only being used to connect to a USB bridge to a PC anyway, perhaps consider a 32U4, which has native USB anyway
[13:12:19] <Lambda_Aurigae> otherwise you could go with attiny1634, attiny441, or attiny841...all SMT packages though...no dip in those.
[13:14:23] <Lambda_Aurigae> so, to better assist, we need some more specifications.
[13:15:19] <ferdna> its only one connection. no need for multiple connections...
[13:15:30] <ferdna> but i want to be able to use it with a serial cable and usb cable...
[13:15:36] <ferdna> Lambda_Aurigae,
[13:15:38] <Lambda_Aurigae> ok.
[13:15:50] <Lambda_Aurigae> so, avr to max232 to serial....
[13:16:24] <Lambda_Aurigae> usb cable will need to be an rs232 level usb serial adapter..the kind with the db9 connector on the end rather than the 5 or 6 pin flat connector.
[13:18:20] <ferdna> yeah db9 connector
[13:18:45] <Lambda_Aurigae> http://www.swharden.com/blog/2009-05-14-simple-case-avrpc-serial-communication-via-max232/
[13:19:04] <Lambda_Aurigae> replace the chip on the left in the first schematic with whatever avr...just have to find the rxd and txd lines.
[13:19:32] <ferdna> Lambda_Aurigae, https://arduinodiy.wordpress.com/2012/03/19/serial-connection-for-your-arduino-atmega/
[13:19:37] <ferdna> thats the one i was following
[13:19:40] <Lambda_Aurigae> now, note, this setup does not support arduino bootloader.
[13:19:52] <ferdna> it all will be coded on C
[13:19:57] <ferdna> so no arduino bootloader
[13:20:20] <Lambda_Aurigae> those two are not necessarily mutually exclusive.
[13:20:35] <Lambda_Aurigae> you can program in C and still use the ardweeny bootloader.
[13:21:31] <Lambda_Aurigae> pretty much the only difference between the one I posted and the one you posted is the LEDs and the RTS pin.
[13:21:51] <Lambda_Aurigae> the RTS being used by the ardweeny to reset the chip and put it into bootloader mode as I recall.
[13:21:58] <ferdna> coooool
[13:21:59] <ferdna> thanks
[13:22:00] <ferdna> :)
[13:22:01] <Lambda_Aurigae> however,
[13:22:12] <Lambda_Aurigae> not all usb-serial adapters support the rts line.
[13:22:49] <ferdna> what does that mean?
[13:22:55] <Lambda_Aurigae> I know arduino uses that rts line for bootloader mode somehow...
[13:23:11] <Lambda_Aurigae> it means that not all usb-serial adapters will work if you use that RTS pin for something.
[13:24:05] <Lambda_Aurigae> and I would make R1 and R2 something like 220 or 330 ohms rather than 1K myself...
[13:24:42] <Lambda_Aurigae> guessing you already have the max232 chip?
[13:24:48] <ferdna> yeah
[13:24:57] <ferdna> but if there is abetter solution/chip
[13:24:59] <ferdna> i will change
[13:25:17] <Lambda_Aurigae> for onezies things, I use max233 myself,,,but TI likes me and sent a bunch of them to me as test samples a while back.
[13:25:38] <Lambda_Aurigae> no external capacitors needed on the max233 but it is like 4 or 5 times the price.
[13:25:40] <ferdna> you should send some to me :D
[13:25:52] <Lambda_Aurigae> something like 7 dollars each as I recall.
[13:26:22] <ferdna> thats expensive
[13:26:23] <Lambda_Aurigae> you might be able to get them to send you free samples...just sign up for a TI account and ask for them.
[13:26:40] <Lambda_Aurigae> yeah...the cost of the max233 is much more than a 232 with caps.
[13:26:57] <Lambda_Aurigae> but it takes up much less room overall...so it's a tradeoff consideration.
[13:27:09] <Lambda_Aurigae> less room and complexity or cheaper..
[13:27:35] <ferdna> 6.36 - 10 dllrs
[13:27:36] <ferdna> wow
[13:27:47] <ferdna> http://www.mouser.com/Search/Refine.aspx?Keyword=max233
[13:28:20] <Lambda_Aurigae> $5.68 USD at digikey.
[13:28:30] <Lambda_Aurigae> http://www.digikey.com/product-detail/en/MAX233CPP%2BG36/MAX233CPP%2BG36-ND/1091245
[13:30:14] <ferdna> well i guess thats not bad...
[13:30:23] <ferdna> however my kicad libraries dont carry that component
[13:30:38] <Lambda_Aurigae> there are other ttl level converters out there too.
[13:31:11] <Lambda_Aurigae> did I say TI earlier? I meant maxim...
[13:31:29] <Lambda_Aurigae> TI sent me pcf8574 chips as a bulk sample package.
[13:31:30] <ferdna> yup... TI... heehhehe
[13:31:42] <Lambda_Aurigae> totally different toy...but totally awesome too.
[13:31:55] <Lambda_Aurigae> i2c open collector 8bit port expander.
[13:32:16] <ferdna> http://www.logicaprogrammabile.it/wp-content/uploads/2011/03/ND_rs232.gif
[13:32:36] <Lambda_Aurigae> I use those to build i2c connected 16x2 and 16x4 LCD display units.
[13:34:39] <Lambda_Aurigae> yup...that one works too...lots fewer components.
[13:37:09] <Lambda_Aurigae> the max233 can also drive rs232 line a lot farther as I recall by adding external capacitors.
[13:39:05] <ferdna> nice!!
[13:39:08] <ferdna> thank you for the insight!
[13:39:14] <Lambda_Aurigae> welcome.
[13:39:34] <Lambda_Aurigae> watch your capacitor size and types on the max232....too big a cap can cause the thing not to run at higher speeds.
[13:39:57] <Lambda_Aurigae> too small and it won't have enough juice to push the rs232 side..
[13:40:24] <Lambda_Aurigae> I usually use 1uF electrolytic caps on the max232 and they work well but that's likely not gonna be what's suggested.
[13:40:49] <Lambda_Aurigae> hmm...datasheet says 1.0uF
[13:40:52] <Lambda_Aurigae> so,,,there ya go.
[13:41:03] <Lambda_Aurigae> unless it is a max232a
[13:41:09] <Lambda_Aurigae> then you go much lower at 0.1uF
[13:42:50] <ferdna> i am going to go with the 233...
[13:43:23] <Lambda_Aurigae> just remember those 3 loops in that schematic.
[13:43:38] <Lambda_Aurigae> pins 11 to 15, 16 to 10, and 12 to 17
[13:44:13] <Lambda_Aurigae> on a PCB, I usually run them under the chip.
[13:44:21] <ferdna> cool
[13:44:44] <Lambda_Aurigae> datasheet page 21 has the pinout and hookup.
[13:45:01] <ferdna> nice
[13:45:02] <Lambda_Aurigae> like the max232, it is a dual tx, dual rx
[13:45:13] <Lambda_Aurigae> so you can use it for 2 usart connections at the same time.
[13:46:04] <ferdna> cool
[13:46:23] <Lambda_Aurigae> or you can use rts/cts for flow control....
[13:46:58] <Lambda_Aurigae> one of these days I'll actually try to use one to generate HV reset for HVPP
[13:49:46] <ferdna> cool
[13:50:10] <Lambda_Aurigae> dunno if it will be able to sustain 12V long enough to hold the chip in programming mode.
[13:51:41] <Lambda_Aurigae> ok..time to do some worky in the real world.
[13:53:56] <ferdna> hehhe good luck... and thanks again...
[18:56:47] <ferdna> when a resistor symbol has a connection in the middle... what does it mean?
[18:56:49] <ferdna> https://cdn.sparkfun.com/assets/6/3/e/5/e/511ac8f5ce395f5846000000.png
[18:56:56] <ferdna> #2
[18:59:58] <ferdna> hahahha... that is a potentiometer
[18:59:59] <ferdna> lol
[19:00:23] <Fleck> yeah :D
[19:00:28] <Tom_itx> it's a pot
[19:00:38] <Fleck> https://www.youtube.com/watch?feature=player_embedded&v=xo8qckXgNNw
[19:02:53] <ferdna> i am just stressed... that is all..
[19:04:46] <ferdna> Fleck, why would someone do that?
[19:05:07] <ferdna> well they are russians
[19:06:00] <Fleck> anything you can imagine - will be an answer to your q. :D
[19:06:46] <ferdna> i guess
[21:37:09] <fieldman> DUDES I FINALLY GOT THAT STUFF WORKING !
[21:50:21] <ferdna> what stuff
[21:50:23] <ferdna> hahaha
[21:55:16] <ferdna> Lambda_Aurigae, what is the deal with the +G36 on that MAX233?
[21:55:24] <ferdna> do you know?
[22:02:16] <timemage> ferdna, what does +G36 mean?
[22:02:44] <ferdna> timemage, that is what i am trying to find out...
[22:02:56] <ferdna> timemage, http://www.mouser.com/Search/Refine.aspx?Keyword=MAX233CPP
[22:03:35] <timemage> ferdna, ah i see.
[22:03:36] <ferdna> MAX233CPP is 6.36 dllrs... and the MAX233CPP+G36 5.61dllrs... why is it cheaper...
[22:03:48] <timemage> ferdna, probably how it's packaged.
[22:03:55] <ferdna> and the MAX233CPP+ is obsolete now...
[22:04:05] <ferdna> so should i get the +g36 or the regular one
[22:04:16] <ferdna> since the + is obsolete now
[22:04:17] <ferdna> hmmm
[22:04:58] <timemage> also one of them is ROHS
[22:06:58] <ferdna> yeah that is the only difference i can tell
[22:07:06] <ferdna> so i would know
[22:08:28] <ferdna> wouldnt*
[22:09:43] <Casper> http://www.maximintegrated.com/en/emmi/faq.cfm <=== search g36
[22:12:22] <ferdna> Casper, thank you :)
[22:12:29] <timemage> ferdna, those 233 parts seem to have come down a lot. i have this memory of them being more like 3 times as expensive.
[22:12:56] <ferdna> timemage, i just found out about them... because of Lambda_Aurigae.
[22:15:12] <timemage> ferdna, did you check to see if ST made an internal cap part?
[22:15:55] <ferdna> no i didnt
[22:24:44] <timemage> ferdna, huh, well, i'm seeing them but instead "exar"
[22:25:02] <ferdna> got url?
[22:27:35] <timemage> ferdna, hmm, not for anything better. the exar part i think was actually more expensive than the cheaper of your two maxim options.
[22:31:37] <timemage> ferdna, are you designing something new?
[22:32:18] <ferdna> something new? i am just doing a custom pcb
[22:33:15] <timemage> ferdna, well, the 232 (or i guess 233) is sort of a classic part. it's not necessarily a good idea. just wondering if there wouldn't be a better choice.
[22:34:10] <timemage> ferdna, i mean there are parts with a shutdown feature. if you're not actually using both drivers and receivers you could get a chip with singles. you can get them that will operate past 115.2
[22:45:28] <vino> gd mrng.
[22:45:58] <ferdna> good night vino.
[22:51:13] <ferdna> timemage, can you recommend one?
[23:01:49] <ferdna> going to bed. good night.