#avr | Logs for 2014-06-26

Back
[00:18:52] <Jordan_U> Lambda_Aurigae: The project doesn't have any non-ascii characters in its path, but it is on a network drive, so a similar problem there might be the culprit. I'm on vacation so I don't know if I'll be able to walk co-workers through this over the phone, and I won't be back until monday, but I really appreciate you folllowing up. Thanks.
[00:19:56] <Jordan_U> "this" being testing with a local project path or using avrdude directly.
[02:16:29] <inflex> hrmm... can you make Eagle unsmash all parts?
[02:19:33] <malinus> N1njAway, wait, are you saying apple will die soon?
[03:53:44] <Tom_itx> inflex, not that i'm aware of
[04:05:26] <inflex> :-(
[04:05:38] <inflex> Tom_itx: the problem is that I removed the part names at some point... now I want them back
[04:05:51] <inflex> ( ie, the part has the name still, but it's not available on a layer
[05:52:05] <megal0maniac_afk> Quick C question. I'm writing code using an API, but one of the functions I need is inside a library (.c and .h pair) How do I use it in my code? Including the .h file doesn't help - is there something else I need to understand?
[05:56:56] <Lambda_Aurigae> you also need to include the .c file somewhere. The cheating way to do it is to include both the .c file and the .h file in your main .c file.
[05:57:22] <Lambda_Aurigae> the proper way is to add the .c file to your makefile and include the .h file in your main .c file.
[05:59:14] <Lambda_Aurigae> I'm finding you a simple example.
[06:00:01] <Lambda_Aurigae> http://homepage.hispeed.ch/peterfleury/uartlibrary.zip
[06:00:14] <Lambda_Aurigae> http://homepage.hispeed.ch/peterfleury/group__pfleury__uart.html
[06:00:52] <Lambda_Aurigae> there...they have a test_uart.c which is the main program and a uart.h and uart.c which is the lib...they include the uart.h in the main program and use the makefile to build and link the uart.c in.
[06:01:00] <Lambda_Aurigae> it's as simple as you can find I think.
[06:07:44] <megal0maniac> Lambda_Aurigae: Great, thank you for the pointers :) Seems that just including the .c file works. It's in a modified Netbeans, so makefiles are out (I think)
[06:07:51] <megal0maniac> I'll have to poke around a little more
[06:08:32] <megal0maniac> Also a bunch of defines that I basically just made up, because the API refers to them and the library uses them, but there's no definition anywhere in the SDK
[06:08:47] <megal0maniac> But at least now it compiles
[06:11:47] <Lambda_Aurigae> yeah...including the .c file is the old cheaters way.
[06:11:58] <Lambda_Aurigae> it works fine
[06:12:20] <Lambda_Aurigae> if you are doing a huge project and only modify one file then it has to recompile everything.
[06:12:40] <Lambda_Aurigae> with the makefile setup, it just rebuilds the modified file and relinks.
[06:14:12] <Lambda_Aurigae> for programs consisting of 20000 lines of code, recompiling everything when you make a small change can take a while..but if you break everything into little .c files that are built separately then when you recompile it goes much quicker as the make program looks at modified dates and only recompiles what has been changed.
[06:38:08] <TheArtist> hello! Is anybody good with vusb here?
[06:39:36] <TheArtist> I am trying to make this: http://www.bidouille.org/hack/nespadusb
[06:39:49] <TheArtist> i have everything connected in the breadboard
[06:40:00] <TheArtist> i am plugging the controller and windwos detects its great
[06:40:22] <TheArtist> but when i test it in the joystick control panel
[06:40:32] <TheArtist> only A button seems to work
[06:40:44] <TheArtist> and it triggers ALL 4 buttons
[06:40:46] <TheArtist> Any idea?
[07:03:18] <Lambda_Aurigae> TheArtist, I suggest you talk to the maker of that device first.
[07:04:24] <TheArtist> i'll try that out but it seems a really old post
[07:04:27] <Lambda_Aurigae> TheArtist, from the look of it, you might want to back off from the vusb side and test just the interface from the controller to the AVR...make sure everything there works.
[07:04:56] <TheArtist> ok how i test it
[07:05:01] <twnqx> wee deadbugstyle
[07:05:03] <Lambda_Aurigae> if you can get it to light up an LED for each button you press then you know it's going.
[07:05:29] <Lambda_Aurigae> you test it by playing with it...add some LEDs and some code in there before the vusb section to light LED when you press button.
[07:05:51] <TheArtist> okok i'll try that
[07:05:51] <Lambda_Aurigae> if you want me to read all the code for that project, reverse engineer it, and give you code for it along with schematic,,,it will cost,,money.
[07:06:05] <TheArtist> i don't thinks is the code
[07:06:11] <TheArtist> think*
[07:06:18] <twnqx> you read that part about fuses, right?
[07:06:25] <TheArtist> yep i set them
[07:06:26] <Lambda_Aurigae> it sounds like something in code...but you have to go back and actually test.
[07:06:41] <Lambda_Aurigae> if the fuses weren't set then the thing wouldn't talk on USB.
[07:07:02] <TheArtist> i made some hid usb test
[07:07:10] <TheArtist> to see what kind of data
[07:07:14] <TheArtist> does it send in windows
[07:07:26] <TheArtist> and it seems that it sends data aaaaaaaaall the time
[07:07:34] <TheArtist> without pressing anything
[07:07:48] <TheArtist> and when i press a it just keeps sending different data
[07:07:50] <Lambda_Aurigae> it is possible.
[07:07:58] <Lambda_Aurigae> some joysticks do that..
[07:08:06] <Lambda_Aurigae> many joysticks do that actually.
[07:08:25] <TheArtist> ok i should mention also that i do not own an original nes controller
[07:08:29] <TheArtist> but a clone
[07:08:38] <TheArtist> a TTX one
[07:08:44] <Lambda_Aurigae> ok.
[07:09:02] <Lambda_Aurigae> again,,,go back and test that the controller is actually triggering the proper events on the AVR with some LEDs.
[07:09:14] <TheArtist> i'll try that out thanks
[07:09:28] <Lambda_Aurigae> it sounds to me like the controller and avr are not talking properly...but without having the hardware to test, I have no clue.
[07:09:57] <TheArtist> i'm not that profficient in electronics
[07:10:09] <TheArtist> i get the VCC, ground and Data port
[07:10:15] <TheArtist> what are the other two?
[07:14:16] <Lambda_Aurigae> what other two?
[07:15:27] <twnqx> all three are data
[07:15:30] <twnqx> it's not just one bit
[07:15:38] <Lambda_Aurigae> you mean the interface from the controller?
[07:15:42] <TheArtist> http://www.coocox.org/driver_repo/ad4a3a34-8523-4bea-a986-b875459e15d4/doc/Arduino.files/image001.png
[07:15:43] <TheArtist> y
[07:16:10] <twnqx> think of it as synchronization for the data
[07:16:18] <twnqx> clock to tell it the next bit is ready
[07:16:30] <twnqx> strobe to signal the beginning (or end, no idea) of a data word
[07:16:35] <Lambda_Aurigae> it looks like some kind of modified spi...or maybe just a shift register.
[07:17:01] <Lambda_Aurigae> you toggle the latch to read the controller pins...then start reading data as you toggle the clock pin to read the data out of the controller shift register.
[07:17:45] <Lambda_Aurigae> http://doc.chipfind.ru/hitachi/hd14021.htm
[07:17:54] <Lambda_Aurigae> the datasheet for the shift register that is on the controller.
[07:18:13] <Lambda_Aurigae> so, I was right...
[07:18:29] <Lambda_Aurigae> toggle the latch to latch the data on the pins(buttons) into the shift register.
[07:18:40] <Lambda_Aurigae> then start reading the data pin and toggle the clock to get all 8 bits out.
[07:19:23] <TheArtist> Ok nice info :P
[07:19:31] <Lambda_Aurigae> all you gotta do is look.
[07:20:05] <Lambda_Aurigae> I got that info right from the page you posted...it has a picture of the chip which has readable writing on it...little google search found the datasheet for the chip.
[07:20:40] <Lambda_Aurigae> and it looks like you have 8 total buttons...and looking at the traces on the board, that's exactly what they did.
[07:20:46] <Lambda_Aurigae> and, I'm off to work.
[07:21:03] <TheArtist> thanks!
[08:00:18] <TheArtist> Lambda_Aurigae i got news! it IS the controller. I plug the controller's ground and VCC to the usb supply, the data output to the + of the led and the other side of the led to the ground. When i trigger the button A piezoresistor the led goes off but it does not work on any other! Here are pictures of the inside of TTX Nes controller and the test cases:
[08:00:19] <TheArtist> http://theartist.insomnia247.nl/temp/
[08:14:30] <Tom_itx> the thing about including them in the .c file is if they're not in the right order and if a function gets called it may not be visible
[09:11:12] <inflex> Tom_itx: I can right click on items and select "unsmash"
[09:12:00] <inflex> Tom_itx: can't seem to do it as a group action though