250 likes | 337 Vues
Voice Over IP – Software. Western Washington University By: Jonathan R. Peterson. Kernel Selection. MicroC/OS-II Manages complicated timing Preemptive multitasking Message passing with Semaphores (pending). Task and ISR Overview. EPHY_ISR
E N D
Voice Over IP – Software Western Washington University By: Jonathan R. Peterson
Kernel Selection • MicroC/OS-II • Manages complicated timing • Preemptive multitasking • Message passing with Semaphores (pending)
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.
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.
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
ISR Details – TimerISR Description: • This ISR handles the precise timing required for audio capture & reproduction. Details: • Period: 125µs (8kHz) • Execution Time: ~40µs
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
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
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
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
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
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
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
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
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.
Rx Tx Ethernet EPHY Ethernet EPHY Ethernet Driver Ethernet Driver IP/ICMP DHCP IP/ICMP UDP UDP TCP/IP TCP/IP VOIP VOIP RxData[ ] TxData[ ] TimerISR SPI ATD MIC DAC Filter General System Dataflow
Ethernet Driver TCP/IP IP EPHY_ISR IsIP( ) LinkFlag UDP IsUDP( ) EthernetTask OSSemPend( ) DHCP GotLink TCPIPTask IsDHCP( ) VOIP IsEthernet( ) VOIPFlag VOIPTask Basic Dataflow
VOIP Keypad Driver Keypad I/O Key KeyInit( ) KeyTask KeyPend( ) KeyFlag KeyCodeTable Keypad Dataflow