| ??? 08/23/00 16:44 Read: times |
#4657 - RE: 8051 ROM lookup table |
Christian,
This is what I came up with, its a little confusing but, it worked. I had a much more condensed version but, I was not able to line up the clock pulses on one given condition, so I gave up and took the easy route out. The chip I am using takes a serial i/p where the first bit is an enable bit, followed by 32 bits of data w/ clock pulses. This is then followed by three more pulses to enable the chip, how confusing. Do you have any suggestions on how I could simplify this code?(a lot of NOP's to waste time)? Or do you think that it is satisfactory??? Thanks for the tip on writing to the outport from carry bit and thanks for all the help. Ben INIT_LSI: clr p3.1 clr p3.0 setb p3.0 ;leading bit to enable LCD driver setb p3.1 ;oscillator timing matters from this point -clk = 1 mov r6, #023h ;strobe in data =12 clks mov r6, #023h ;to waste time =12 clks nop ;=12 clks nop ;=12 clks nop ;=12 clks nop ;=12 clks nop ;=12 clks nop ;=12 clks nop ;=12 clks nop ;=12 clks clr p3.1 ;--------clock low nop ;=12 clks nop ;=12 clks BYTE_FROM_CODE: mov R7, #08h ;=12 clks (8 bits) mov a, #00h ;=12 clks movc a,@a+dptr ;=24 clks BIT_XMIT: nop ;=12 clks rlc a ;=12 clks mov p3.0, c ;=24 clks setb p3.1 ;--------clock high djnz r6, NOT_DONE ;=24 clks call DONE_LSI_XMIT ;=24 clks NOT_DONE: djnz r7, HOLD_ON ;=24 clks nop ;=12 clks nop ;=12 clks nop ;=12 clks nop ;=12 clks inc dptr ;=24 clks clr p3.1 call BYTE_FROM_CODE ;=24 clks HOLD_ON: nop ;=12 clks nop ;=12 clks nop ;=12 clks nop ;=12 clks nop ;=12 clks nop ;=12 clks clr p3.1 nop ;=12 clks nop ;=12 clks nop ;=12 clks nop ;=12 clks call BIT_XMIT ;=24 clks DONE_LSI_XMIT: nop ;=12 clks nop ;=12 clks nop ;=12 clks nop ;=12 clks nop ;=12 clks nop ;=12 clks clr p3.0 |
| Topic | Author | Date |
| 8051 ROM lookup table | 01/01/70 00:00 | |
| RE: 8051 ROM lookup table | 01/01/70 00:00 | |
| RE: 8051 ROM lookup table | 01/01/70 00:00 | |
| RE: 8051 ROM lookup table | 01/01/70 00:00 | |
| RE: 8051 ROM lookup table | 01/01/70 00:00 | |
| RE: 8051 ROM lookup table | 01/01/70 00:00 | |
| RE: 8051 ROM lookup table | 01/01/70 00:00 | |
| RE: 8051 ROM lookup table | 01/01/70 00:00 | |
| RE: 8051 ROM lookup table | 01/01/70 00:00 | |
| RE: 8051 ROM lookup table | 01/01/70 00:00 | |
| RE: 8051 ROM lookup table | 01/01/70 00:00 | |
| RE: 8051 ROM lookup table | 01/01/70 00:00 | |
| RE: 8051 ROM lookup table | 01/01/70 00:00 | |
| RE: 8051 ROM lookup table | 01/01/70 00:00 | |
| RE: 8051 ROM lookup table | 01/01/70 00:00 | |
| RE: 8051 ROM lookup table | 01/01/70 00:00 | |
| RE: 8051 ROM lookup table | 01/01/70 00:00 | |
| RE: 8051 ROM lookup table | 01/01/70 00:00 | |
RE: 8051 ROM lookup table | 01/01/70 00:00 |



