/*due to ITAR government regulations I was warned on what I can say. So I do not want to say the type of equipment and the use of it. I can say what I need in general. I need a ~500ns read cycle of a 27C256 EEPROM on a 300 to 500ns read cycle. I need to go over temperature and be able change the ADDRESS Setup Time to CS time in 20ns steps starting at 80ns.I want to help you, and everyone else here probably does too, but the way you're communicating makes effective help pretty much impossible. We really do help on this forum, but we're not psychics. We can't see your hardware unless you show us photos or clear accurate diagrams. We can't see your code unless you show us. So far the only code you've giving is AI generated without any consideration for the pins actually available on Teensy 4.1, and indeed we have made several suggestions based on that code.
You've said you can't give info because this is work related. But if you can't even show us how the pins are really connected, nobody can give specific and useful answers for the code which controls those pins.
Simply reading a 27C256 (you previously said 27C265 but I'm guessing those last 2 digits are a typo) isn't something special which anyone needs to keep secret. These EPROM chips have been around for over 40 years! I personally build several projects with then in the early 1990s.
If you only need to read the chip, which I specifically asked in msg #17 and you didn't clearly respond yes/no, but if reading the chip is all you need, the best suggestion is in msg #18... just buy a known-good EPROM programmer and use it to read your chip.
Normally going full DIY for something you can just buy is the realm of hobby electronics and education. But if you really want to go that way for some reason I can't understand in the context of business, that's fine. But if you don't tell us why, if we don't understand what you really need and why you're doing this instead of just buying off-the-shelf hardware, our answers can't be based on any understand of what you really need.
Still, we can try anyway. On that...
In msg #15, I suggested you use digitalWriteFast() rather than direct GPIO registers.
To quickly answer your latest question with more "I can't answer"...
Indeed intermittent and unreproducible problems are hard. Usually the path forward involves a combination of better observation of what's really happening, and a lot of experimentation and just thinking about it based on what you observe with each experiment.
I see in msg #19 you're using an oscilloscope to view the waveform. That's good. What's not good is your communication here on this forum. Nothing in msg #19 tells us any essential info needed to form opinion about that oscilloscope screenshot. We can't see your hardware because you haven't show a photo or accurate diagram. We can't see the code you actually ran on Teensy (presumably it's not the non-working AI gen code). The message doesn't even tell us which signal the oscilloscope is showing!
I want you to understand the reason you're not getting more useful help here, when we do really help quite a lot on this forum, is because you are communicating so poorly. If you invest some effort to really show us the hardware, software, and tests you're actually doing, we can and probably will help you much better. But it all depends on your ability to communicate effectively. If you keep us in the dark, the best help anyone can give is generic advice.
And again on generic advice, if this is really for your workplace, just buy a working EPROM programmer. These EPROM chips aren't special. You don't need to DIY build just to read one.
I need a minimum of 16 lines, this works but only with 11 pins active:
*/
#include <Arduino.h>
// Define which GPIO ports you use.
// For high speed on Teensy 4.1, use GPIO6, GPIO7, GPIO8, or GPIO9.
// Example:
// - 8 bits for EEPROM Data (read) mapped to a set of 8 consecutive pins on GPIO6.
// - 20 bits for Address lines (write) mapped across GPIO6/GPIO7 or a dedicated port.
// Mask for 8 data bits (e.g., bits 0 to 7 of GPIO6)
#define DATA_MASK 0x000000FF
// Mask for 20 address bits (e.g., bits 0 to 19 of GPIO7)
#define ADDR_MASK 0x000FFFFF
void setup() {
// Configure 8 Data pins as INPUT (0 in GDIR)
GPIO6_GDIR &= ~DATA_MASK;
// Configure 20 Address pins as OUTPUT (1 in GDIR)
GPIO7_GDIR |= ADDR_MASK;
// Optional: Set MUX to GPIO mode for these pads if they default to a peripheral
// (Ensure your chosen pins are configured as ALT5 / GPIO in IOMUXC)
}
// Function to parallel write a 20-bit address
inline void writeAddress20(uint32_t address) {
// Clear the 20 address bits first, then apply the new 20-bit value
uint32_t currentVal = GPIO7_DR & ~ADDR_MASK;
GPIO7_DR = currentVal | (address & ADDR_MASK);
}
// Function to parallel read 8 data bits from EEPROM
inline uint8_t readData8() {
// Use GPIO6_PSR (Pin Status Register) for accurate physical pin reading
return (uint8_t)(GPIO6_PSR & DATA_MASK);
}
void loop() {
// uint32_t testAddress = 0x01234; // Example 20-bit address (0 to 0xFFFFF)
// 1. Write the 20-bit address in parallel
//051CB -> 01
writeAddress20(0xFFFFF);
writeAddress20(0xFFFFF);
writeAddress20(0xFFFFF);
writeAddress20(0xFFFFF);
writeAddress20(0xFFFFF); // CS goes low
writeAddress20(0xFFFFF); // OE goes low
writeAddress20(0xFFFFF);
// eepromDataCB = readData8();
writeAddress20(0x00000); //visual for scope
writeAddress20(0xFFFFF);
writeAddress20(0x00000);
delayMicroseconds(1);
}