Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/04/05 00:53
Modified:
  05/04/05 00:55

Read: times


 
#92849 - Allegro A6276 Sample Code
I have written this code to transfer an 8-bit binary number from a data table to turn on the appropriate segments of a seven segment display. The code is designed to keep track of the count of three different events happening, and output the two-digit total of each event to a SSD. Here is the sample code for one of the event counters:

INC R0; ADD to count
MOV A, RO
MOV B, #10D
DIV AB; TO TURN TWO DIGIT NUMBER INTO TWO 8-BIT DIGITS
MOV DPTR, #400H; ADDRESS OF DATA TABLE
MOVC A, @A+DPTR

MOV TM0D, #20H; SET TIMER MODE
MOV TH1, #-3; SET TRANSFER RATE
MOV SCON, #50H; SET TRANSFER TYPE
SETB TR1; START TIMER
MOV SBUF, A; MOV QUOTIENT
DONE1: JNB TI, DONE1
CLR TI

This code is then essentially repeated for the other digit in the two-digit number (the remainder of the DIV operation, which is stored in Register B).

The problem is that the A6276 requires a clock pulse to serially move the data in, so just sending the data down the wire will do nothing. How can I modify this code so that the 8-bit number is transferred in serially? And to complicate things, I have three A6276s cascaded serially, one for each two-digit number needed. How can move the appropriate data to the proper A6276 so I can direct one event count to one SSD, another event count to another SSD, and the last event count to the last SSD?



List of 6 messages in thread
TopicAuthorDate
Allegro A6276 Sample Code            01/01/70 00:00      
   Divide and conquer            01/01/70 00:00      
      Informative!            01/01/70 00:00      
   Re:Allegro A6276 Sample Code            01/01/70 00:00      
   Further Questions            01/01/70 00:00      
      Bit shifting            01/01/70 00:00      

Back to Subject List