Sponsored links

Go Back   MP3Car.com > Mp3Car Technical > Input Devices


Reply
 
Share Thread Tools Display Modes
Old 11-17-2007, 05:40 PM   #136
Newbie
 
Join Date: Nov 2007
Posts: 3
CrazyIvan is an unknown quantity at this point
There's a nice little PC USB writeup with some decent sample code here:

http://www.alanmacek.com/usb/

That sucks that the host has to tell the controller to start sending chatpad keys. If that bit could be figured out (captured) it could be sent from the PC to a connected controller to hopefully activate it on Windows. Would a new PID device then show up or would keys start showing up in windows via the controller HID device? If the activation sequence could be captured on an xbox maybe the sample code could be used to send it to the controller from a PC...

The vid/pid for the xbox360 controller is 45e/719:

CrazyIvan is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Old 11-19-2007, 06:59 PM   #137
Newbie
 
ioi8's Avatar
 
Join Date: Apr 2006
Location: Cleveland
Posts: 27
ioi8 is on a distinguished road
Uart wires and speeds

Ok, i took a digital oscilloscope to the uart leads of the controller. This is what i have found out.

Looking at the controller normally, the leads go from left to right as:

Ground, Recieve (Rx), Transmit (Tx), Vpp (3V)

Now, my oscilloscope could not tell if this was 3.3V uart or 5v uart, but im guessing the 3.3 version because the power source is 3v. Anyone care to comment on the voltage levels of the signals?

Also, the baud rate of the uart is 120 buad. This is really slow, but i guess it doesnt need to be any faster.

The controller polls for external ascessories with the command 0x8C. Once there is a return signal, the controller holds the Tx line high.

So to activate the keyboard, you need to send the signal of 0x8C at 120 buad serially to the keyboard's Rx line. Once that occurs, im sure the keyboard will start spitting out characters. However, i dont have a chatpad, so i cant be too certain.
ioi8 is offline   Reply With Quote
Old 11-19-2007, 08:09 PM   #138
Low Bitrate
 
wmpwi's Avatar
 
Join Date: Sep 2007
Location: Western Michigan
Posts: 74
wmpwi is an unknown quantity at this point
This is kind of exciting. Watching a hacking project in real time.
__________________
A computer lets you make more mistakes faster than any invention in human history
- with the possible exceptions of handguns and tequila.
wmpwi is offline   Reply With Quote
Old 11-20-2007, 12:32 AM   #139
Constant Bitrate
 
thermoptic's Avatar
 
Join Date: Aug 2007
Posts: 116
thermoptic is an unknown quantity at this point
Quote: Originally Posted by c0nsumer View Post
Nice work. I'm glad to see someone else actually digging into things. It's convenient that the work I'm doing right now (not on this project) just happens to be a serial data level converter for communicating with some specialized machinery. I've got a toolchain already in place to do bidirectional serial decoding with a very hacked together decoder. I just use a MAX232 (clone), two serial ports on my PC, and some freeware serial port monitoring software.

How much would you like to bet we'll just see the chatpad spitting out unicode strings?

Unicode sounds logical. I believe you own an XBOX 360, correct? Ideally you have the wireless controller and you can drop it right into your testbed. Three test leads to clip... what are you waiting for?

I have a similar hacked MAX 232 which I can interface directly to PC software or to an external RS-232 hardware analyzer (1 us granularity and autobaud capabilities via Xilinx FPGA) with some commercial decoder software. Unfortunately this setup only handles RS-232 and I have to remap signals to snoop a circuit, thus only RX or TX is decoded to hex. It gets the job done using only one serial port.

I referenced a USB logic analyzer earlier in this thread that I have not used, but have heard great things about from a co-worker. Nice form factor.

http://www.pctestinstruments.com/
http://www.pctestinstruments.com/log...terpreters.htm

Good luck on your current endeavor and hopefully you find some time over the next few weeks to devote to the chatpad.
thermoptic is offline   Reply With Quote
Old 11-20-2007, 01:38 AM   #140
Constant Bitrate
 
thermoptic's Avatar
 
Join Date: Aug 2007
Posts: 116
thermoptic is an unknown quantity at this point
Quote: Originally Posted by ioi8 View Post
Ok, i took a digital oscilloscope to the uart leads of the controller. This is what i have found out.

Looking at the controller normally, the leads go from left to right as:

Ground, Recieve (Rx), Transmit (Tx), Vpp (3V)

Now, my oscilloscope could not tell if this was 3.3V uart or 5v uart, but im guessing the 3.3 version because the power source is 3v. Anyone care to comment on the voltage levels of the signals?

Also, the baud rate of the uart is 120 buad. This is really slow, but i guess it doesnt need to be any faster.

The controller polls for external ascessories with the command 0x8C. Once there is a return signal, the controller holds the Tx line high.

So to activate the keyboard, you need to send the signal of 0x8C at 120 buad serially to the keyboard's Rx line. Once that occurs, im sure the keyboard will start spitting out characters. However, i dont have a chatpad, so i cant be too certain.

Thanks for probing the controller port. The signal level will be 3.3V for wired controllers and 3.0V for wireless (AA x 2):

http://pictures.xbox-scene.com/xbox3...ort_pinout.jpg

Yeah, 120 baud seems very slow. Since we are not dealing with symbols, 120 baud is 120 bps, which yields 8.333 ms per bit. Assuming 8-N-1, a single transfer would be ten characters requiring 83.33 ms. With UTF-8 you would have one or maybe two data bytes per character. A worst case of two-byte UTF-8 would require 166.66 ms per character. Now a tweaked gamer full of redbull could fire off 6 characters per second which hits the 1 second ceiling. This is pushing it...especially if you factor in in-band messaging/control characters. Perhaps the keypad matrix refresh timing keeps the rate below a few characters per second? Too many assumptions...

Can you determine the UART format? Is it using one start bit, eight data bits, and one stop bit? Perhaps you need more data to decipher the format? I had a difficult time with my hacked setup and I have no XBOX. If you have an XBOX, chatpads are only $30. That's a drop in the bucket... Just think of all the deprived chatpad owners who need PC chatpad access . . . this is a global crisis!
thermoptic is offline   Reply With Quote
Old 11-20-2007, 08:07 PM   #141
Newbie
 
Join Date: Nov 2007
Posts: 11
c0nsumer is an unknown quantity at this point
Bah. My current project just went in the toilet (realized the sniffer I was building wouldn't capture the Honda CD changer protocol properly, so I need to redesign it) so I'm going to tear into my chatpad now. I have to send in my 360 for repair anyway (yes, one of the new models is already bad) so I think this is a good time.
c0nsumer is offline   Reply With Quote
Old 11-20-2007, 10:07 PM   #142
Newbie
 
Join Date: Nov 2007
Posts: 9
mungewell is an unknown quantity at this point
If you want something done properly....

Quote: Originally Posted by mungewell View Post
Good job Steve, any chance of a photo of the reverse (keypad) side?

you have to do it yourself. ;-)

Enjoy,
Mungewell
Attached Images
File Type: pdf chatpad_hardware.pdf (261.5 KB, 269 views)
mungewell is offline   Reply With Quote
Old 11-20-2007, 10:12 PM   #143
Newbie
 
Join Date: Nov 2007
Posts: 11
c0nsumer is an unknown quantity at this point

Well, I didn't have much luck. I had no problem connecting the 360 chatpad's data lines to a PC's serial port via a MAX232, but when I tried every baud rate I had in the app I normally use, I was only getting back what appeared to be garbage. Nothing seemed to produce consistent results. Of course, I used no parity bits and one stop bit for everything. This could be wrong, but I don't currently know how to determine that without a logic analyzer or DSO, neither of which I have.

I was able to see (thanks to my crappy old scope) that the data appears to be 0-2V. This made me wonder if it was too close to the threshold of the MAX232 and maybe I actually am getting garbage. The data appeared almost consistent, but key presses didn't throw up anything particularly recognizable.

I'll probably poke with this more a bit later, but for now I'm calling it a night.

Oh, here's a couple more photos:
c0nsumer is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Old 11-20-2007, 10:27 PM   #144
Newbie
 
Join Date: Nov 2007
Posts: 9
mungewell is an unknown quantity at this point
Quote: Originally Posted by c0nsumer View Post
The data appeared almost consistent, but key presses didn't throw up anything particularly recognizable.

I hate to sound negative, but you're probably going to find it difficult to reverse engine the protocol that this thing uses without a scope (at least till someone gets some understanding of it).

My guess would be that it'll use some weird multi-byte protocol (this is Microsoft after all) and they will probably be scan-codes with 'pressed', 'repeat' and 'released' information.

Looking at the keyboard it has an extended character set and there are also the right/left shifts to accomodate.

A few questions to get you thinking:
1). Do the shift lights light when pressed, ie. does it require the 360 to set their state.

2). If you hold a key down do you get the same sequence of data repeated?

3). Do you get one instance of different data when key is released?

Good luck,
Mungewell.

PS: for reference on PS2 keyboard operation:
http://www.computer-engineering.org/ps2keyboard/
mungewell is offline   Reply With Quote
Old 11-20-2007, 10:32 PM   #145
Newbie
 
Join Date: Nov 2007
Posts: 11
c0nsumer is an unknown quantity at this point
Quote: Originally Posted by mungewell View Post
I hate to sound negative, but you're probably going to find it difficult to reverse engine the protocol that this thing uses without a scope (at least till someone gets some understanding of it).

I think a logic analyzer would be much more useful, which is why I'm not going much further. I don't personally have much of a need for this, I just wanted to see if it was possible / how easy it might be. Maybe someone else can pick things up.

I also wouldn't be surprised if MS does some manner of key exchange between the two devices, then encrypts things, uses a pre-shared key, or who knows what. That'd help keep third party devs from making their own keypads with macros and whatnot.
c0nsumer is offline   Reply With Quote
Old 11-21-2007, 01:31 AM   #146
Newbie
 
ioi8's Avatar
 
Join Date: Apr 2006
Location: Cleveland
Posts: 27
ioi8 is on a distinguished road
My logic analyzer

Hey guys, this is my logic analyzer.

http://cgi.ebay.com/PC-USB-Oscillosc...QQcmdZViewItem

It works pretty good, although i cannot stream digital logic. I have to capture it first before i can see the data. I hope one day i can own one of these bad boys.

http://www.usbee.com/

Too expensive for anything we do here. But it would be great for what i would like to do.

Im thinking about buying a chatpad really soon. My gf wants to dump me, so all the money im saving by not spending on her anymore i can put forth on the 'puter. O well.
ioi8 is offline   Reply With Quote
Old 11-21-2007, 02:07 AM   #147
Maximum Bitrate
 
sporty_drew's Avatar
 
Join Date: Mar 2006
Location: Iowa
Posts: 633
sporty_drew is on a distinguished road
Quote: Originally Posted by ioi8 View Post
My gf wants to dump me, so all the money im saving by not spending on her anymore i can put forth on the 'puter.

Hey i love your logic

I hope you decide to hop in a give these guys a hand.
__________________
1998 Camaro Worklog Pioneer P860MP, 3 JL 500/1's, JL 300/4, 3 12" Type R's, Diamond m611's
sporty_drew is offline   Reply With Quote
Old 11-21-2007, 02:30 AM   #148
Constant Bitrate
 
thermoptic's Avatar
 
Join Date: Aug 2007
Posts: 116
thermoptic is an unknown quantity at this point
Quote: Originally Posted by ioi8 View Post
I hope one day i can own one of these bad boys.

http://www.usbee.com/

Nice! You could overthrow a small country with the DX.
thermoptic is offline   Reply With Quote
Old 11-21-2007, 10:20 AM   #149
Newbie
 
Join Date: Nov 2007
Posts: 11
c0nsumer is an unknown quantity at this point
Quote: Originally Posted by ioi8 View Post
Hey guys, this is my logic analyzer.

http://cgi.ebay.com/PC-USB-Oscillosc...QQcmdZViewItem

It works pretty good, although i cannot stream digital logic. I have to capture it first before i can see the data. I hope one day i can own one of these bad boys.

I had one of those and sold it after finding it to be a huge pain in the ***. The buffer wasn't large enough to hold any reasonable amount of serial data, it not being isolated from the PC made noisy grounds a problem (my Dell laptop is really bad for this), and the build quality of the board itself just wasn't that great.

Also, the scope probes which come with it are basically just cheap multimeter probes with a BNC connector on the end.

I'd say you can do a lot better buying a Bitscope. Or the ZXbee, but with the Bitscope you at least get a scope as well... Personally I'm probably just going to drop the $1200 on a decent Tek scope (2002B or so) and maybe eventually a better PC-based logic analyzer. (Such as the aforementioned Intronix / pctestinstruments.com one.)

Detailed photos of the HobbyLab which I took are available here.
c0nsumer is offline   Reply With Quote
Old 11-21-2007, 03:11 PM   #150
Newbie
 
Join Date: Nov 2007
Posts: 9
mungewell is an unknown quantity at this point
And for anyone who's interested, here's the layout of the keyboard matrix.



I am thinking that any project to 're-purpose' this keyboard would be better served by having a web page of it's own, rather than existing in a forum discussion list. I would suggest Sourceforge as a suitable location (I have used them before for hardware/firmware projects).

As I see there are 2 halves/alternatives to this project:
1). A keyboard driver that listens on a serial port and speaks 'chatpad' protocol.
2). Alternative firmware for PIC which make it behave like a normal PS/2 keyboard.

I have thought of a pretty goodname (ssshhh top secret) and will register it to set up a project if others think that it is a good idea.

My other projects have be GPL'ed licensed, which prevents commercial exploitation of 'our' work, but still allows openness for others to build on our combined knowledge. I would prefer to work under a similar license.

Cheers,
Mungewell.
Attached Images
File Type: pdf chatpad_matrix.pdf (33.6 KB, 273 views)
mungewell is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PDA Mini Keyboard BriansNSane Input Devices 1 02-08-2006 08:17 PM
FS....Super Mini Electron luminescent Keyboard Letsride Classified Archive 9 06-13-2005 03:18 AM
Industrial mini keyboard -ebay g60 Classified Archive 0 04-18-2001 07:51 PM
Backlit Keyboard Caviar General Hardware Discussion 1 04-03-2001 10:35 PM
backlit keyboard blkdragon6 General Hardware Discussion 1 12-04-1999 12:47 AM



All times are GMT -5. The time now is 12:26 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.0
Copyright © 1999 - 2008 Mp3Car.com Inc.
"VaultWiki" powered by VaultWiki v2.5.2.
Copyright © 2008 - 2009, Cracked Egg Studios.Ad Management by RedTyger
Message Board Statistics