Presentation is loading. Please wait.

Presentation is loading. Please wait.

ITÜ COMPUTER ENGINEERING INTERCONNECTION PROTOCOLS PROJECT PRESENTATION Ersan Öztürk-504041515 26/12/2005 JAVA RADIO.

Similar presentations


Presentation on theme: "ITÜ COMPUTER ENGINEERING INTERCONNECTION PROTOCOLS PROJECT PRESENTATION Ersan Öztürk-504041515 26/12/2005 JAVA RADIO."— Presentation transcript:

1 iTÜ COMPUTER ENGINEERING INTERCONNECTION PROTOCOLS PROJECT PRESENTATION Ersan Öztürk-504041515 26/12/2005 JAVA RADIO

2 Java Radio Ersan Öztürk OUTLINE Idea Aim Radio Chip: TEA5764 I 2 C Parallel Port Hardware Connection OSI layers: physical, logical link JNI To do list Problems encountered Conclusion

3 Java Radio Ersan Öztürk IDEA Cell phones that does not have radio on 64% of cell phones support Java applications.* People request music everytime, everywhere *Source:GFK

4 Java Radio Ersan Öztürk AIM IO control of the phones requires longer time, So aim is: Radio control via a PC using Java TM language A radio that can be controlled via PC: TEA5764 Can be controlled via I 2 C

5 Java Radio Ersan Öztürk Radio Chip:TEA5764 Chip produced by Philips, One of the smallest radio chips It supports Radio Display System (RDS) RDS: station, song, artist display Control can be done via I 2 C Consumes low power

6 Java Radio Ersan Öztürk I 2 C - definition Inter Integrated Circuit Syncronious Serial Communication LOW COST COMPLEXITY SPEED Developed by Philips semiconductors in 1980’s Used to control signal processing devices such as:RF tuners, video decoders,audio processors, EEPROMS, real time clocks etc.

7 Java Radio Ersan Öztürk I 2 C - Basics Two lines: bidirectional communitaction Dev. 2 Slave Dev. 1 Master SDA:Serial Data SCL:Serial Clock Intiates and finishes communication Establishes syncronization by clock Determines data direction Responds when addressed, at the time given by master

8 Java Radio Ersan Öztürk I 2 C – Communication1 SEND / WRITE START address R/W A_S Byte1 A_S..... A_S STOP 0010000 0 XXXXXXXX.... START address R/W A_S Byte1 A_M..... NAMSTOP 0010000 0 XXXXXXXX RECEIVE / READ A_S: Acknowledge by slave A_M:Acknowledge by master NAM:Non Acknowledge by master

9 Java Radio Ersan Öztürk I 2 C – Communication2 START STOP ACK_MASTER ACK_SLAVE NON_ACK_MASTER SCL:HIGH SDA:HIGH > LOW SDA:LOW > HIGH SCL:HIGH SCL:PULSE SDA:LOW BY MAS. SDA:LOW BY SLA. SCL:PULSE SDA:HIGH BY MAS. SCL:PULSE

10 Java Radio Ersan Öztürk Parallel Port - 1 8 pins are bidirecitional used for data accessed via DATA PORT 5 pins are input accessed via STATUS PORT (one is inverted) 4 pins are output accesses via CONTROL PORT (three are inverted) Remaining pins are Grounded

11 Java Radio Ersan Öztürk Parallel Port - 2 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0 DATA7 DATA6 DATA5 DATA4 DATA3 DATA2 DATA1 DATA0 IRQ ~ERROR SELECT PE ~ACK BUSY RESERVED IRQENABLE ~SELECTIN INIT ~AUTOFEED ~STROBE DIRECTION DATA (378|278|3BC)STATUS (DATA+1)CONTROL (DATA+2) Windows NT,2000 and XP does not let user programs to reach memory addesses. Windows 98,ME let it!

12 Java Radio Ersan Öztürk Hardware Connection TEA5764 SCL PIN2 PIN16 SDA GND PIN18-25 PIN2: DATA PORT 0 PIN16:CONTROL PORT 2 PARALLEL PORT V CC V DD V REFDIG SPEAKER

13 Java Radio Ersan Öztürk Coding – Physical Layer void Zero() { SDA(LOW); delay (DELAY_MILIS,DELAY_NANOS); SCL(HIGH); delay (DELAY_MILIS,DELAY_NANOS); SCL(LOW); delay (DELAY_MILIS,DELAY_NANOS); } void One() { SDA(HIGH); delay (DELAY_MILIS,DELAY_NANOS); SCL(HIGH); delay (DELAY_MILIS,DELAY_NANOS); SCL(LOW); delay (DELAY_MILIS,DELAY_NANOS); } void SDA(int state) { if(state==0) lpt1.write_data (0x0000); else lpt1.write_data (0x0001); }

14 Java Radio Ersan Öztürk Coding – Network & Procol Layer void radio_power(int onoff){ FMWrite(); if(ack_slave()==0) writebyte(0x00ff); // byte0W if(ack_slave()==0) writebyte(0x002f); // byte1W : 00101111 if(ack_slave()==0) // 100.0 mhz writebyte(0x00ca); // byte2W : 11011010 if(ack_slave()==0) if(onoff==1) writebyte(0x0040); // byte3W : 01000000 else writebyte(0x0000); // byte3W : 00000000 if(ack_slave()==0) Stop(); }

15 Java Radio Ersan Öztürk Java Native Interface (JNI) A framework that enables Java codes to call native applications and libraries of languages such as C, C++ and assembly It is mostly used for operating system and hardware related functions

16 Java Radio Ersan Öztürk JNI - Parport import parport.ParallelPort; class SimpleIO { public static void main ( String []args ) { ParallelPort lpt1 = new ParallelPort(0x378); int aByte; aByte = lpt1.read(); // read a byte from the port's STATUS pins aByte = aByte >> 2; // a simple and irrelevant operation lpt1.write(aByte); // write a byte to the port's DATA pins System.out.println("Output to port: " + aByte); } Java Radio lpt1.read_data() In C language inportb(DATA) Java Radio lpt1.write_data(aByte) In C language outportb(DATA,aByte)

17 Java Radio Ersan Öztürk Human Interface

18 Java Radio Ersan Öztürk Output – via Logic Analyzer

19 Java Radio Ersan Öztürk Problems Encountered P1)Unsigned bytes are not avaliable in Java S1)Integers were used instead of bytes P2)Win XP not allow to reach parallel port S2)Userport and DirectIO used then Win98 is used P3)Java Comm is not flexible enough S3)JNI is used, P4)Data port used as unidirectional S4)Parallel Port is set to Enhanced Parallel Port (EPP) from BIOS and direction selection is used on Control Port P5)Can not get output from radio S5)Still working on it!!!

20 Java Radio Ersan Öztürk To do list Finish the code and test functions in details Establish RDS Implement the code in mobile phone emulators Differenciate code according to different mobile phone IOs and Java supports Marketing the radio to manufacturers nationwide Marketing the radio worldwide Make money$

21 Java Radio Ersan Öztürk Conclusion Project taught: One of the basic interconnection protocols I 2 C One of the basic connection components of PC: The Parallel Port Control mechanisms of chips Use of Java in low level (JNI) At the end it can be a success in business.


Download ppt "ITÜ COMPUTER ENGINEERING INTERCONNECTION PROTOCOLS PROJECT PRESENTATION Ersan Öztürk-504041515 26/12/2005 JAVA RADIO."

Similar presentations


Ads by Google