1

I am working with 28c16 2kb parallel eeprom. It has 11 address pins to select one of 2000 bytes we want to work with and 8 I/O pins for reading or writing to that byte. There is an OC (output enable) pin which, when grounded, gives output of selected byte from 8 I/O pins. Similarly, there is a WE (Write enable) pin which, when given low pulse of width less than 1 microsecond, writes to selected byte taking data from I/O pins. The datasheet of this chip says that the width of pulse on WE pin to write onto the selected byte must be between 100 to 1000 nano seconds. The problem is that I want to use arduino to program this chip. But how can I generate 100-1000 nanosecond pulse using arduino? The lowest delay time in arduino is 1 microsecond (1000 ns) plus time taken by digitalWrite and digitalRead functions (working with ports directly still takes more that 120 ns more). So it exceeds 1 microsecond..... Is there any way to generate pulse of width less than one microsecond?

  • 3
    Don't use `digitalWrite` and `digitalRead`, you can work with ports directly as explained [here](http://www.billporter.info/2010/08/18/ready-set-oscillate-the-fastest-way-to-change-arduino-pins/) – Jack Feb 11 '19 at 03:55
  • But that still takes 4 clock cycles which is 124 nanoseconds. Still exceeds .. – Zeeshan Dhillon Feb 11 '19 at 04:03
  • You wrote 100-1000 ns, actually 124 is on the lower bound, increasing it would be even better. – Jack Feb 11 '19 at 04:04
  • I wrote that the total time period of the pulse should be 100-1000 ns. But lowest delay time in arduino is 1 microseconds plus time taken for rising and falling edge. – Zeeshan Dhillon Feb 11 '19 at 04:07
  • 4
    You don't need to use delay at all as long as the instructions executed generate the delay itself. 124ns could be already a reasonable delay that may work so raising and lowering the signal would generate a ~124ns pulse – Jack Feb 11 '19 at 04:11
  • If we see the dataheet, it says that address input is latched on falling edge and data input is latched on rising edge. The address pins must hold state for at least 100 ns and falling edge must take place during this 100ns time. Similarly, the IO pins must hold data for at least 100ns and rising edge must take place during this time period which means that I have to hold the low state of WE pin – Zeeshan Dhillon Feb 11 '19 at 04:18
  • So, you want to generate a pulse less than 100ns? And which arduino are you using and what is its clock frequency? – svtag Feb 11 '19 at 11:06
  • I am using arduino nano with 16MHz but I think that doesn't matter because the delay() or delayMicrosecinds() functions does not depend on clock frequencies. – Zeeshan Dhillon Feb 11 '19 at 12:08
  • @ZeeshanDhillon, if your processor is not capable of handling such a feature, you will need to add hardware that does. A simple transistor, a resistence and a capacitor can arrange such thing. – Luis Colorado Feb 12 '19 at 05:57
  • @ZeeshanDhillon oh yes, delay() depend from the clock frequency, everything with time depending from the clock. – dzuda11 Feb 13 '19 at 14:32
  • @dzuda11 I know delay() work with clock to keep track of time. But it's output does not depend on clock frequency. Minimum output of delay() function is always 1ms whether clock frequency is 16MHz or 72MHz. – Zeeshan Dhillon Feb 13 '19 at 14:37
  • @ZeeshanDhillon I have experience with some project where I downclocked Arduino fro 16Mhz to 8MHz and guess what, my delay(1000) was actually 2 sec, so it depends from compiler also, so if you compile your code for the 32MHz processor, and run on 16MHz your delay(2) will be 1micro sec. Or try adding an external clock to the system.... – dzuda11 Feb 13 '19 at 14:51
  • You changed the oscillator but you did not configure the bootloader to set arduino prescaler to work with 8MHz crystal. That's why you faced timing errors. If I change the clock speed and adjust the bootloader, it wont change anything but to make processing speed slower and if I do what you are sugesting me to, it will ruin everything else that use timers. – Zeeshan Dhillon Feb 13 '19 at 15:02

0 Answers0