avr_mdcart_sram_lite

changeset 7:f14e14abe14c tip

delays?
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 13 Mar 2017 01:10:57 +0200
parents ff8af8351282
children
files main.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/main.c	Sun Mar 12 23:43:41 2017 +0200
     1.2 +++ b/main.c	Mon Mar 13 01:10:57 2017 +0200
     1.3 @@ -190,9 +190,11 @@
     1.4  
     1.5  	/* no need for DDRB change, we drive the bus by default in programming mode */
     1.6  	PORTB = val;	/* set data */
     1.7 +	_delay_us(0.1);
     1.8  
     1.9  	/* pulse WE */
    1.10  	PORTD &= ~WE_BIT;
    1.11 +	_delay_us(0.1);
    1.12  	/* WE should be low for at least 9ns, which is way faster than we can toggle it anyway */
    1.13  	PORTD |= WE_BIT;
    1.14  }
    1.15 @@ -207,7 +209,7 @@
    1.16  
    1.17  	DDRB = 0;			/* release the data bus */
    1.18  	PORTD &= ~OE_BIT;	/* assert OE (output enable) */
    1.19 -	_delay_us(0.1);
    1.20 +	_delay_us(1);
    1.21  	val = PINB;			/* read the data */
    1.22  	PORTD |= OE_BIT;	/* deassert OE */
    1.23  	DDRB = 0xff;		/* take back the bus */