Express Aisle

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Alicia Dail and Edward Giardina

University of Rhode Island

ELE408 – Computer Organization

May 1, 2001


 

T A B L E   O F   C O N T E N T S

 

 

 


Introduction                                                                           3

 

Serial Communications                                                           4

 

Flowcharts                                                                            5

          Optimistic System Flowchart                                        5

          Optimistic Scan and Interrupt Routine Flowcharts           6

          Realistic System Flowchart                                7

          Realistic Scan and Interrupt Routine Flowcharts   8

 

Constraints                                                                            9

          Economic                                                                   9

          Manufacturability, Modularity and Expandability              9

          Social and Political Constraints                                   10

          Health and Safety Constraints                                    10

          Ethical Constraints                                                    10

 

Results/Conclusion                                                               11

         

Future Improvements                                                           12

 

Assembly Source Code                                                        A1

 

Sample Output                                                                    B1

 

Barcodes                                                                           C1

 

IEEE Code of Ethics                                                            D1

 


INTRODUCTION

 

 

Express Aisle is a simulation of the realistic setting of cashing out at a retail store, such as Shaws. Express Aisle is a practical application that can be used by any store that sells products that have barcodes associated to their prices.  Like most businesses that use hand-held barcode scanners, the user has the ability to scan UPCs and compute the total amount due for the products purchased. 

The design required the use of both UARTs in order to communicate serially with the hand-held barcode scanner and the HyperTerminal display. All scanned prices are displayed on the computer as they are scanned.  After the user scans the end of transaction barcode, the program will display the total amount due.

 


SERIAL COMMUNICATIONS

 

 

Motorola ColdFire 5307

·       UART – COM1

·       19200 bPS

·       Controls Display

 

NipponDenso

·       UART – COM2

·       19200 bPS

·       Controls hand-held scanner

 


OPTIMISTIC SYSTEM FLOWCHART

 

 

 

Originally, it was the hope that the user would be able to keep scanning barcodes until the

‘Enter’ key on the keyboard was pressed to signify the end of the transaction.  Meanwhile, each time a barcode was scanned the price would be added to the subtotal.
OPTIMISTIC SCAN AND INTERRUPT ROUTINES

 

 

 

Originally, a 7% RI sales tax was supposed to be added to the subtotal to produce the total amount due.
REALISTIC SYSTEM FLOWCHART

 

 

 

In reality the user will be able to scan barcodes continuously until an End of Transaction barcode is scanned.
REALISTIC SCAN AND INTERRUPT ROUTINE

 

 

 

There was no sales tax added to the subtotal because we had problems displayed the correct total of purchases. 
CONSTRAINTS

 

 

Economic Constraints:

 

          When looking at the performance/cost ratio for an application such as this, one should consider the differences between serial and parallel communication.  Communication using the serial port is a little slower than parallel because serial communication involves control handshaking, such as receiver ready; while the parallel port has no status registers associated with it, thus the user need only write/read data to/from a data line. 

Although serial communication is slower, it is also cheaper. This is due to the fact that serial communication is transmitted over only 1 channel; while on the other hand, parallel communication uses an individual wire for each channel that the system is communicating over.  So obviously for parallel communications, the more channels that are needed, requires more individual wires, which means more money.  Also, the serial port is easier to program and of more value than the parallel port for an application such as this.  The time saved in development time saves money in the cost of production.

When weighing performance versus cost, serial communication saves more money comparatively to the better performance of parallel communication.

 

Manufacturability, Modularity and Expandability Constraints:

 

          This program was written with some regard for modularity.  Unfortunately, there were times when we lacked the resources to form modular subroutines.  With a few additional data registers, we could have had loops based on counts to perform similar blocks of code.

            This application could definitely be further expanded.  One idea would be to have variable barcodes that would be associated with a product name, price, and possibly a taxable amount.

            This application can be readily manufactured in mass quantities because it only requires a copy of the software and a hand-held scanner.


Social and Political Constraints:

         

          This project could be of social impact.  Although the hand-held scanner has been around for quite some years now, when it first came out it made an impact on industry.  Imagine going to Stop & Shop and having to type each individual price into the computer.  This could take a long time.  The hand-held scanner has drastically changed the way we check out at the register.   It allows customers to cash out quickly and effectively.

 

Health and Safety Constraints:

 

          Health and safety constraints are minimal in this project.  In the real world, this project would be used only in the retail industry.  This is of no importance to national security, but we should consider the importance of associating the price encoded in the barcode with the scanned product.  An incorrect price could either upset a customer or cause the store to lose money.  In terms of users physical health, the hand-held scanner should not be pointed in anyone’s eyes because the infra red light can be harmful to the eyes.

 

Ethical Constraints:

 

          All project goals were not achieved, but are well documented throughout the paper.  We do not wish to project false output.  All sample and future output produced will accurately reflect program execution in accordance with the IEEE Code of Ethics.  See Appendix D for a copy of the IEEE Code of Ethics with a signed statement to the effect that we followed the code.

 

           

           


RESULTS and CONCLUSIONS

 

            The scanner is fully functional.  The price is correctly displayed for each barcode scanned.  The prices are summed up, but although the prices are in their BCDs, the add command adds them as though they are hexadecimal.  Therefore the total is the correct hexadecimal value, but the incorrect monetary value.  But it may sound as simple as doing a BCD conversion on the sum, but this is not the case.  In order for the correct sum to be displayed, each digit of the price would have to be individually added to the corresponding subtotal digit.  Then this solution could be converted to its BCD and the remainder added to the next digit.  Due to time constraints we were not able to implement this technique adequately.  So we have left our output as its hexadecimal sum.

             Due to the amount of time spent on displaying the subtotal we were unable to implement a functional interrupt routine.  Instead we implemented a check for an End of Transaction barcode in order to end program execution.

 


FUTURE IMPROVEMENTS

 

·       In the future, it is important to be able to rectify the subtotal display situation. Through the use of the technique mentioned above, we could potentially fix the subtotal display with some more development time and aggravation.

 

·       A state tax could be introduced.

 

·       An interrupt should be added to trigger the End of Transaction.

 

 

SOURCE CODE

 

*****************************************************************************

UCR2=0x10000208 |UART 2 Command register

UMR12=0x10000200 |UMR mode register

UMR22=0x10000200 |UMR mode register

USR2=0x10000204 |Status Register

UCSR2=0x10000204 |Clock Select register

URB2=0x1000020c |Receiver buffer

UTB2=0x1000020c |Transmitter buffer

UBG12=0x10000218 |Baud Rate Generator MSB

UBG22=0x1000021c |Baud Rate Generator LSB

UIVR2=0x10000230 |Interrupt Vector Register

 

move.l #0x10000000,%d0

move.l %d0,MBAR |initialize MBAR

 

move.l #0,%a6

move.l %a6,VBR |initialize vector base register

 

move.l #0x1000c040,%d0

move.l %d0,ACR0

 

move.l #0x80008000,%d0

move.l %d0,CACR

 

move.l #0x2021C,%d0

move.l %d0,0x0100

 

move.b #0x20,%d0 |UART 2 receiver reset

move.b %d0,UCR2

 

move.b #0x30,%d0 |UART 2 transmitter reset

move.b %d0,UCR2

 

move.b #0x10,%d0 |UART 2 register reset

move.b %d0,UCR2

 

move.b #0xB3,%D0 |set up the UMR1 (UART1 mode register)

move.b %D0,UMR12 |see pg 14-18,19 of the users manual

 

move.b #0x07,%D0 |set up the UMR2 (UART1 mode register)

move.b %D0,UMR22 |see pg 14-20,21 of the users manual

 

move.b #0xDD,%D0 |select timer mode as the Tx/Rx clocking

move.b %D0,UCSR2 |see pg 14-24 of the users manual

 

move.b #0x00,%D0 |Disable interrupts for the COS&/CTS

move.b %D0,UACR2 |see pg 14-30 of the users manual

 

move.b #0x02,%D0 |Interrupt only when FIFO is full

move.b %D0,UIMR2 |see pg 14-31 of the users manual

 

move.b #65,%D0 |Interrupt vector set to 65

move.b %D0,UIVR2 |see pg 14-33 of the users manual

|65 was a random choice.

|65 decimal is converted by the processor

|to the vector offset hex value of 0x104

 

move.b #0x00,%D0 |Set baud rate to 9600 (45 mhz clk)

move.b %D0,UBG12 |see pg 14-32 of the users manual

 

move.b #0x92,%D0 

move.b %D0,UBG22

 

move.l #0x50000,%a0

move.l #0x30000,%a1

move.l #0x40000,%a5

 

MOVE.L #0x30,%D3

CLR.L %D6         | individual price

CLR.L %D7         | subtotal

 

scan:                     clr.l %d0 |Clear Registers

                              clr.l %d1

                              clr.l %d2

                             

                              move.b #0x09,%d0 |Enable the receiver and disable the transmitter

                              move.b %d0,UCR2

              

start:                     move.b USR2,%d1 |has a character been received?

                              btst #0,%d1

                              nop

                              beq start

 

                              CLR.L %D6

                             

                              move.b URB2,%d1 |load the char into receiver buffer

                              move.b %d1,%d2

                              cmp.l #0x30,%d2

                              beq display

 

                              move.b #0x24,%d1            | Load $

                              move.l #0x0013,%d0        | display the $

                              trap #15

 

                              move.b %d2,%d1                             

                              move.l #0x0013,%d0 |display the char in the screen

                              trap #15

                              MOVE.B %D1,%D6                         | shift digit into price register

                              SUB.L %d3,%d6

 

dollars: move.b USR2,%d1 |has a character been received?

                              btst #0,%d1

                              nop

                              beq dollars

                             

                              move.b URB2,%d1 |load the char into receiver buffer

                              move.l #0x0013,%d0 |display the char in the screen

                              trap #15

                              cmp.l #0x2e,%d1               | stay in this loop until a decimal point is found

                              beq tenth

                              LSL.L #4,%D6                   | shift price register

                              add.l %D1,%D6

                              sub.l %D3,%D6

                              bra dollars

 

tenth:     nop

                              move.b USR2,%d1 |has a character been received?

                              btst #0,%d1

                              nop

                              beq tenth

 

                              move.b URB2,%d1 |load the char into receiver buffer

                              move.l #0x0013,%d0 |display the char in the screen

                              trap #15

                              LSL.L #4,%D6                   | shift price register

                              add.l %D1,%D6

                              sub.l %D3,%D6

                             

hundredth:            nop

                              move.b USR2,%d1 |has a character been received?

                              btst #0,%d1

                              nop

                              beq hundredth

 

                              move.b URB2,%d1 |load the char into receiver buffer

                              move.l #0x0013,%d0 |display the char in the screen

                              trap #15

                              LSL.L #4,%D6                   | shift price register

                              add.l %D1,%D6

                              sub.l %D3,%D6

                             

                              move.l #0x0a,%d1             | To output 1 line feed

                              move.l #0x0013,%d0

                              trap #15

                              move.l #0x0d,%d1             | To output 1 carriage return

                              move.l #0x0013,%d0

                              trap #15

                             

eol:                       move.b USR2,%d1 |has a character been received?

                              btst #0,%d1

                              nop

                              beq eol

 

                              move.b URB2,%d1 |load the char into receiver buffer

                              move.l #0x0013,%d0 |display the char in the screen

                              trap #15

                              nop

                                            

 

BCDconvert:

                              ADD.L %D6,%D7

                              CLR.L %D6

                              clr.l %d4

                              move.l #0x0a,%d4

                              CLR.L %D5

                              move.l %D7,%D5

                              and.l #0x000f,%d5

                              DIVU.L %D5,%d4                            | get BCD

                              move.w %D5,%D4                            | BCD

                              lsr.l #0x08,%d5                  | get remainder                   

                              MOVE.B %D4,(%A5)+     | pennies                             

                             

                              move.b %d5,%d4                              |remainder

                              move.l %D7,%D5

                              LSR.L #4,%D5   

                              and.l #0x000f,%d5            

                              ADD.L %d4,%D5

                              move.l #0x0a,%d4

                              DIVU.L %D5,%d4                            | get BCD

                              move.w %D5,%D4                            | BCD

                              lsr.l #0x08,%d5                  | get remainder                   

                              MOVE.B %D4,(%A5)+     | dimes                 

                             

                              move.w %d5,%d4                              |remainder

                              move.L %D7,%D5

                              LSR.L #8,%D5

                              and.l #0x000f,%d5            

                              ADD.L %d4,%D5

                              move.l #0x0a,%d4

                              DIVU.L %D5,%d4                            | get BCD

                              move.w %D5,%D4                            | BCD

                              lsr.l #0x08,%d5                  | get remainder                   

                              MOVE.B %D4,(%A5)+     | ones    

                             

                              bra scan

display:

                              move.l #7,%d4

               dash:     

                              move.l #0x2d,%d1             |Load -

                              move.l #0x0013,%d0        | display the -

                              trap #15

                              sub.l #1,%d4

                              bne dash

                              move.l #0x0a,%d1             | To output 1 line feed

                              move.l #0x0013,%d0

                              trap #15

                              move.l #0x0d,%d1             | To output 1 carriage return

                              move.l #0x0013,%d0

                              trap #15

 

                              MOVE.L #0x30,%D3

                              move.b #0x24,%d1            | Load $

                              move.l #0x0013,%d0        | display the $

                              trap #15

 

                              clr.l %d5

                              move.b -(%A5),%D5

                              ADD.L %D3,%D5

                              MOVE.B %D5,%D1                         | get next digit

                              move.l #0x0013,%d0        | display the digit

                              trap #15

 

                              move.b #0x2E,%d1            | Load .

                              move.l #0x0013,%d0        | display the .

                              trap #15

 

                              clr.l %d5

                              move.b -(%A5),%D5

                              ADD.L %D3,%D5

                              MOVE.B %D5,%D1                         | get digit

                              move.l #0x0013,%d0        | display the digit

                              trap #15

                             

                              clr.l %d5

                              move.b -(%A5),%D5

                              ADD.L %D3,%D5

                              MOVE.B %D5,%D1                         | get digit

                              move.l #0x0013,%d0        | display the digit

                              trap #15

 

                              move.l #0x0a,%d1             | To output 1 line feed

                              move.l #0x0013,%d0

                              trap #15

                              move.l #0x0d,%d1             | To output 1 carriage return

                              move.l #0x0013,%d0

                              trap #15

                              bra finish

 

_UARTInterrupt:               

                              move.l %d0,-(%a7)

                              clr.l %d0

                              move.b USR2,%d0

                              btst #0,%d0

                              beq trans

                              move.b URB2,%d0

                              move.b %d0,(%a1)+

 

trans:     

                              move.l (%a7)+,%d0

 

finish:   

               trap #15

******************************************************************************************

SAMPLE OUTPUT

 

 

S-record download successful!

dBUG> go 20000

$2.99

$1.59

$1.29

$2.29

-------

$7.44

dBUG> go 20000

$1.99

$1.79

-------

$3.12

dBUG> go 20000

$1.79

$2.09

-------

$3.82

dBUG>

 

 

BARCODES