View
218
Download
2
Category
Tags:
Preview:
Citation preview
Team CassiaTeam Cassia
Computer-Controlled Talking ScalesSystem Architecture Presentation
24/9/08
PROJECT OVERVIEW& IMPLEMENTATIONPROJECT OVERVIEW& IMPLEMENTATION
• Project timeline• Task allocation
System architecture principlesSystem architecture principles
• Modularity – division of work, ease of debugging
• Extensibility – allow for future improvements
• Efficiency – code re-use, emphasis on avoiding potential problems
Project planProject plan
• Allocation of roles, background research• Work is done by multidisciplinary pairs• Emphasis on skeleton code to be completed
first, to develop interfaces between modules• Regular milestones for code/hardware
integration• Communication by Wiki (brainstorming, code,
user manual development)
Team rolesTeam roles
Member Role
Alex Jarkey Team leader
Kit AxelrodSoftware leaders
Duncan Matheson
Elisabeth Magdas Documentation leader
Michelle Noguez CerónHardware leaders
Ryan Nguyen
Michael West Integration leader
Timeline and task allocationTimeline and task allocation
HARDWAREHARDWARE
•I/O requirements and Pin Assignments•Connections, terminations and enclosure•Power supply
Hardware devicesHardware devicesInput hardware• Strain Gauge sensors on the scale will use A/D
converter • Serial Port input via RS232 from the PC keyboard• Keypad input via the I/O ports on the board• Possible On/Off switch • Serial input into the Text to Speech module
Output hardware• LCD display Menu and value display• Hyper-terminal via RS232• Auditory output from the Text to Speech processor• LEDs purpose to be determined (debug, status)
Pin AssignmentsPin Assignments
Port A• RA0 Strain gauge signal
Port B• RB0-2 Used for the keypad column pins• RB4 controls the one LED• RB6 -7 Debugger for the MPLAB
Port C• RC1,3-5 Used for the keypad row pins• RC2 Used to produce a PWM on the CCP1 if necessary• RC6 USART transmission (TX)• RC7 USART receive (RX)
Port D• RD0-7 the LCD 8 data bits
Port E• RE0-2
– LCD control lines– Read/Write , Register Select signal and operation enable
Pin AssignmentsPin Assignments
Port MappingPort Mapping
Bits 0 1 2 3 4 5 6 7
Port A Strain Gauge
Port B Keypad C1 Keypad C2 Keypad C3 LED Debugging
Port C Keypad R1 Timer CCP1Keypad
R2Keypad
R3Keypad
R4 TX RX
Port D LCD data LCD data LCD data LCD data LCD data LCD data LCD data LCD data
Port E LCD control LCD control LCD control
Power SupplyPower Supply
• Logic and interfacing circuits to be powered by +5V and +/- 12V DC
• Extension: Implement a +9V DC source from an alkaline battery for portability purposes– Strain Gauge : 5V– PIC18F452 : 5V through X2 or X9 pins– LCD : 5V– Text to Speech : 5V
ConnectionsConnections
• In the case of wires between prototyping board and Minimal PIC board, ribbon cable to reduce clutter – with pins or directly soldered
• Serial Port connection• Other possible ideas :
– Use clips or simple pin connections for initial stages for testing and debugging, and towards final stages, solder the pins together permanently
USER INTERFACEUSER INTERFACE
• Interface software design principles• Menu structure• Interface hardware and enclosure
User interface - softwareUser interface - software
• Constraints– limited input– limited output– multiple modes – numerical entry , Factory mode
• Design principles– consistency– reusability– logical– accessibility
User interface – menu structureUser interface – menu structure
Numerical entry mode here –deactivates ability of input to affect settings
User interface – hardwareUser interface – hardware
• Repeat button to read out last command• Keypad will include Braille stickers• Enclosure design:
SpeakerPower + Serial
Insert circuit boards here
Lid with LCD + Keypad
SOFTWARESOFTWARE
• Central operation loop• State transition• Function implementation ideas• Factory functions
State transitiondiagram
State transitiondiagram
Basic OperationBasic Operation
Process weight samples buffer
Subtract zero value
Divide by value for units
Display weight (or count)
Process input buffer
Input action?
No Yes
The scales effectively perform the same function for the majority of the time.
With the exception of factory mode only functions, the high level functionality can be summed up in one loop.
The processes shown are passed values corresponding to current operating unit and user mode.
Any update of the settings is backed up in EEPROM on update.
Processing Weight Samples and ZeroProcessing Weight Samples and ZeroThe samples buffer will be processed to produce a fixed point number proportional to
weight only.
At the most basic level the processing is an arithmetic mean but will likely develop through the use of frequency calculations.
Uses function prototype:int Process_Samples (int * buffer, int sampleCount);
The ‘TARE’ function will take the current processed value and set it as the relative zero point. ‘TARE’ produces a unit-independent weight value ‘currZero’. Effectively: currZero = Process_Samples(sampleBuffer, sampleCount);
Meaningful usage may be:currWeight = Process_Samples(sampleBuffer, sampleCount) – currZero;
Divide by Units Divisor Divide by Units Divisor The units divisor and name are stored
as ‘unit’ structs and can have values for:- grams- ounces- custom (for count)
The pointer to struct ‘currUnit’ is updated on unit change or when the count functionality is used.
The user defined unit ‘custom’ is updated during the setup of the count function.
No
Yes
grams?
ounces?
count?
currUnit = gram
currUnit = ounce
Get processed weight
Number of items in basket (num)
Custom.value = currWeight/num
currenUnit = custom
No
Yes
Yes
No
Return to general
operation
Display weight (or count) and Process input buffer
Display weight (or count) and Process input buffer
The display method is defined within ‘mode’ structs UserLocal, UserRemote and Factory.
The pointer currMode will point to the active user mode.
Uses function prototype:char Display (struct mode* currMode, struct unit* currUnit, int currWeight);
Input methods, either local and remote, are always ready and will fill an ‘input buffer’, which is progressively emptied in each basic operation iteration.
Inputs will be handled by hardware as either external interrupts for keypad or RX interrupts for RS232.
In the majority of cases, the input will require the program to break from basic operation and perform a settings change, such as changing the value of currUnit or currMode.
Factory functionsFactory functionsOnly CALIBRATE is interesting in the Factory functions.
Some interpretations we have come up with:
1. Redefine ‘gram’ and ‘ounce’ values.
2. Redefine the upper and lower reference voltages for the ADC module.
3. Plot significant points as used by the ‘Process_Samples’ function.
QUESTIONSQUESTIONS
Thank you for your attention.
Recommended