??? 08/27/05 09:57 Read: times |
#100173 - Can you review this? Responding to: ???'s previous message |
This is a copy of my code I'm using to transmit to the m5450/51,
(that doesn't seem to work). See anything glaringly wrong that would make this chip not work properly? I'm using Bank 1 R0-R4 for the 36 bits that need to be transmitted. ;*************************************************************** ; Function: Transmit ; ; Description: Just transmits 36 bits to the m5450/51. ; ; 36 Pins ; r0 r1 r2 r3 r4 ; 1111111x|11111111|11xxxxxx|11111111|11xx0000 ; 0123456 78901234 56789012 3456 ; 12345678 91111111 11222222 22233333 3333 ; BITS BITS ; 1-7 rows 1-7 ; 9-13 LED1(c1-5) green ; 14-18 LED2(c1-5) green ; 25-29 LED1(c1-5) red ; 30-34 LED2(c1-5) red ; ;*************************************************************** ST_tx: ;*************************************************************** ; Microcontroller ports dedicated to ST serial communications ; DATA In StDA BIT P1.6 ; CLOCK StCL BIT P1.7 CLR A using 1 ; DATA is in BANK 1 ;set bit 1 to begin transmission SETB StDA lcall SCloop ; blip the clock txloop: mov A,r0 lcall xmit mov A,r1 lcall xmit mov A,r2 lcall xmit mov A,r3 lcall xmit mov A,r4 anl A,#0f0h lcall xmit using 0 RET ; xmit: CLR C mov r5,#8 ; counter for bit tx's XmitLoop: CLR StDA ;clear data bit ; moves the bit to transmit into the carry bit RLC A JNC Xmitc1 SETB StDA xmitc1: lcall SCloop djnz r5,xmitloop ; ? transmitted all 8 bits xmitexit: CLR StDA clr A RET SCLoop: lcall xmitdlay SETB StCL lcall xmitdlay lcall xmitdlay lcall xmitdlay CLR StCL lcall xmitdlay ret xmitdlay: mov R6,25 ;Work out the djnz delay value txDel2: mov B,#200 txDel3: djnz B,txDel3 ; loop delay djnz R6,txDel2 ; this many times ret |
Topic | Author | Date |
8051 m5450 code? | 01/01/70 00:00 | |
Re: | 01/01/70 00:00 | |
it would be helpful if you provided a fu | 01/01/70 00:00 | |
datasheet | 01/01/70 00:00 | |
I would be very weary of using this chip | 01/01/70 00:00 | |
m5450 code. | 01/01/70 00:00 | |
you will not get far with "believe", wha | 01/01/70 00:00 | |
believe | 01/01/70 00:00 | |
Can you review this? | 01/01/70 00:00 | |
I'm using Bank 1 | 01/01/70 00:00 | |
Listing | 01/01/70 00:00 | |
the using directive | 01/01/70 00:00 | |
Bank 1![]() | 01/01/70 00:00 | |
Bank 1 | 01/01/70 00:00 |