The Arduino platform is (for better or worse) a widespread, well-known, and overused way for beginners to get into microcontrollers and smart electronics. For this reason and others, I chose it as the core of the original gCn Bridge design. For about $30, you get a reusable microcontroller board, USB-serial interface, and more. However, I've heard plenty of noise from the community that $30 is a bit steep for some of your budgets, and I personally have thought that I don't want my Arduino board to be forever stuck being a gCn bridge, since it's meant to be a bit more reusable. Therefore, I've been designing a so-called "$10 bridge" centered around a raw AVR bitbanging USB HID thanks to the V-USB drivers (or more specifically, V-USB for Arduino). Sadly, I have not yet succeeded getting the USB bitbanging up and running, although I have been able to successfully run the gCn Bridge calculator-AVR code and seen its successful results via debugging LEDs. I have been posting some updates on a Facebook status of mine and getting feedback from the inimitable Ben Ryves; I'll be switching to this topic now. A preliminary parts list:

(1) Atmega328p with Arduino bootloader (needs to be programmed, though, so you at least need access to someone else's Arduino just to program it) [$5.50]
(1) 16MHz crystal oscillator [$1.25]
(2) 22pF crystal loading capacitors [$0.25 each = $0.50]
(4) 330 ohm resistors [$0.10 each = $0.40]
(1) standard LED [$0.20]
(1) RGB LED [$1]
(1) 2.2K ohm resistor [$0.10 each = $0.10]
(1) 4.7K ohm resistor [$0.10 each = $0.10]
(2) 68 ohm resistors [$0.10 each = $0.20]
(1) pushbutton [$0.45]
(2) 3.6V Zener diodes [$0.10 each = $0.20]

Total cost: $9.90
This doesn't include breadboard, USB socket (or cord cut apart), PCB, solder, or IC socket for the Atmega.

And to finish off, a picture of my currently very messy breadboard as I've been trying a few ugly hacks for your curiosity and mockery:

I thought the aim of this was to avoid the Arduino and so presumed you were using the regular V-USB library. Have you tried using that instead rather than the alpha-status "V-USB for Arduino" package?
Kerm, if you plan on distributing it, even to just a few people...

make sure you enclose the circuitry in some form of outer shell or protective casing.
benryves wrote:
I thought the aim of this was to avoid the Arduino and so presumed you were using the regular V-USB library. Have you tried using that instead rather than the alpha-status "V-USB for Arduino" package?
That's the next step of my experimentation. I finally am using smaller diodes and real 68-ohm resistors, but no dice, so I'll be loading up one of the real V-USB examples soon, assuming that the avr compilation suite that the Arduino stuff included works well enough for it. And ACagliano, the real version would be on a perfboard at least; of course I wouldn't send people a breadboard. Very Happy
It should be, but if not I use WinAVR. I'm not sure if you need to do anything special if targeting a chip that has a bootloader - the bootloader usually resides at the end of memory in a protected region, so I guess avrdude will just fail when it attempts to read back data if your program is too long (you can successfully compile programs that use >100% of the chip's memory).
benryves wrote:
It should be, but if not I use WinAVR. I'm not sure if you need to do anything special if targeting a chip that has a bootloader - the bootloader usually resides at the end of memory in a protected region, so I guess avrdude will just fail when it attempts to read back data if your program is too long (you can successfully compile programs that use >100% of the chip's memory).
Impressive, I never knew that. Very Happy The Arduino bootloader is 2KB, so as long as I stay under 30.6KB or so, I think I'll be ok.

Edit: HUZZAH! In the end I think the problem was that I was using the wrong pins on the AVR (I'm not 100% positive because I changed quite a few things between my last two test runs), and now my AVR is making my Linux computer's mouse cursor go in circles! And my laptop's! And now my desktop's!
Huzzah indeed! Smile I'm glad to see it's working nicely.
benryves wrote:
Huzzah indeed! Smile I'm glad to see it's working nicely.
Thanks Ben. Smile I loaded up the Arduino-based version of the drivers in a build of my CALCnet stuff (using the Arduino things because I can basically #ifdef each of my Serial.read(), Serial.write(), and Serial.available() calls to Usbstream.write(), read(), available() plus additional considerations for the fact that the USB ring buffer is 8 bytes instead of Serial's 128 bytes). Thus far, it's definitely identifying as a UsbStream device, and it's also talking CALCnet properly. I need to drop a reader on the PC end now and see if anything intelligible is coming through.

Edit: So, I figured I would post this as a PSA to people who use a MinGW-based system like Dev-C++ with the V-USB package. IF you get something like this when you link:


Code:
undefined reference to 'HidD_GetHidGuid@4'
undefined reference to 'HidD_GetAttributes@8 '
undefined reference to 'HidD_GetManufacturer String@12'
undefined reference to 'HidD_GetProductStrin g@12'
undefined reference to 'HidD_SetFeature@12'
undefined reference to 'HidD_GetFeature@12'
You can solve it by getting a later version of lib/libhid.a and the associated include/hidsdi.h. You must get them both together! I pulled the two files from a QT SDK, but downloading a 332MB installer to get a pair of 30KB files is somewhat insane. For what it's worth, I got the idea that this was the direction I needed to pursue from this topic on the V-USB fora.
I remember once seeing an instructable showing how you can make a super-super barebones arduino, by simply hooking up a crystal, powering, and a few other things. You program it with the board, take it out, use it. If you get ones with the bootloader installed already it's even easier (and they only cost $5 too)
willrandship wrote:
I remember once seeing an instructable showing how you can make a super-super barebones arduino, by simply hooking up a crystal, powering, and a few other things. You program it with the board, take it out, use it. If you get ones with the bootloader installed already it's even easier (and they only cost $5 too)
If you read the parts list earlier in this thread, you'll see that I already quoted the Atmega328p pre-loaded with the Arduino bootloader, which is $5.50 at Sparkfun. What I've created is basically what you already described, which I described above. The only complication is USB, since I don't have the liberty of a serial-USB IC in this case.

Progress-wise, thanks to Ben's help, I know can connect and receive data from a device that identifies itself by product='gCnBridge', vender='Cemetech.net'. Plenty of bugs and glitches, of course, but progress soon, I hope, then direct USB so Sonlen has something to test.
Hmm...the FTDI chip, right? the original and many third party arduinos didn't have them either.

so basically you need a cheap version of this http://www.sparkfun.com/products/9717

Cant find any myself, they cost more from the "official" FTDI site.

Wait: http://letsmakerobots.com/node/23728
willrandship wrote:
Hmm...the FTDI chip, right? the original and many third party arduinos didn't have them either.

so basically you need a cheap version of this http://www.sparkfun.com/products/9717

Cant find any myself, they cost more from the "official" FTDI site.
No, that's the point, I'm bitbanging USB from the AVR itself, which means I just need the raw AVR plus clock, leveling, and power components. I'll post a photo of the board later. Everything's working well; I'm even managing to read some Cn2.2 data over USB, although nothing resembling full functionality yet.

Edit: Yes, that would work fine, but it would raise the cost above $10. I'm looking to make this fully serial-agnostic.
Ah. That would be harder Razz technically though your code is written for a serial port.
willrandship wrote:
Ah. That would be harder Razz technically though your code is written for a serial port.
Right, but as I said, I already modified it to talk through either a serial port or USB descriptor, and I'm working on refining and debugging it now. Smile The last step will be to also add direct USB to TI-84+/SE calculators.
I had a thought...what about having the 84+ be the bridge, and cut the duino?

or is that what you meant? Razz not sure.
willrandship wrote:
I had a thought...what about having the 84+ be the bridge, and cut the duino?

or is that what you meant? Razz not sure.
Here's the current plan, since you haven't been around on IRC and HCWP to hear about it. Smile

[1] Arduino/FTDI/Serial <-> I/O bridge: more or less complete other than some fleeting TI-84+ timing glitches
[2] Raw AVR <-> I/O bridge: prototype breadboarded hardware complete, software and firmware in construction, soldered PCB to come
[3] TI-84+/SE direct USB <-> PC bridge: To connect one calculator to globalCALCnet; planned and discussed with BrandonW, Merth, et alia. Merth is prototyping PC-side software. I'm worrying about how to fit the changes into 200 bytes in DCS
[4] TI-84+/SE direct USB <-> PC hub: To connect a bunch of calculators (EXCEPT the bridge calculator itself) to globalCALCnet; planned for the farther future.
Sounds like a plan. It really is an amazing project. You could totally sell this to TI Razz they have stuff like this for the nspire that's wireless. (CalcNet, not GcN) but requires a wifi cradle.
willrandship wrote:
Sounds like a plan. It really is an amazing project. You could totally sell this to TI Razz they have stuff like this for the nspire that's wireless. (CalcNet, not GcN) but requires a wifi cradle.
Thanks, I appreciate it. Smile I soldered up a board for the "$10 bridge" tonight, but no luck getting it to work yet; I still have debugging to do.

Edit: Wait, I just plugged it in after I posted, and it successfully connected as a gCnBridge! Huzzah!
Awesome!
souvik1997 wrote:
Awesome!
Thanks. Smile I'll post a photo as soon as I get a connector for a Cn2.2 hub soldered onto it. Just to clarify, the software and firmware side of it is unfortunately still up in the air.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 3
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement