Author Topic: Stuffing Serial Bluetooth Module Inside C1k Casing  (Read 371578 times)

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #15 on: July 07, 2005, 03:02:28 am »
Quote
As far as CF slot goes, I think it's 3.3V only in C1K (860 might have both 3.3V & 5V). Regardless, it's a dedicated power domain and it's controlled by pcmcia sybsystem, i.e. power is on on insert/resume pcmcia events, power is off on remove/suspend events, so it can't be used for other purposes which require its own power control.
[div align=\"right\"][{POST_SNAPBACK}][/a][/div]

PCMCIA at least has two power lines: One switched by software and a permanent one. There must be a permanent one in order to detect a card insertion. If it is stong enough, it could be used to power other devices as well.

According to this: [a href=\"http://www.interfacebus.com/CompactFlash_Memory_Module_pinout.html]http://www.interfacebus.com/CompactFlash_M...ule_pinout.html[/url]
it should be pin 13 and pin 38 of the CF port.

In order to switch cards with software on and off, IIRC the /CE lines (card enable) are used. If they are inactive (i.e. high, they are active low), the card switches off power internally, but the lines 13 and 38 should still lead power.

I have no way to confirm that by measurements at the moment, but I'm pretty sure this is the way it works. At least for PCMCIA this is true and as these two interfaces have only minor differences, it should also be true for CF.

daniel
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0

abegaza

  • Newbie
  • *
  • Posts: 23
    • View Profile
    • http://
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #16 on: July 26, 2005, 03:16:58 am »
i like the idea here, but let me get a few things straight:
1. are you guys trying to use the sharp i/o port's USB port?
2. if not, is this possible?
"I don't have the right people words to make you undersand"
c1000
PB G4 OS 10.4 (aka the lapwarmer)

polito

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
    • http://thether.com
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #17 on: July 30, 2005, 03:07:25 am »
I'm definitely interesting in what comes of all this. I wish I had the electronics know-how to be able to help and experiment. I would gladly torture my devices till I got something to work

Hmm... guess I better start crackin' on learning all I can 'bout the electronics involved... I had years ago but had some $$$ problems and that went out the door...  

Good luck to you all and please keep up the good work on investigating this!

2x4ever

  • Newbie
  • *
  • Posts: 44
    • View Profile
    • http://
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #18 on: August 31, 2005, 10:51:51 am »
Albertr at HPC.RU wrote:

Quote
BTW, how did you manage to trace the BTUART lines? I hope you didn't have to unsolder the CPU for that?
No i didn't . I've found a picture of the PCB with unsoldered CPU at this link:
http://digit.que.ne.jp/visit/index.cgi?Lin...%EA%C1%FD%C0%DF.

Quote
Are you using H4 serial protocol? If so, BCSP could be helpful if you can't use uart hardware flow control. You mentioned that you can run HCI inquiry command, but what problems do you have?
Yes i'm using H4 protocol for now. I would like to use BCSP but this needs to change PS key in the module. Thats the problem because H4 link is not stable enougth to do that. I'm using USB BT dongle. So i'm was able to change CSR boot mode to UART with pskey tool from bluez project? but this tool cannot change a key numbered 191 wich controls speed and other paramteters wich are needed for BCSP to work. So i've has two choises: 1 - is to set it to H4 with hope that i can change this later throught serial interface(there is a tool from affix project that can do that), or 2 - is to set it in BCSP mode and make the module totaly unusable.

Quote
How do you control the power of BT module? Is it constantly on or software-controlled?
The power is constantly for now and is taked from Zaurus SIO PORT( there is a VCC 3,3 pin there with 200ma max current). But if i find some free gpio i'll do a software control for it throught a PNP transistor.

Quote
As far as software goes, I didn't find anything in Sharp;s 2.4.20 kernel that would indicate that BTUART lines are used for anything else. But again, C1K/C3K design is quite different, and the kernel you use is probably different too.
I will look in 2.4.20 kernel. But as for now i've found that in my C700 all BTUART line are used, including RX and TX to control internal buzzer and battery charging and this          making me sad. i'm looking into Sharps asic IC now. It may have some free GPIO pins.
« Last Edit: August 31, 2005, 11:07:34 am by 2x4ever »

albertr

  • Hero Member
  • *****
  • Posts: 535
    • View Profile
    • http://
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #19 on: August 31, 2005, 11:39:26 am »
Thanks for sharing your experience! Now I see how you traced uart lines
Here's a direct link to that picture: http://zaurus-ja.sourceforge.jp/images/sl-...250_removed.jpg
Whoever did that had real nerve! I wish someone do the same to C1K/C3K, cause I'm afraid that pcb layout is different. However, it might be very helpful for folks who have 7x0/860 devices.

What do you mean under "not stable"? At what baud rate? You may want to try to short flying leads, or maybe even better - shield them to avoid interference. I'm not an electric engineer, but do you have an o'scope to check the signal?

As far as CSR module programming goes, take a look at their support web site. They have all required documentation available, so you can easily modify pskeys or write your own code to do that. I wrote some piece awhile ago for Win32 and can make it available on my site, so it can be used as a sample. Just let me know...

It seems weird that TX/RX BTUART lines are used in C700. Are you sure in this? You may want to grep for relevant register addresses on the kernel source to see where it gets used.
-albertr

2x4ever

  • Newbie
  • *
  • Posts: 44
    • View Profile
    • http://
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #20 on: August 31, 2005, 12:24:56 pm »
Quote
Thanks for sharing your experience! Now I see how you traced uart lines wink.gif
Yes. Exactly.

Quote
Whoever did that had real nerve! I wish someone do the same to C1K/C3K, cause I'm afraid that pcb layout is different. However, it might be very helpful for folks who have 7x0/860 devices.

You may try to trace it another way: take devmem2 utility )from for example here http://2x4ever-vpn.compot.ru/zaurus/devmem2/devmem2 - compiled for arm) and write a little scipt to trigger a necessary GPIO pins while zaurus is running and oscilloscoping a PCB around CPU.
This shoud trigger TX/RX up and down ever second (for PXA250):
# while true; do devmem2 0x40E0001C 0xC00; sleep 1; devmem2 0x40E00028 0xC00; done

Quote
What do you mean under "not stable"? At what baud rate? You may want to try to short flying leads, or maybe even better - shield them to avoid interference. I'm not an electric engineer, but do you have an o'scope to check the signal?
Dongle is configured to use CTS/RTS at 230400 speed and works a second or two after that dongle is stops sending anything. When i'm reseting dongle it continues. While it is works for hcitool it doesn't works for PSKEY utility. I'm able to read a length of the PS key but not a contained info. Now i'm soldering dongle to a FFUART to use CTS/RTS and will try to change PS keys.

Quote
It seems weird that TX/RX BTUART lines are used in C700. Are you sure in this? You may want to grep for relevant register addresses on the kernel source to see where it gets used.
I'm sure. In the picture i've provided you can see that BTRXD is going to the chip named 2149 282 JRC. Googling on this gives me the folowing datasheet http://www.njr.co.jp/pdf/de/de05035.pdf. This is an amplifier for a zaurus buzzer.
While i can't trace where BTTXD goes, grepping source of the linux 2.6 kernel for zaurus gives the folowing defines wich are used in a battery charge code:
#define CORGI_GPIO_DISCHARGE_ON         (42) /* Enable battery Discharge */
#define CORGI_GPIO_CHRG_UKN                     (43) /* Unknown Charging (Bypass Control?) */
« Last Edit: August 31, 2005, 12:25:41 pm by 2x4ever »

albertr

  • Hero Member
  • *****
  • Posts: 535
    • View Profile
    • http://
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #21 on: August 31, 2005, 01:24:07 pm »
Quote
You may try to trace it another way: take devmem2 utility )from for example here http://2x4ever-vpn.compot.ru/zaurus/devmem2/devmem2 - compiled for arm) and write a little scipt to trigger a necessary GPIO pins while zaurus is running and oscilloscoping a PCB around CPU.
This shoud trigger TX/RX up and down ever second (for PXA250):
# while true; do devmem2 0x40E0001C 0xC00; sleep 1; devmem2 0x40E00028 0xC00; done

That's a good idea in case there;s a suspected line. However, probing every line available doesn't seem to be practical unless you want to push your luck

Quote
Dongle is configured to use CTS/RTS at 230400 speed and works a second or two after that dongle is stops sending anything. When i'm reseting dongle it continues. While it is works for hcitool it doesn't works for PSKEY utility. I'm able to read a length of the PS key but not a contained info. Now i'm soldering dongle to a FFUART to use CTS/RTS and will try to change PS keys.

Looks like a mising flow control, unless you see frame or parity errors. If that's the case, then BCSP should help.

Quote
I'm sure. In the picture i've provided you can see that BTRXD is going to the chip named 2149 282 JRC. Googling on this gives me the folowing datasheet http://www.njr.co.jp/pdf/de/de05035.pdf. This is an amplifier for a zaurus buzzer.
While i can't trace where BTTXD goes, grepping source of the linux 2.6 kernel for zaurus gives the folowing defines wich are used in a battery charge code:
#define CORGI_GPIO_DISCHARGE_ON         (42) /* Enable battery Discharge */
#define CORGI_GPIO_CHRG_UKN                     (43) /* Unknown Charging (Bypass Control?) *

Interesting... Of course, they can steal GPIO pins, but what they're gonna do with data lines? And how buzzer can send any data to uart? Weird...
I'll try to take a look at 2.4.20 kernel source to see if there's any use of btuart data lines I have missed...
-albertr

2x4ever

  • Newbie
  • *
  • Posts: 44
    • View Profile
    • http://
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #22 on: August 31, 2005, 01:40:28 pm »
Any of BTUART pins can be used as usualy GPIO pins. This is so called alternate GPIO function and is described in intel's datasheet. So when BTUART is disabled all its pins are working as just any other GPIO pins. And BTUART is disabled by default in kernel source.

static void __init corgi_map_io(void)
{
        pxa_map_io();
        iotable_init(corgi_io_desc);

#if 0
        /* This enables the BTUART */
        CKEN |= CKEN7_BTUART;
        set_GPIO_mode(GPIO42_BTRXD_MD);
        set_GPIO_mode(GPIO43_BTTXD_MD);
        set_GPIO_mode(GPIO44_BTCTS_MD);
        set_GPIO_mode(GPIO45_BTRTS_MD);
#endif

        /* setup sleep mode values */
        PWER  = 0x00000002;
        PFER  = 0x00000000;
        PRER  = 0x00000002;
        PGSR0 = 0x0158C000;
        PGSR1 = 0x00FF0080;
        PGSR2 = 0x0001C004;
        PCFR |= PCFR_OPDE;
}

albertr

  • Hero Member
  • *****
  • Posts: 535
    • View Profile
    • http://
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #23 on: August 31, 2005, 04:17:01 pm »
Ahh, right! Sorry, I completely overlooked that...

Too bad that GPIO 42 & 43 pins are used in PXA250-based clamshell Zauruses. It looks like they are *NOT* used on PXA270-based Zauruses (scoop's GPIO used instead), but tracing them might be a challenge.

-albertr
« Last Edit: August 31, 2005, 04:21:02 pm by albertr »

2x4ever

  • Newbie
  • *
  • Posts: 44
    • View Profile
    • http://
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #24 on: September 01, 2005, 10:43:34 am »
Quote
Ahh, right! Sorry, I completely overlooked that...

Too bad that GPIO 42 & 43 pins are used in PXA250-based clamshell Zauruses. It looks like they are *NOT* used on PXA270-based Zauruses (scoop's GPIO used instead), but tracing them might be a challenge.

-albertr
[div align=\"right\"][a href=\"index.php?act=findpost&pid=93976\"][{POST_SNAPBACK}][/a][/div]

I've finaly figured out for what this pins are used for - for battery charge and discharge controls and i'll try to resolder this controls to scoop if i'll find free GPIOs on it. And in the last resort i can use FFUART. It is possible to share it with bluetooth and use it as usual uart when bluetooth is disabled. The only thing that stopping me to do that is speed. FFUART's maximum speed is limited to 230400 on PXA250. By the way, i've soldered dongle to the FFUART and succesfully changed H4 to BCSP.

2x4ever

  • Newbie
  • *
  • Posts: 44
    • View Profile
    • http://
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #25 on: September 01, 2005, 10:55:07 am »
It would be interesnting to fetch a datasheer for a scoop somewhere. Maybe it have some UART. And it would be much more easy to solder to it since it doesn't have this nasty bga package. At least in C700

speculatrix

  • Administrator
  • Hero Member
  • *****
  • Posts: 3707
    • View Profile
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #26 on: September 01, 2005, 11:04:37 am »
Quote
Ahh, right! Sorry, I completely overlooked that...

Too bad that GPIO 42 & 43 pins are used in PXA250-based clamshell Zauruses. It looks like they are *NOT* used on PXA270-based Zauruses (scoop's GPIO used instead), but tracing them might be a challenge.

-albertr
[div align=\"right\"][{POST_SNAPBACK}][/a][/div]

what's the difference between the pxa250 (700 and 5600) and pxa255 (760,860)? This discussion is making me excited about the possibilities of squeezing a BT module inside my 860!

useful table:
[a href=\"http://tuxmobil.org/pda_survey_sharp.html]http://tuxmobil.org/pda_survey_sharp.html[/url]

--- edit ---
ah, apparently the 255 has 30% lower power consumption, and a faster clock speed, and a faster bus (200 not 100 MHz).
« Last Edit: September 01, 2005, 11:11:21 am by speculatrix »
Gemini 4G/Wi-Fi owner, formerly zaurus C3100 and 860 owner; also owner of an HTC Doubleshot, a Zaurus-like phone.

speculatrix

  • Administrator
  • Hero Member
  • *****
  • Posts: 3707
    • View Profile
Gemini 4G/Wi-Fi owner, formerly zaurus C3100 and 860 owner; also owner of an HTC Doubleshot, a Zaurus-like phone.

albertr

  • Hero Member
  • *****
  • Posts: 535
    • View Profile
    • http://
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #28 on: September 01, 2005, 11:18:00 am »
I believe the scoop is a proprientary Sharp's ASIC, so the datasheet most probably never would be published or made public.
-albertr

albertr

  • Hero Member
  • *****
  • Posts: 535
    • View Profile
    • http://
Stuffing Serial Bluetooth Module Inside C1k Casing
« Reply #29 on: September 01, 2005, 11:19:14 am »
What about stuart? In case you don;t need SIR.
-albertr