Author Topic: Talking to Digispark from DOS  (Read 5394 times)

barbudor

  • Newbie
  • *
  • Posts: 9
Talking to Digispark from DOS
« on: December 05, 2013, 11:47:34 am »
Hi guys

I need a solution for basic output on a PC running DOS !
Yes, goo'ol'DOS (can be 5.0 or 6.22) but no Windows....

At least, being able to send a basic ON/OFF order is enough.

I believe I shalluse the Spark with a HID mode and find a suitable driver.
Then makes a bit of TurboC to call some interrupt to send messages to the driver

The easiest would be that the Spark can act as a serial (CDC) interface so I could just "echo >COMx:" commands
But if I am correct, it is not possible to implement CDC.

Any idea ?

Thanks

Barbudor

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: Talking to Digispark from DOS
« Reply #1 on: December 06, 2013, 12:06:36 am »
Luckily the days are over, that I had to keep some old dos-machines up and running.  In some cases people spent a huge amount of money, for resuscitation of very specific old hardware, to keep some business critical applications up and running.

There was no problem to connect CD-Roms drives via USBASPI.SYS and the specific cdrom-driver.  However that will not work for the digispark.
But there were as well some USB-keyboards, which included drivers for the config.sys.  Some PC-Bios also had the possibility to detect a USB keyboard and to pass that as native keyboard to MS/PC/DR-DOS.

I would recommend you to look at the free-dos project (http://www.freedos.org/)  or to one of those two sites: http://bretjohnson.us/, http://www.georgpotthast.de/usb/

regards

  gogol

barbudor

  • Newbie
  • *
  • Posts: 9
Re: Talking to Digispark from DOS
« Reply #2 on: December 06, 2013, 07:16:46 am »
Hi Gogol

So if I setup the 'spark as a HID Keyboard, and if the BIOS support USB emulation, is should be able to talk to it from TurboC using INT21 or similar ?

If BIOS does not support emulation, I need to find a driver which would do the same?

Will look at your links

Thanks

Barbudor

sparkyichi

  • Newbie
  • *
  • Posts: 11
Re: Talking to Digispark from DOS
« Reply #3 on: December 12, 2013, 08:39:17 am »
Can't you get a USB to SERIAL? DOS can address serial without issues.

dougal

  • Sr. Member
  • ****
  • Posts: 289
Re: Talking to Digispark from DOS
« Reply #4 on: December 12, 2013, 09:14:48 am »
Hmm, from some preliminary Googling, it does appear that USB keyboards will accept data from the PC side for things like the LED status lights (caps lock, num lock, scroll lock). So it should at least be _theoretically_ possible... But I have no idea how you would go about it. I'm not even sure if the DigiKeyboard library supports that currently (anyone?).

These links may or may not be of use:
  http://www.lvr.com/forum/index.php?topic=1117.0
  http://www.winvistatips.com/sending-private-data-usb-hid-keyboard-t191500.html
  http://www.winvistatips.com/my-hid-mouse-write-data-my-hid-mouse-form-win32-ap-t179156.html

Edit: This might also be very useful:
  http://codeandlife.com/2012/06/18/usb-hid-keyboard-with-v-usb/
« Last Edit: December 12, 2013, 09:23:53 am by dougal »

barbudor

  • Newbie
  • *
  • Posts: 9
Re: Talking to Digispark from DOS
« Reply #5 on: December 12, 2013, 11:55:10 am »
@gogol : started to look at your link, Georg Potthast's DOSUSB looks promising but not free.
I spend a few hours last week-end to install DOS 6.22 into a VMWare machine to get DOSUSB to crash on startup ... I have to setup DOS on a USB key the next week-end to try it natively.

@sparkyichi : DOS does not recognize USB Serial (CDC) naturaly. A driver set like DOSUSB (as above) is needed
However V-USB stack is only USB 1.1 and can't act as a CDC which requires USB 2.0
We must stick with HID based device

@dougal : That's what I am looking into. Driving leds should be enough as a way of communication for what I want to achieve. But apparently the DigiKeyboard library does not (yet) support this (was asked by another member on another topic of the same forum).

Will go through your links

Thanks

sparkyichi

  • Newbie
  • *
  • Posts: 11
Re: Talking to Digispark from DOS
« Reply #6 on: December 13, 2013, 10:36:19 am »
My point was to instead use a USB to serial cable. No driver needed, but you would need to use a DOS serial communication program. I think ProCom was an example of such software.

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: Talking to Digispark from DOS
« Reply #7 on: December 13, 2013, 01:40:42 pm »
Exactly that is not working. Of course, you need drivers for this kind of cable, as  barbudor already answered.
The problem is, that DOS was already dead, when USB came out, and most USB stuff worked only as windows driver on top of DOS.

One solution could be, to use a MAX232A cable, which translates +-12V RS232 to 5V TTL UART.
Than use plain serial communication.