test1
March 30, 2017, 11:34:18 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: You can attach photos hosted by the forum rather than using an external image hosting site, this means they will stay forever and not disappear after a year or two.
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: How to "install" WaxBee converter on Arduino Pro Micro, clones or any ATmega32U4  (Read 2695 times)
Ertew
Full Member
***
Posts: 73


View Profile
« on: February 13, 2016, 10:27:44 PM »

Part 1, why I do that.

How to use Wacom tablet with serial interface?
  • Use USB->serial converter and install serial driver (easy on win XP, pain in the ass on Win7).
  • Buy Tablet-PC Wink  Win7 magically can use build-in drivers for on-board serial port.
  • Ask Wacom for dedicated converter, maybe they build one?
  • Use touch digitizer, that typically have serial input and USB output.
  • Program Teensy 2.0 with WaxBee software.
Last option looks best for me and it's the most popular option on that forum. So let's utilize community help and start soldering.

Oh no! I don't have Teensy 2.0. I need to buy one or find some substitute.

What is and what contains Teensy 2.0?
  • ATmega32U4 micro controller (uC),
  • USB connector,
  • Crystal oscillator,
  • LED,
  • Reset switch,
  • Lot of free I/O pins,
  • Some passive components (resistors, capacitors).
  • HalfKay bootloader

What contains Arduino Leonrdo, Arduino Micro, SparkFun's Pro Micro? Exactly the same, but:
  • extra voltage regulator,
  • extra LEDs,
  • some times lack of reset button,
  • different bootloader.
Every of that alternatives is more expensive, minimum 15$ each. Every except one, the chinese clone of Pro Micro.

Note the difference.
  • Original SparkFun's board is red, while clone board is blue.
  • Original Arduino have at least 2x17 pins, while clone board almost always 2x12 pins
  • Clones are a lot cheaper, 5$ or less, including free shipping from china.
Then just go to aliexpress.com and search for Arduino Pro Micro. I bought three clones for 3$ each.

But there's a trap. ATmega32U4 have only 32kB of flash.
Teensy have build-in "HalfKay" bootloader, that occupied 0.5kB. So WaxBee can utilize up to 31.5kB. The bootloader code is property of PJRC and so far nobody copy it. That's why we can't buy Teensy clones.
Arduino and other clones have different bootloader, that occupied 2 or 4kB. So WaxBee can utilize up to 28 or 30kB.
Latest build of WaxBee need more than 30kb, hence the problem.

(EDIT [bernard]: Note to the reader: a more recent version of WaxBee now adjusts the size of the build to help with this problem)

How to deal with that?
I wish to get source code of WaxBee, remove spare parts (everyone need one ADB or ISDV4 or Protocol 4 or Protocol 5, not all protocols in one adapter), compile it and get smaller size of the output file. That can be simply uploaded into Pro Micro clone.
But at these moment, that solution is too complex for me.

So there's another solution. Just say f** word to the bootloader, get any AVR ISP programmer and upload code without using bootloader.



Part 2, how to flash Pro Micro (clone) and any other compatible board with WaxBee firmware.

1. Configure WaxBee software to Your requirements.
  • Load config from template.
  • Change clock frequency to frequency that use Your board.

I have both 16Mhz and 8Mhz board. Only 16Mhz works with WaxBee hex, don't know why.

2. Generate hex file.

* 1.png (17.28 KB. 501x315 - viewed 131 times.)


3. Get programmer.
I grab UsbASP, DIY programmer that I build years ago.

* IMG_3737 - Kopia.JPG (377.46 KB. 1365x1139 - viewed 127 times.)


* IMG_3736 - Kopia.JPG (477.35 KB. 1609x859 - viewed 124 times.)

You can buy second Pro Micro board and use it as a programmer, like shows video: https://www.youtube.com/watch?v=c4k59CFpYCA
Of course You can use any different AVR programmer too. There are many of them.

4. Connect programmer to Your board. Also, connect USB to board.

* updfrm_1pro_micro_pins.jpg (122.39 KB. 774x546 - viewed 134 times.)


* IMG_3738 - Kopia.JPG (427.91 KB. 1198x1319 - viewed 130 times.)


5. Program Atmega32U4.
You need what programmer You use and have software that support programmer.
I use UsbASP that's supported by AvrDude.
For use it, You can execute command-line/terminal with special parameters, or write command-line script that make it little easy.
Yes, there are some GUI programs for that, but i like that method.

I create script named program.bat
Code:
avrdude -c usbasp -p atmega32u4 -U flash:w:%~nx1
pause
It will run only on windows, tested on XP and win7.
Explain:
avrdude - run program avrdude.exe with parameters
-c usbasp - select programmer UsbASP
-p atmega32u4 program device named atmega32u4 (there's different algorithms for different uC)
-U flash:w:filename - write filename into flash memory
%~nx1 - now I can drag'n'drop hex file into bath script and that variable contain name of file that i dropped.
pause - do not close window after finish.

For programming that way You need to have hex file, avrdude.exe and avrdude.conf in same directory that bath script

* 6.png (39.07 KB. 875x656 - viewed 133 times.)

and cross Your fingers.

* 7.png (11.77 KB. 677x342 - viewed 127 times.)

Sometimes it's fail,

* 8.png (22.33 KB. 677x534 - viewed 130 times.)

but second try always pass.

6. Check that uC works.
- You not need Wacom software and digitizer for that.
Simply try to unplug then plug again, search for WaxBee converter into device manager.
WaxBee is a HID device, so Win not need any driver for mark it as working unit.
If windows show You that there's a problem or unrecognized USB device, the uC doesn't working ok. That mesage should appear always when chose wrong clock speed. For me, it's appear for 8Mhz board, no matter what clock I select  Angry  16Mhz/5V board works well.




Extra part, just to be fair.
That's not review of my build, I'll post full relation later.

Software: Win7 64b, WacomTablet_6.1.7-3.exe from wacom.asia
Hardware: SU5E-13W01AS-01X digitizer (serial, ISDV4, silver back) integrated into HV133WX1-100 LCD and Pro Micro clone.
Firmware: Intous2, not trimmed to digitizer size yet.

« Last Edit: May 09, 2016, 08:35:38 AM by bernard » Logged

Any errors in spelling, tact or fact are transmission errors.

Hi! I'm a signature virus. Copy me into your signature to help me spread.
Aerendraca
Administrator
Hero Member
*****
Posts: 1057


View Profile
« Reply #1 on: February 15, 2016, 12:26:46 PM »

Brilliant information and so useful for those doing this conversion! Set as Sticky!
« Last Edit: February 15, 2016, 12:30:11 PM by Aerendraca » Logged
bernard
Administrator
Hero Member
*****
Posts: 2584


pato mania


View Profile
« Reply #2 on: February 23, 2016, 04:19:18 PM »

Great stuff!   Are you happy with your tablet ?


But wait, you picked an inexpensive board (3$ is a great price!) -- but then you have to buy that hardware ASP programmer -- you must have exceeded the total price of a Teensy + Shipping, no?   Grin

Lot of people is asking for a way to fit a board with the default 4K bootloader.  (4K!! Man, what a waste of space). It can be done, but is more complex -- the only way around it it to make multiple builds with various options "pre-baked".

Yeah, getting the AVR-tool chain to work (to compile the source code) is not that fun a ride.
Logged
Ertew
Full Member
***
Posts: 73


View Profile
« Reply #3 on: February 27, 2016, 01:56:22 PM »

Great stuff!   Are you happy with your tablet ?
Nope. I still not build it yet. Each part works fine, but I need to extend LVDS cable and make proper case for display unit. Build log coming soon.

But wait, you picked an inexpensive board (3$ is a great price!) -- but then you have to buy that hardware ASP programmer -- you must have exceeded the total price of a Teensy + Shipping, no?   Grin
I build my second UsbASP unit 5 years ago. Parts cost less than 5$ plus building time.
Today, You can buy UsbASP from Aliexpress for less than 1.5$ (4-weeks free shipping too).
Or You can buy second "Pro Micro" clone and program it to Ardiuno-ISP as shows video that I linked. If I have more time, I'll repeat that procedure and post step-by-step manual here.

Lot of people is asking for a way to fit a board with the default 4K bootloader.  (4K!! Man, what a waste of space). It can be done, but is more complex -- the only way around it it to make multiple builds with various options "pre-baked".
Yep, Ardiuno software is a huge waste of space and performance. Just search for "UsbAspLoader", it's a bootloader that emulates UsbASP programmer. It use software V-USB library and fit into 2kB (1.5kB of V-USB, 0.5kB of rest logic).
There are few 1kB and many 2kB bootloaders that use hardware USB, but Ardiuno write their own protocol and eat 4kB. That's just stupid.
Logged

Any errors in spelling, tact or fact are transmission errors.

Hi! I'm a signature virus. Copy me into your signature to help me spread.
XDjackieXD
Full Member
***
Posts: 122


*me trying to draw*


View Profile WWW
« Reply #4 on: February 27, 2016, 02:02:49 PM »

Lot of people is asking for a way to fit a board with the default 4K bootloader.  (4K!! Man, what a waste of space). It can be done, but is more complex -- the only way around it it to make multiple builds with various options "pre-baked".
Yep, Ardiuno software is a huge waste of space and performance. Just search for "UsbAspLoader", it's a bootloader that emulates UsbASP programmer. It use software V-USB library and fit into 2kB (1.5kB of V-USB, 0.5kB of rest logic).
There are few 1kB and many 2kB bootloaders that use hardware USB, but Ardiuno write their own protocol and eat 4kB. That's just stupid.
The USBasp bootloader is really cool. I built myself two of this: http://eleccelerator.com/usnoobie/ and it is a really great & inexpensive development platform (I use vim, avr-gcc and avrdude for development ^^)
Logged
ben8763
New Poster
*
Posts: 13


View Profile
« Reply #5 on: May 03, 2016, 11:44:17 PM »

Wasn't sure where to post this but I'll take a punt here.

Anyone know if this works on Windows 10? My board is displaying as an HID Compliant Digitizer in the device manager, I have soldered it up to the tablet yet just wanted to make sure I wasn't wasting my time.
Logged
Ertew
Full Member
***
Posts: 73


View Profile
« Reply #6 on: May 04, 2016, 06:43:05 PM »

Wasn't sure where to post this but I'll take a punt here. [...]
If You use Teensy 2.0 board, this is wrong topic. If You have another board like Pro Micro or clone, this eventually might be the right topic.



There are three problems with communication between devices:
  • digitizer -> ATmega32U4 microcontroller
  • ATmega32U4 -> OS
  • Wacom tablet (emulated by ATmega32U4) -> drivers installed on OS

[...] My board is displaying as an HID Compliant Digitizer in the device manager,[...]
So you know that ATmega32U4 working and communicating with OS (second point). This point works with any computer and any modern OS, because HID device will be recognized without drivers.
Now You need to install drivers for Your tablet (third point).
You can check compatibility between digitizer and microcontroller (first point) only if second and third point pass.

Looks simply? Sorry, this might not be so simply. Just because You have W10.
Win7 drivers works without problems with Intuos2 templates (You can found a lot of them).
W10 drivers doesn't work with Intuos2. ATmega32U4 need to emulate Intuos5. Because of that, You may need to change a lot inside templates.


So, the best option for start is to find/borrow a computer with Win7, install universal drivers (I'm using WacomTablet_6.1.7-3.exe from wacom.asia) and test everything. After that, move to Intuos5 templates and keep trying until success.
Logged

Any errors in spelling, tact or fact are transmission errors.

Hi! I'm a signature virus. Copy me into your signature to help me spread.
bernard
Administrator
Hero Member
*****
Posts: 2584


pato mania


View Profile
« Reply #7 on: May 09, 2016, 08:29:27 AM »

Okay, I have a new version of WaxBee (0.16) that uses "build variants" to reduce the size of the .hex file. In other words, I compiled like 8 versions with various features turned ON and OFF. (like you'll can't interface an ADB board and a serial board at the same time), or you'll never going to see any of the "Debug" messages when the console is disabled. That sort of thing. So the WaxBeeConfig automatically "picks" the right one depending on the selected feature. I could tweak this more, but most of the typical scenario should fit under 28K (i.e. using the AVR stock 4K bootloader).

I ordered a couple of Pro Micro "clones" to test them out. They were more like 4$+0.50 shipping, but still the cheapest board for this CPU. I ordered 2 because I am always affraid I get a broken one. The Teensy 2.0 is now at 16$US + shipping. I was looking to see if we could use the Teensy LC (very powerful CPU at 11.65$+shipping) but it is not 5v tolerant and would thus only work for the ISDV4 case -- given it is a completely different architecture, this will take me more than a weekend for sure.

I am happy with my WaxBee release - hopefully I did not introduce any regressions.  Tongue


* waxbee016.gif (23.72 KB. 449x311 - viewed 97 times.)


Logged
DD
New Poster
*
Posts: 6


View Profile
« Reply #8 on: May 09, 2016, 09:04:53 AM »

Whoa, with the smaller file, it seems the faked Teensy is working Shocked. It properly shows as "XD-1212-U - WaxBee emulation" in OS X system profiler and the Wacom driver (6.2.0w4) also recognises it.  Grin
Logged
Aerendraca
Administrator
Hero Member
*****
Posts: 1057


View Profile
« Reply #9 on: May 10, 2016, 07:04:29 AM »

Nice work Bernard! Credit where its due.
Logged
Pesho
Sr. Member
****
Posts: 253



View Profile
« Reply #10 on: May 10, 2016, 08:50:50 PM »

bernard, you are the man! Shocked

The ISDv4 template works beautifully on my Teensy clones now! So they really do have some bootleg-bootloader in there that's larger than PJRC's, making them not work. I was very happy to finally get a digitizer working with serial on Linux, but now this means that it's going to work on Windows as well. Thanks a bunch for this update!
Logged
bernard
Administrator
Hero Member
*****
Posts: 2584


pato mania


View Profile
« Reply #11 on: May 11, 2016, 04:19:25 AM »

Good to know it works for you. Smiley The smallest bootloader for this CPU that I know of is 1.5K (or maybe that was 1K) -- some are 2K, and the rest is 4K (like the stock one). Nothing coming close to Teensy's bootloader at 0.5K. Paul is great at optimizing stuff.
Logged
bernard
Administrator
Hero Member
*****
Posts: 2584


pato mania


View Profile
« Reply #12 on: July 13, 2016, 01:02:15 AM »

FYI: Just got the ProMicro boards (took a little over 2 months to arrive). I'll check them out when I can.
Logged
LTN121t
New Poster
*
Posts: 11


View Profile
« Reply #13 on: September 27, 2016, 10:00:27 AM »

But Pro Micro 16MHz is 5V, and Wacom TTL tablets use 3.3V. Am I missing something? or do i need a separate 3.3v power supply?

Also, since bernard has changed the Waxbee software to fit on other places, does that mean I don't need a USBasp device to upload the sketch?
I don't know how to upload the 'waxbee' software to the pro micro at all, except using USBasp as mentioned above, but that seems rather easy to screw up for an inexperienced person
« Last Edit: September 27, 2016, 10:19:56 AM by LTN121t » Logged
Pesho
Sr. Member
****
Posts: 253



View Profile
« Reply #14 on: September 27, 2016, 11:04:22 AM »

Pro Micros should have a 3.3V version in addition to the 5V one. Teensies are normally 5V, so you need to convert them to 3.3V by adding a voltage regulator on the back. Now that they work, generic chinese Teensy 2.0 clones are probably a better option since they're now cheaper than Adafruit's Pro Micros.

You might be able to use waxbee with the default bootloader on pro micros now that it's smaller. That would mean no need to do the USBasp part, but i haven't tried it myself to confirm.
Logged
Pages: [1] 2
  Print  
 
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!