Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up --- Bug Reports --- Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: DIY LED-Wiz Clone - "LWCloneU2" - based on AVR ATMega32U2  (Read 13190 times)

0 Members and 1 Guest are viewing this topic.

philip88

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:October 19, 2014, 12:50:12 pm
  • I want to build my own arcade controls!
DIY LED-Wiz Clone - "LWCloneU2" - based on AVR ATMega32U2
« on: June 15, 2013, 02:00:00 pm »
Hi,

please find attached the schematics / layout files / sourcecode in order to build your own LED-Wiz Clone named "LWCloneU2".
It is based on the microcontroller ATMega32U2 and fully compatible with the original LED-Wiz  (tested with the Mala plugin and LED-Blinky Application).
With some modification it is also possible to create a composite USB device that includes keyboard / joystick controller etc.

Also included is a replica of the "ledwiz.dll" that should be fully compatible with the existing one (tested with the test app of LED-Blinky), but does not have some bugs that I discovered while testing it with my USB device.
A 64 bit version is provided, too.

More detailed information is given in the readme file.

« Last Edit: June 15, 2013, 02:06:11 pm by philip88 »

Nephasth

  • Guest
  • Trade Count: (0)
Re: DIY LED-Wiz Clone - "LWCloneU2" - based on AVR ATMega32U2
« Reply #1 on: June 15, 2013, 06:54:41 pm »
What was your parts cost?

philip88

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:October 19, 2014, 12:50:12 pm
  • I want to build my own arcade controls!
Re: DIY LED-Wiz Clone - "LWCloneU2" - based on AVR ATMega32U2
« Reply #2 on: June 16, 2013, 02:17:25 pm »
The uC (2,5 EUR) and the PCB for the breakout board (3,2 EUR) were the most expensive parts.
Then some more for the crystal, the connector and the other small parts like resistors etc.
In total I guess about 9 EUR.

Recently I ordered an Arduino Leonardo for 15 $ (still waiting for arrival) that uses a ATMega32u4 and should work with very little modifications to the firmware.
The teensy board should be fine, too.

ids

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 720
  • Last login:June 28, 2019, 01:08:16 pm
  • Fighter Captured
Re: DIY LED-Wiz Clone - "LWCloneU2" - based on AVR ATMega32U2
« Reply #3 on: June 21, 2013, 03:44:15 pm »
Very cool.  I have a few Minimus AVR 32 boards looking for a reason to exist, and now I think they've found it.

 :applaud:

I'd be curious to see just how many LED's one could drive with the addition of something like a set of serial shift registers.  With a bit more coding, the PWM could probably be maintained to a half decent level as well.

Thanks for this.

spoot

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 688
  • Last login:June 15, 2015, 10:36:18 am
  • Destroyer of electronics
Re: DIY LED-Wiz Clone - "LWCloneU2" - based on AVR ATMega32U2
« Reply #4 on: June 21, 2013, 04:10:48 pm »
Interesting!  I'll have to look further into this as pretty sure I'm gunna use up all the outputs on my current ledwiz......and I'm getting back into toying with electronics.

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7949
  • Last login:Today at 05:46:14 am
  • Designated spam hunter
Re: DIY LED-Wiz Clone - "LWCloneU2" - based on AVR ATMega32U2
« Reply #5 on: June 22, 2013, 01:06:52 am »
Do you think this could be combined with the KADE firmware to make a skee-ball controller/encoder?

Skeeball would use:
8 playfield switch inputs - 10, 20, 30, 40, 50, 100, 100, gutter
7 playfield "target" lights - all of the above, except for gutter
3 admin buttons - up, down, select

I think that leaves 2 pins (on the Minimus AVR) for lighting the admin buttons, etc.

If you need to free up 4 or 5 more pins, you could use HWB for "shifted" inputs.   :dunno


Scott

Nightbring3r

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 28
  • Last login:February 28, 2019, 01:52:44 am
Re: DIY LED-Wiz Clone - "LWCloneU2" - based on AVR ATMega32U2
« Reply #6 on: June 22, 2013, 02:38:58 pm »
This is pretty cool! How are you licensing the source code?

philip88

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:October 19, 2014, 12:50:12 pm
  • I want to build my own arcade controls!
Re: DIY LED-Wiz Clone - "LWCloneU2" - based on AVR ATMega32U2
« Reply #7 on: June 24, 2013, 03:19:08 pm »
Quote
Do you think this could be combined with the KADE firmware to make a skee-ball controller/encoder?
I don't see a stopper to add this to the KADE framework. At least as a selectable firmware it should be easy.
For my own cabinet, I made a composite device (2 Joysticks, 1 Keyboard, 1 Media Device, 1 LED-Wiz), based on the sources of the "AVR Atmega V-USB Mame Arcade Panel Controller" and the LWCloneU2 and run into problems with the original 'ledwiz.dll' and therefor created my own 'ledwiz.dll'. I don't know in detail about the KADE encoder(s) and how to combine it with LWCloneU2 but I think it should be possible to create a "skee-ball controller/encoder".

Quote
How are you licensing the source code?
All sourcecode and provided schematics that is created by me (*) is free, i.e. anyone can use it for whatever purpose.
The uC firmware is based on the LUFA framework, that states on the homepage:
"LUFA is free to use - even for commerical purposes, subject to the MIT license restrictions (see project documentation)"

(*) some sourcecode is derived work and so not fully covered by my *free* copyright.
In the provided *.zip file, this applies to the folowing files:
\win32\driver\include\ledwiz.h   (this is a modified version of the interface header from the official LED-Wiz SDK)
\firmware\* (all files in this folder are based on an example of the LUFA framework concerning the USB stuff. The LED control is from me)

claesbert

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 3
  • Last login:March 01, 2017, 12:21:53 pm
  • I want to build my own arcade controls!
Re: DIY LED-Wiz Clone - "LWCloneU2" - based on AVR ATMega32U2
« Reply #8 on: October 11, 2013, 04:55:22 am »
Hi philip88, did you have any luck porting your code to the arduino?

shiori1425

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:March 25, 2015, 11:56:35 am
  • R-Cade #1 in progress
Re: DIY LED-Wiz Clone - "LWCloneU2" - based on AVR ATMega32U2
« Reply #9 on: October 11, 2013, 10:06:31 am »
I haven't gone through the code yet but am curious, how does this interface to something like LEDBlinky?  Can I modify this to use a higher pin count, like my ATXMEGA128 or the AT32UC3[121 I/O] MCs , without changing the USB interface much?

I am thinking about one device for all the lighting in my 4 player panel.
« Last Edit: October 11, 2013, 10:13:44 am by shiori1425 »

Janna_142

  • Trade Count: (0)
  • Newbie
  • *
  • Offline Offline
  • Posts: 1
  • Last login:March 08, 2014, 04:33:00 am
  • I want to build my own arcade controls!
Re: DIY LED-Wiz Clone - "LWCloneU2" - based on AVR ATMega32U2
« Reply #10 on: October 12, 2013, 08:07:55 am »
I agree with you.

philip88

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:October 19, 2014, 12:50:12 pm
  • I want to build my own arcade controls!
Re: DIY LED-Wiz Clone - "LWCloneU2" - based on AVR ATMega32U2
« Reply #11 on: October 25, 2013, 03:58:44 am »
Please find below the firmware update for the Arduino Leonardo.
In the default configuration it allows to use all available pins for driving LEDs or Bulbs, i.e. 20 general purpose pins + 2 TX/RX pins + 3 prog pins.
On my sample "shield" I only use 8 pins conntected to transistors for driving 12V/100mA bulbs.

Since the device is compatible to the LED-WIZ on the USB protocol level, it works with LEDblinky.
And because of this there is a limit of 32 pins per device.

shiori1425

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:March 25, 2015, 11:56:35 am
  • R-Cade #1 in progress
Re: DIY LED-Wiz Clone - "LWCloneU2" - based on AVR ATMega32U2
« Reply #12 on: October 25, 2013, 09:45:28 am »
Well crap.  Guess that rules out one LED board for a 4 man RGB lighting rig.  I may still use the usb interface/data packing scheme to make my own.  Still looking into the LUFA USB stuff. Looks like I'll hit the hard cap on USB data width unless I change how the lighting codes are packed into the bytes being sent.

I will report if I figure any of this out.

michsebins

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:February 28, 2015, 01:26:09 pm
  • I want to build my own arcade controls!
Re: DIY LED-Wiz Clone - "LWCloneU2" - based on AVR ATMega32U2
« Reply #13 on: November 05, 2013, 08:30:45 am »
Hi, first of all big THX for sharing your Project Code and Files really appreciate this.
Iīm very new to the microcontroller area and own an arduino Mega2560 with a ATMega16u2 and Mega2560 Chips sitting on it.
Do you think your code is easy extendable for interacting between the the 16u2 and the mega2560 Chip for me as an beginner :)
A friend of mine (with some knowledge in TCL and Linux Scripting) helped me out with compiling your code with some little changes for the 16u2 instead of the 32u4 you are using and that worked great.
Now i hope there is a way to get the outputīs working by interacting of the two chips.
Would be great if you or someone else could help and give me a hint how to realize that.
I think this could be interesting for some other Arduino users as well as there are more Arduino or compatible Boards out that have 2 Microcontrollers sittin on it e.g. the Arduino Uno with an 16u2 and an mega328.
If it will be not possible to realize then i have to look for an leonardo ;)

thx for your help

philip88

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:October 19, 2014, 12:50:12 pm
  • I want to build my own arcade controls!
Re: DIY LED-Wiz Clone - "LWCloneU2" - based on AVR ATMega32U2
« Reply #14 on: November 05, 2013, 05:17:23 pm »
Hi michsebins,

> Do you think your code is easy extendable for interacting between the the 16u2 and the mega2560 Chip for me as an beginner

I think it is easy extendable but it might be a bigger task to get it to work since you have to write *two* programs (with potential bugs) that do communicate with each other.
Anyway, there is a place in the code where 8 bytes are received from the PC via USB and then some action is triggered depending on the data.
Here I would add two "sync" bytes (with some fixed 'magic' value) and transmit the 10 bytes over the serial connection to the Mega2560. There you receive the data, skip the bytes until the sync bytes match and then process the 8 bytes in the same way as it was done before.
Uploading the firmwares to both chips might be a bit complicated since you first need the original Arduino firmware for the Mega16u2 in order to program the Mega2560 and then reprogram the Mega16u2 with the LedWiz firmware.

michsebins

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:February 28, 2015, 01:26:09 pm
  • I want to build my own arcade controls!
Re: DIY LED-Wiz Clone - "LWCloneU2" - based on AVR ATMega32U2
« Reply #15 on: November 06, 2013, 06:38:26 am »
thx for your quick answer and tips.
I will try to get deeper into the whole thing and find out if i can handle this challenge. As i said iīm very new to the arduino or microcontroller side so i have to learn a lot and for now itīs a step to high for me.
The other thing is that english is not my native language and a lot of guides and tutorials are hard to understand for me. But hey itīs all new for me and i have fun in trying to learn that so everything is great ^^
The firmware uploadīs seem to be no problem as i tried something like "Arduino-Big-Joy" which also needs to first program the 2560 and the flash the 16u2. And when you want to change code on the 2560 you have to flash the orig firmware first but that worked.
Anyway great project that youīve done and iīm considering to buy a leonardo or derivate so i can easily use your code and study the stuff more and perhaps somewhen in the future i can port it to the mega.
One last question from here when you use your code on the leonardo can you only use the 7 analog outputs for pwm signals to receive (e.g. for RGB LEDs) or is there something like softPWM in there that let you use RGB Leds also on digital outputs (sorry that i have to ask but i tried to find out myself but canīt figure it out yet)

thx again for all

philip88

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:October 19, 2014, 12:50:12 pm
  • I want to build my own arcade controls!
Re: DIY LED-Wiz Clone - "LWCloneU2" - based on AVR ATMega32U2
« Reply #16 on: November 06, 2013, 04:36:24 pm »
Quote
One last question from here when you use your code on the leonardo can you only use the 7 analog outputs for pwm signals to receive (e.g. for RGB LEDs) or is there something like softPWM in there
Yes it uses a quick and dirty software PWM implementation for all available pins (like the second approach, given here: http://www.mikrocontroller.net/articles/Soft-PWM).