In SX Microcontrollers, SX/B Compiler and SX-Key Tool, cbmeeks wrote: Thanks guys. I will try some tests tonight on some LED's to see if I am recording data correctly. Here is a direct link to the datasheet: [url]http://jameco.com/wcsstore/Jameco/Products/ProdDS/75037.pdf[/url] Here is some code: [code] ;============================================= ; TRUTH TABLE ;============================================= ;CE WE OE Data Mode ;H X X High Z Standby (ISB, ISB1) ;L H H High Z Output disable (ICC) ;L H L DOUT Read (ICC) ;L L X DIN Write (ICC) ;============================================= ; SRAM ;============================================= SRAM_READMODE MACRO setb WE ;(1) mov !DATA_BUS,#%11111111 ;(2) Port C all input ENDM SRAM_WRITEMODE MACRO clrb WE ;(1) mov !DATA_BUS,#%00000000 ;(2) Port C all output ENDM SRAM_CHIPENABLE MACRO clrb CE ;(1) ENDM SRAM_CHIPDISABLE MACRO setb CE ;(1) ENDM ;============================================= ; PIXELS ;============================================= PLOT MACRO x,y,c mov ADDR_BUS_LSB, #x mov ADDR_BUS_MSB, #y nop nop mov DATA_BUS, #c nop nop ENDM ;here is a portion of my read code (active scanline): .... ;we are now at 872 clocks (10.9 µS) ;Active Scanline 52.6 µS ;Normally, this would be 52.6 * 80 = 4208 clocks ;However, we have 3 clocks for the call and 3 for the return ;So we need to run for 4202 clocks ;reset SRAM LSB mov ADDR_BUS_LSB, #0 ;2 mov p1, #16 ;2 StartPixels mov VID_BUS, DATA_BUS ;2 nop ;1 nop ;1 inc ADDR_BUS_LSB ;1 ;244 cycles mov w, #$3D mov d1, w active_delay_0: decsz d1 jmp active_delay_0 ;3 cycles jmp $+1 djnz p1, StartPixels ;(4/2) ;pad out the rest nop ;1 nop ;1 nop ;1 nop ;1 ;100 cycles mov w, #$19 mov d1, w active_pad_0: decsz d1 jmp active_pad_0 ret ;My Clear Routine: mov d1, #0 mov d2, #127 StartClear mov DATA_BUS, #( COLOR5 + LUMA2 ) nop ;small delay (13ns -- SRAM is 15ns so this should be enough) nop inc ADDR_BUS_LSB nop nop djnz d1,StartClear inc ADDR_BUS_MSB nop nop djnz d2,StartClear [/code] I will do the LED tests next and post my results. Thanks! ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=101669#m101689 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)