twitter


Devices equipped with Bluetooth technology support wireless point-to-point connections, as well as wireless access to LAN, mobile phone network, the Ethernet and home networking. The connectivity between two Bluetooth equipped devices is carried out as serial communication. Bluetooth technology delivers the received data and receives the data to be transmitted to and from a host system through a host controller interface (HCI). The most popular host controller interface today is either a UART or a USB link.

Now, even though we can use USB or UART, the most commonly used HCI is UART because of following reasons:

◦If UART is used software overhead is very less
◦Its highly cost effective.

A Universal Asynchronous Receiver and Transmitter (UART) is used for communication with serial input and serial output devices. Serial transmission reduces the cost and complexity of the wirings at the expense of speed, and for many applications this is a desired trade-off. The UART takes bytes of data and transmits the individual bits in a sequential fashion. At the destination, a second UART re-assembles the bits into complete bytes. Synchronization for the serial data stream is accomplished by adding start and stop bits to the transmit data to form a data character. Data integrity is insured by attaching a parity bit to the data character. The parity bit is checked by the receiver for any transmission bit errors.

To a host system, the UART appears as an 8-bit input and output port that it can read from and write to. Whenever the host has data to be sent, it just sends these data to the UART in byte format (8-bit wide), whenever the UART receives data from another serial device it will buffer these data in its FIFO (again 8-bit wide), then it will indicate the availability of these data to the host through an internal register bit, or through a hardware interrupt signal.


Above is the block diagram of SC16C650B UART. Let me explain the functions of UART using these blocks in brief manner.
Register Select is used to decode the address of register which the host wants to access. DataBus and Control Logic is how the host transmits and receive data to/from UART. There are several registers in UART. Some of them are TransmitHoldRegister(THR), Receive Hold Register(RHR) – both as name suggests is used to hold Transmitting and Receiving data. Then there is Interrupt Enable register used to enable/disable different kinds of Interrupts supported by UART. There are other registers used to control FIFO, Modem, Data format, etc. The Shift Registers are used to break the byte information for sequential transfer OR assemble the bits using FIFO to form Byte data.

Now that we understand the functionality of UART , lets see how it is interfaced with Bluetooth. Consider the following diagram

This is typical Bluetooth Controller architecture. The single bluetooth chip will encompass till Link Manager layer. Now this bluetooth Chip when to be interfaced with the system will do it in following manner:
The host controller sends the data using D[7-0] channel and address using A[0-2] channel. The UART chip receives these data and using shift registers and FIFO , it converts into serial data. These serial bits will be then sent to Bluetooth Controller (Rx,Tx,CTS,RTS) and then transmitted via RF channel.

This is a brief overview of working of UART explained using SC16C650B and its interface with Bluetooth.

Cheers :)
Ajith



Leave a Reply


             When you are porting Android, one important feature to check is SD card mount. Needless to say this feature is needed for many functions to operate correctly. Couple of such examples are Bluetooth OPP and FTP profiles.

SD card boot up sequence is as follows :
  • mmc/sd driver recognises the inserted card, makes device object for every partitions with unique combination of MAJOR:MINOR numbers and generate uevent.
  • uevent comes to user-level via kernel socket NETLINK_KOBJECT_UEVENT.
  • vold handles this uevent in uevent.c::handle_block_event().
  • vold reads boot sector to determine, how many partitions remains on storage.
  • If all partitions are found, vold will start "mount" procedure.
  • If mount is successfully finished, vold sends "volume_mounted:/sdcard" to com.android.server.MountListener.
  • com.android.server.MountListener dispatches message to com.android.server.MountService by handleEvent() method.
  • com.android.server.MountService provides to framework the logical interpretation of vold actions such as update icon notification and forwards command from user to vold.
  • So, in our case MountService::notifyMediaMounted() will generate Intent.ACTION_MEDIA_MOUNTED.
  • This intent will start com.android.providers.media.MediaScanner which will start searching the media content and makes the database. Parallely com.android.settings.deviceinfo.Memory will update memory status.
             Some important files to remember for SD card boot sequence are mmc.c, ums.c vold.c, voldmgr.c, uevent.c. These files will be useful in debugging SD card boot up sequence. The configuration file of SD card is vold.conf and is present in /etc.

Cheers :)
Ajith



               Back when I was a kid, I used to run around open ground hoping to see the aircraft whenever there was sound of a plane!. We used to make paper planes and fly it over and over again. Hell!! we even caught Dragon flies , tied their tail to strings and played chopper :). All those time I always used to wonder what will it be like to see clouds from above for a change.
               Just when I was about to leave Deloitte and join Samsung, I was offered work onsite(US office) couple of months in future. Of course I left it for a better job but missing an opportunity to fly at least once was always bothering me. A month into my Samsung job, my Deloitte manager pings me in Gtalk and says :

"
Manager: Hi Ajith
  how are you

me: Hello Manager..
  I am doing good.

manager: gr8

me: how about you?

manager: gud
  u missed the opertunity....your bad luck
  X1 and X2 going to onsite"

PS: Manager, X1 and X2 is substituted for actual name :D

                 While I was happy for X1 and X2, I was partly sad not because I missed opportunity to USA, but because I missed opportunity of flying.Few months later in Samsung I get opportunity to fly abroad. To South Korea, a place of vast cultural extravaganza. At very last moment  I pack my bags and get ready to see real life-size airplanes :). Of course something HAD to go wrong and it started to downpour in Bangalore. Heavy rains are rare in Bangalore and rain gods just decided to toy with my flight experience :| . I take my luggage into cab amidst all the water and finally start journey to airport. During journey, all I could remember was The Catalyst song from Linkin Park and all my friends in Bangalore. I messaged a few of them "good-bye" and started enjoying ride, while "Bangalorean -taxi meter" started ticking :s.
                  If you have been to Ulsoor in Bangalore, you can see other side of the city. Crowded and noisy like fish market. After having seen this and the Metro construction sites, I never thought Bangalore had clean roads at all. But I was proved wrong when we passed by New airport road. Magnificently lit , this structure is testament to all that is clean and beautiful. I met my Samsung senior at airport traveling with me to Korea and asked him to guide me since I have no knowledge whatsoever about airports and rules followed. Check - in , Custom and Immigration goes on and I finally rest in passenger lounge. Sitting here I think about scene in Friends when Ross declares his love to Rachel at airport and I wonder if that's ever possible in Bangalore airport with all these Police and Security :)
                 At 2.20 I board the plane, a beautiful beast. I had booked window seat :D :D.  Few mins later , take-off ...Even though it was dark  I could see enough to distinguish large objects. Finally as seat belt sign was off, I began exploring the plane for stuffs I can access :). I was like inquisitive kid in between candies wondering what the next one would taste like. Though other people were sleeping , I couldn't go to sleep since I wanted to savor every single moment of this trip. Air hostess then gave me Chicken - like sandwich :(.  The small T.V in front of me kept giving details of the craft. The highest of all that was recorded was 39000ft, -52 deg C outside temp and ground speed of some 685 - I forgot unit of this one. I opened the shutter of the window and touched the glass. The coldness outside had affected glasses and I could feel my fingers becoming very cold & numb. The air hostess asked me to close the shutter :( :( and I began switching channels to find "Bolt" being played.
              I thought I would see the movie but I fell asleep few mins into the movie :). An hour later air hostess wakes me up for breakfast :O !!! . I had food 1.5 hr back and now breakfast!!.. and my head is buzzing because I had only 1 hr of sleep. I open the shutter to see bright light and clouds brimming over the edge of the flight's blades. When the plane banks left/right, it seems as though entire globe has just been tilted for better view. Its an amazing sight to see and it made me envy all the pilots who get to do this all the time.

 
              Our flight landed at HK International airport. It's a giant beast with almost all you need in life; at one place. One side of this airport is covered by Mountains and hills brushing against clouds. The other side; the open side is surrounded by sea. Air-crafts landing here is beautiful sight to see. We went around , ate some special sandwich and before we knew it we were on our connecting flight to Incheon, S.Korea. The above pic was taken on this flight. As we landed at Incheon , I could immediately see the structural differences in building architectures. Every other standing giants here are work of best artisans. I came to know that Incheon was the #1 airport few years back and its currently #2 . I was keen to experience what jet-lag is but heck I didn't feel anything. I think its highly over-rated :).
               The Visa stamping lady just saw Samsung and then started stamping all our Passports. She didn't even bother to check our faces and the same went on with luggage, Security and  taxi guy. It seems Samsung for one is highly influential and no doubt I got to know how people respected it in Korea. I collected my first Korean Wons from a very beautiful foreign exchange lady :). I must agree that almost 90% of Korean women have the most beautiful legs I have ever seen :) and when I see them all I can think is Monica(in Friends) saying "hamana hamana hamana" :D.
               After getting our luggage back we called our respective Guest Houses and headed for beautiful and hopefully less hectic 3 months of our lives, thus ending my first and one of the most beautiful experience.

Cheers :)
Ajith

PS: Sorry for a late and few number of posts. I was very busy with work . Thanks!