Show Posts
Pages: [1] 2
1  Using Arduino / Programming Questions / Re: Clock stretching on Wire library (as a slave)? on: January 12, 2013, 10:03:47 am
I'm testing this potential solution for my problem:

https://gitorious.org/wii-retropad-adapter/wii-retropad-adapter/commit/2f49e0964bdc2067c8f283123a9989180fb006cb

Let's see how it goes...

bootsector
2  Using Arduino / Programming Questions / Re: Clock stretching on Wire library (as a slave)? on: January 12, 2013, 09:15:44 am
Thanks! But using two uC would be my last resort only if that couldn't be done via software.
3  Using Arduino / Programming Questions / Clock stretching on Wire library (as a slave)? on: January 12, 2013, 06:05:51 am
Hi there!

I'm using the Wire library for all my I2C slave needs, and it's doing a great work! smiley

Now I need some functionality that I'm not sure Wire provides out-of-the box, so any tips on how I could implement it would be very welcome.

I have created an I2C slave device that talks to the Nintendo Wiimote (the I2C master). This is the project I'm talking about: https://gitorious.org/wii-retropad-adapter

The thing is, there's a part in the code where I need to completely disable interrupts because I'm executing a very time sensitive routine. It doesn't take too much time (I think around 350us), but it gets repeated several times a second (it's inside a loop). This is on file https://gitorious.org/wii-retropad-adapter/wii-retropad-adapter/blobs/master/src/wii-retropad-adapter/wra.cpp line #301. However, this brief interrupts disabling, several times a second, is being enough to get random garbage data sent to the I2C master.

My idea around this is to put Wire into "clock stretch" mode (as a slave, not a master) before calling GCPad_read. So my questions are:

1 - Is this a feasible thing? Any tips on modifying Wire library to allow that?

2 - Does clock strecth work with interrupts disabled?

Any help would be very welcome!

Thanks!

bootsector
4  Using Arduino / Networking, Protocols, and Devices / Re: SNES Controller as Wii Classic Controller on: July 21, 2012, 09:57:28 pm
Hi there!

The arduino-wiimote lib indeed does work. It's kinda outadated compared to its improved version used on the https://gitorious.org/wii-retropad-adapter project.

Anyways, did you manage to test the sketch from http://gitorious.org/randomstuff/arduino-wiimote/ as is by using a push button or even a piece of wire on pin 2 to GND and see if a Classic Controller digital right signal gets activated?

Edit: Your logic on checking buttons presses and setting the correspondent classic controller button variable needs some work, as you're not restoring them to LOW if buttons are not pressed:

Code:
    if (ControllerData & SNES_START) {
      Serial.print(" START");
      bp = HIGH;
    }

You could use something like: "bp = ControllerData & SNES_START;" for example.

bootsector
5  Using Arduino / Programming Questions / Re: Possible side effects from disabling Timer 0 Overflow Interrupt? on: February 05, 2012, 03:54:21 pm
Thanks for your valuable input, Nick!

I will end up using another interrupt for V-USB instead of the default INT0.

Regards,

bootsector

6  Using Arduino / Programming Questions / Re: Possible side effects from disabling Timer 0 Overflow Interrupt? on: February 05, 2012, 03:13:05 pm
Hmm...

I think I should care about it because I make use of delay() (which calls micros()) and millis() functions a lot.

The Arduino is playing as an USB adapter for classic controllers (NES, SNES, N64, GC, PS2, Sega Genesis...) and in order to correctly read controller data, I really have to rely on timing functions.

And the weird part is that everything seems to be working fine with that interrupt disabled!!!

Does that interrupt affect millis() function? I'm asking because I can see a reference to "timer0_overflow_count" only inside micros() function...

Thanks for the quick reply!

Bruno
7  Using Arduino / Programming Questions / Possible side effects from disabling Timer 0 Overflow Interrupt? on: February 05, 2012, 02:52:53 pm
Hi there!

Could someone please elaborate on the side effects of disabling Timer 0 overflow interrupt, like:

(_SFR_BYTE(TIMSK) &= ~_BV(TOIE0));

or

(_SFR_BYTE(TIMSK0) &= ~_BV(TOIE0));

The reason is that T0 overflow interrupt is not playing nice with V-USB ONLY when using it on my PS3 (it works flawlessly on PCs and Macs): PS3 keeps reseting the USB port several times until it finally recognizes the USB device being emulated by the Arduino.

I've disabled that interrups and everything seems to be working properly, but I really would like to know if there's any hidden side effect from doing that!

Thanks,

bootsector
8  Development / Suggestions for the Arduino Project / Re: Will Arduino Due support this NICE ARM microcontroller in a DIP package? on: November 10, 2011, 05:21:26 pm
@westfw:

Why do you think it's not great compared to an atmega328P, for instance? Are ARM binaries way bigger than ones generated for 8-bit atmel processors?
9  Development / Suggestions for the Arduino Project / Re: Will Arduino Due support this NICE ARM microcontroller in a DIP package? on: November 05, 2011, 06:46:04 pm
Yes, you're probably right...

Well, that's a bummer, as I think that there should be a DIP alternative for the new ARM based Arduino.
10  Development / Suggestions for the Arduino Project / Will Arduino Due support this NICE ARM microcontroller in a DIP package? on: November 05, 2011, 05:07:23 am
Hi Arduino Team!

I couldn't believe when I saw this:

http://www.nxp.com/products/microcontrollers/cortex_m0/lpc1100l/LPC1114FN28.html

An ARM uC in a DIP package!!!!  smiley-eek

Is the upcoming Arduino Due based on this family? I *REALLY* hope so! smiley

Please let us know!

Thanks!

bootsector
11  Community / Exhibition / Gallery / Wii RetroPad Adapter on: September 10, 2011, 07:35:30 am
Wii RetroPad Adapter is a Wiimote adapter based on a small PCB, an ATMega uC
and a couple of connectors that allow you to use the following classic
joysticks as if they were a Wii Classic Controller:

smiley-small Sega Genesis pad(also supports: Sega Master System, Atari 2600 and others)

smiley-small Nintendo NES pad

smiley-small Super NES pad or Playstation 2 Dualshock, depending on the extension cable
used and uC firmware.

The Wii RetroPad adapter talks to the Wiimote that, ultimately, talks to the
Wii wirelessly, so you get a real Classic Controller experience with no Game
Cube extension cables involved! smiley

This adapter is compatible with both Nintendo official games ans also homebrews
(AKA, those great emulators out there!).

If you are going to use a PS2 joystick with it, it even supports the analog
sticks!

Wii RetroPad Adapter is Opensource / Openhardware, so you can contruct your
PCB, compile the source code, burn the firmware in the micro-controller and
start using it.

https://gitorious.org/wii-retropad-adapter

Enjoy! smiley-wink

bootsector
12  Forum 2005-2010 (read only) / Development / Re: Print hex with leading zeroes on: July 18, 2010, 08:35:39 pm
np man!

Just be careful with the array limits. Maybe adding some size checks at the beginning of the function would help!

Regards,

bootsector
13  Forum 2005-2010 (read only) / Development / Re: Print hex with leading zeroes on: July 18, 2010, 07:55:33 pm
Hi there!

Thanks for the hint!

My suggestion would be doing something like:

Code:
void printHex(int num, int precision) {
      char tmp[16];
      char format[128];

      sprintf(format, "0x%%.%dX", precision);

      sprintf(tmp, format, num);
      Serial.print(tmp);
}

void loop()
{
      printHex(375, 8);
      for(;;);
}

Hope it helps!

Regards,

bootsector
14  Forum 2005-2010 (read only) / Development / NESPad - NES Controller Library for Arduino on: July 18, 2010, 03:44:41 pm
Hi folks!

Just bought an Arduino and I'm so glad I did! Bought from SparkFun, the inventor's kit, it allowed me to get introduced to Arduino and basic electronics.

I was able to interface my NES controller with Arduino and control a servo with it. I converted the pad reading code into an Arduino library.

Just uncompress it under libraries folder under you arduion installation folder and use the Arduino IDE to compile and run your code.

Check example code and readme.txt file for further instructions on usage.

Hope you like it!

http://www.mediafire.com/?xfp3xv15zpahasi

Cheers,

bootsector
15  Forum 2005-2010 (read only) / Portugues / Re: Alguém de Campinas? on: July 18, 2010, 03:49:10 pm
Que legal! Quanta gente de Campinas curtindo o Arduino! smiley

Sou de Campinas também e sou recém chegado ao mundo do Arduino. E estou fascinado. Sou iniciante em eletrônica em geral e o Arduino está me ajudando muito.

Acabei de criar minha primeira Library Arduino: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1279485881 , se for útil pra alguém! smiley-wink

[]s

bootsector
Pages: [1] 2