Search This Blog

Wednesday, June 15, 2011

Nokia F-bus and AVR

After many projects about sending SMS via AVR  using GSM modems, i decided to interface my old nokia mobile supporting F-bus to AVR...for the begining you should know F-bus so well to go on with that project...

here's a basic  introduction for f-bus V2:

Protocol principle
This protocol is a packet based protocol with a control transmission mecanism. Each
packet as a sequence number.
Protocol exchange layout
Here is a sample of the protocol exchange :
1. P.C send a packet
2. Phone send a Ack packet
3. Phone Send the answer packet
4. P.C send a ack packet


Why this protocol has a Control Transmission mecanism ? Because you could have a collision
du to the nature of the cable. For the same reason the Acknoledgement sequence
number is here to know which packet have been received.
Protocol Speed
To properly con gure the com port i has to be like this :
speed 115 200
num bits 8
parity none
Stop bit 1

Standard message definition
A standard message look like this one :
1E 02 00 04 00 0B 01080002010463020401 40 00 3900
which corespond to :
[Frame type(1)][Src dev(1)][Dst dev(1)][CMD(1)][Frame type(1)][Len(1)][DATA(X)][Seq(1)][Padd(1 or 0)][Chksum(2)]
Frame type
The frame type indicate which type of protocol is using :
{ 1E : Serial Fbus frame
{ 1c : Irda Fbus frame
Src dev and Dst dev
Indicate the source and the destination device
{ 02 Phone
{ 00 Computer
CMD
This the command type, it de ne which type of information is about.
{ need a x
Frame type
Used if the message exceeded 255 then it give which part is sending. (need to be more
detailled)


Len
The len of the packet. To calculate it : Data + Sequence number so in other word : len
= data + 1 (in hex)
Data
the packets data.
Seq : Sequence number for regular packet
the sequence number for the standard frame seem's to be between 40 up to 47 So always
initialize it to 40 at the beginning seem's to be working
Padd
Since the packet as to be a odd number, if the len is even it as to be added. The padd
is always 00.
Chksum
The check sum is in fact two dierent checksum. The rst hex represente the Xor of all
the odd hex block from the packet, the second represent the Xor of all the even Hex block
of the packet.
Ack message defnition
A standard message look like this one :
1E 00 02 7F 00 02 02 01 1E 7C
which corespond to :
[Frame type(1)][Src dev(1)][Dst dev(1)][CMD(1)][Frame type(1)][Len(1)][DATA(X)][Seq(1)][Chksum(2)]
Ack message defnition
A standard message look like this one :





click below :








1 comment: