My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
FountMicrocontrollerResearch  
Updated Oct 27, 2013 by rijadsul...@gmail.com

Research

DESIGN:

Each fountain will be controlled by a PIC18F27J13. The PIC18F2713 features the following 1:

  • 64 KB Flash Program Memory
  • 3.6 KB SRAM
  • uns on 5.6uA
  • Idles on 1.7uA
  • Operates with -0.3V to 4.0V
  • The PIC18F2713 includes many useful peripheral modules:
  • Seven Capture/Compare/PWM (CCP) modules
  • Two Master Synchronous Serial Port (MSSP) modules featuring 3-wire SPI (all 4 modes)Two Enhanced USART Modules
  • Five timer modules with eight timers total
  • High-Low Voltage Detect (HLVD) Module

IMPLEMENTATION:

1. Two CCP modules will be used (on pins 25, 26) to respectively detect the rising and falling edges of the pulse-width modulated (PWM) signal from the IR receiver.

2. One USART module will be used (with pins 18, 17) to communicate with the XBee.

3. One MSSP module will be used (with pins 16, 15, 14) to communicate with the LED driver.

4. HLVD module will be used (on pin 7) to detect a voltage change caused by the pressing of a button.

5. 3 digital I/O pins (2, 3, 4) will be used to control the state of the audio driver.

This implementation can be seen in figure 2 below.

The main appeal of the PIC18F2713 over comparable PIC18 microcontrollers is the number of peripheral modules, especially the 8 timers. An interrupt can be set for each timer, triggering when the timer register overflows or when it matches a particular value.

Timer interrupts greatly reduce the complexity of the program by eliminating the need to poll the timer values each iteration and reducing the amount of variables to be stored.

On the fountain, the timers will be used as follows:

1. One timer (timer1) will be dedicated to capturing the time of the PWM rising and falling during the CCP4/5 (Pin 25, 26) Capture interrupts. (This timer is used to measure the pulse width of the signal and must be reset after each interrupt so that it never overflows.)

2. One timer will be dedicated to timing the complete pouring action of the cup. An overflow interrupt will control this function.

3. One timer will be dedicated to timing any delay in the cup pouring action. (e.g. if the cup stops pouring for more than half a second, the pouring action must be restarted).

4. The remaining five timers will be used to control audio and visual effects. Five timers will accommodate multiple simultaneous effects.

ALTERNATIVE DESIGN:

Apart from the PIC series, the MSP430F5XXX family of microcontrollers may also be considered. The MSP430F5XXX features 2:

  • 128 – 256 KB Program Memory
  • 16 KB SRAM
  • Runs on 150uA -290uA
  • Idles on 1.5uA – 2.1uA

We did not choose the MSP430F5XXX because it consumes too much power and provides way more functionality than what we need.

$ Alternatively, a CCP module could detect the change in voltage by consecutively inverting the polarity of the capture mode.

Flowchart

References

1. Microchip, “28/44-Pin, High-Performance Microcontrollers with nanoWatt XLP Technology,” PIC18F47J13 Family datasheet, Jan. 2010.

2. Texas Instruments, “MSP430x5xx and MSP430x6xx Family User’s Guide”, Datasheet, Jun. 2008 (Rev. Feb 2013).

Powered by Google Project Hosting