Download presentation
Presentation is loading. Please wait.
Published byAusten Flowers Modified over 8 years ago
1
Voice Over IP – Software Western Washington University By: Jonathan R. Peterson
2
Kernel Selection MicroC/OS-II Manages complicated timing Preemptive multitasking Message passing with Semaphores (pending)
3
Task and ISR Overview EPHY_ISR Sets a Semaphore every time a physical change occurs on the network. (Network cable plugged/unplugged) TimerISR Handles the interrupt generated every 8kHz. StartTask Completes system initialization and task creation, removes itself from the task scheduler. EthernetTask Responds to the Semaphore created by EPHY_ISR and updates the link status. TCPIPTask Scans the Rx buffers for new data and then processes it.
4
Task and ISR Overview (continued) DHCPTask Handles dynamic addressing, and renews the IP address when the lease expires. KeyTask Scans the keypad for a keypress. OnHookTask Scans the button on bit 2 of Port-G to see if the receiver is in use or not. VOIPTask Processes audio packets (incoming and outgoing), handles VOIP call requests and acknowledgements (handshaking). UITask Displays user information via the LCD, and receives user input via the keypad.
5
Task and ISR Specifications Task/ISRPriorityOperationPeriod Execution Time Average CPU Load Maximum CPU Load EPHY_ISR---Sporadic5s1µs0.0000002.0000002 TimerISR---Periodic 8kHz125µs~40µs0.32 StartTask4--- 24.7ms--- EthernetTask5Periodic 1ms (pends on EPHY_ISR) Typical: 57.2µs Max: 115.2µs 0.000011440.00002304 TCPIPTask6Periodic2ms Typical: 353µs Max: 724µs 0.17650.362 DHCPTask7Periodic2ms Typical: 1µs Max: 100µs 0.00050.05 KeyTask8Periodic15ms Typical: 1µs Max: 2.2µs 0.00006670.0001467 OnHookTask9Periodic15ms Typical: 1µs Max: 2.2µs 0.00006670.0001467 VOIPTask10Periodic2ms~150µs0.075 UITask11Periodic200ms~5ms0.025 Total: 0.5970.8323
6
ISR Details – EPHY_ISR Description: This ISR is generated when a physical change occurs on the network. Link speed Duplex Cable plugged/unplugged The ISR posts to a semaphore so that that EthernetTask may process the change. Details: Period: ~5s (Sporadic) Execution Time: ~1µs
7
ISR Details – TimerISR Description: This ISR handles the precise timing required for audio capture & reproduction. Details: Period: 125µs (8kHz) Execution Time: ~40µs
8
Task Details - StartTask Description: Performs all system initialization Creates the tasks Removes itself from the task scheduler Details: Priority: 4 Period: Once upon system startup Execution Time: 24.7ms
9
Task Details – EthernetTask Description: Pends on the Semaphore posted by EPHY_ISR. Determines what variety of link change occurred and updates the system. Details: Priority: 5 Period: 1ms Execution Time: 57.2µs
10
Task Details - TCPIPTask Description: Checks the Rx buffer for received packets. Writes to the Tx buffer when necessary. Processes packets through all layers except the application layer (described on the next slide). Details: Priority: 6 Period: 2ms Execution Time: 353µs
11
TCP/IP Details
13
Task Details - DHCPTask Description: This task processes the DHCP requests, and renews the lease of the IP address before it expires. Details: Priority: 7 Period: 2ms Execution Time: 1µs
14
Task Details - KeyTask Description: This task scans the 4x4 keypad, waiting for a key to be pressed. This is the same task that we used in ETEC 454. Details: Priority: 8 Period: 15ms Execution Time: 1µs
15
Task Details - OnHookTask Description: This task scans the push-button on bit 2 of Port-G and waits for a voltage level change. Details: Priority: 9 Period: 15ms Execution Time: 1µs
16
OnHookTask – De-bouncing
17
Task Details – VOIPTask Description: This task processes the incoming and outgoing audio packets, as well as handles VOIP call requests and acknowledgements. Details: Priority: 10 Period: 2ms Execution Time: ~150µs
18
VOIPTask – Incoming Call
19
VOIPTask – Outgoing Call
20
Task Details – UITask Description: This task is responsible for displaying information to the user via the LCD. The task also processes the user input. Details: Priority: 11 Period: 200ms Execution Time: ~5ms
21
Module Descriptions ATD – Analog to Digital conversions DHCP – Dynamic IP support EEPROM – Interface for the SPI to access the EEPROM Ethernet Driver – Allows Ethernet functionality IP – Internet Protocol support Keypad – Interfaces with the 4x4 keypad (**REUSED**) LCD – Displays text via the 2x16 LCD (**REUSED**) SPI – Handles synchronous serial communications TCP/IP – Integrates the Ethernet driver, IP, UDP and DHCP Timer – Configures the 8kHz sample rate UDP – User Datagram Protocol, Part of the TCP/IP stack VOIP – Contains the User Interface and application specific code.
22
Module Details ATDDHCPEEPROM Ethernet Driver IPKeypadLCDSPITCP/IPTimerUDPVOIP ISRs --- EPHY_ISR--- TimerISR--- Tasks ---DHCPTask---EthernetTask---KeyTask--- TCPIPTask--- StartTask --- OnHookTask --- VOIPTask --- UITask Public Func. ATDInitIsDHCPInitEEInitEthernetIsIPXXInitSPIUDP_WriteDataInitTimerIsUDPmain StartATDDHCPReqWriteEECloseEthernetMakeIPHdrXXWriteSPIGetAppDataGetCountMakeUDPHdr--- ReadEEStartTxIsICMPXXReadSPI--- CheckRxBuffersMakeICMPXX--- MakeEthHdrIsARPXX--- IsEthernetMakeARPXX--- Public Vars ---DHCPState---ActiveBufferMyNodeXX---VOIPFlag--- TxData[ ] ---DHCPAddr---GotLinkNodeBuf[ ]XX--- RxData[ ] --- CurrNodeXX---
23
General System Dataflow TimerISR SPI Ethernet EPHY Ethernet Driver IP/ICMP UDP RxData[ ] TCP/IP VOIP Rx Ethernet EPHY Ethernet Driver IP/ICMP UDP TxData[ ] TCP/IP VOIP Tx ATD DHCP DACFilter MI C
24
Basic Dataflow OSSemPend( ) EPHY_ISR Ethernet Driver EthernetTask LinkFlag GotLink TCP/IP IsEthernet( ) TCPIPTask IP IsIP( ) IsUDP( ) UDP IsDHCP( ) DHCP VOIP VOIPTask VOIPFlag
25
Keypad Dataflow VOIP KeyInit( ) KeyPend( ) Key KeyFlag Keypad Driver KeyTask KeyCodeTable Keypad I/O
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.