120 likes | 242 Views
Project PRINT TCSP 6 Software Design Narrative. Team 8 Vineeth Harikumar. Project Abstract. Printer power management system Use the power indicator LED as a light sensor Control printer's power based on light levels Route incoming print jobs to local storage/printer. Block Diagram.
E N D
Project PRINT TCSP 6 Software Design Narrative Team 8 Vineeth Harikumar
Project Abstract • Printer power management system • Use the power indicator LED as a light sensor • Control printer's power based on light levels • Route incoming print jobs to local storage/printer
Block Diagram 110VAC 3 3 110VAC 4 Ethernet Power Relay RPG SD Card 6 PIC32MX795F512HMicrocontroller SPI-to-Ethernet Controller Ethernet LED 100 ohms 16 4 ? SM Power Supply (to all components) LCD Display 2 4 5VDC
Software Design Considerations SPI • MICRO SD • SPI-to-Ethernet Controller UART • Debugging ADC • LED light sensing GPIO pins • LCD
Software Design Hybrid design • Interrupts • UART - Debugging • Timers - light sensing routines, timeouts • SPI-to-Ethernet controller • Polling • Store incoming bytes to SD card • Transmit bytes from SD card • Check flags for updating LCD • Check flags for LED light sensing routines
Software Design Reset initializeSPI() initializeUART() initializeADC() while(1) configureInterrupts() initializeSDCard() writeIncomingPacketsToSDCard() readAndForwardPacketsOnSPI() sampleADCVoltage() updateLCD() controlPrinterMode()
Code Hierarchy main.c SPI.h ADC.h LCD.h SDCARD.h TIMER.h UART.h initLCD() sendCommand() sendByte() initSPI() SPIinterrupts() configTimer() TIMER_ISR() initSDCard() ReadSector() WriteSector() initUART() UART_ISR() WriteString() initADC() sampleADC()
Initializations ADC • Pins AN4 & AN5 • External VREF+ & VREF- • Manual scanning mode LCD • 12 GPIO Pins • 8 data pins for DB0-DB9 • Register select, Read/Write mode, Clock
Initializations UART • UART1 Receiver and Transmitter • 8 bit data size • 0 parity bits, 1 stop bit • Data rate = 38400bps TIMER • Timer Channel 1 • 10ms interrupts
Initializations SPI • MicroSD card • 3 pins (SCK,SDO, SDI) • Read/Write transfer rate 10Mbps • SPI-to-Ethernet controller • Implemented with two interrupt pins and SPI • Maximum data transfer rate of upto 10Mbps