I'm happy to report that both breakout boards seem to work perfectly!
As a test, I implemented the logic from my other recent post on RDY single stepping (
viewtopic.php?f=4&t=7641). Here is my source code for that:
Code:
Name singlestep ;
PartNo 00 ;
Date 15/07/2023 ;
Revision 01 ;
Designer Adrien Kohlbecker ;
Company - ;
Assembly None ;
Location ;
Device f1508ispplcc84 ;
/* Enable pull ups on JTAG interface */
PROPERTY ATMEL { TDI_PULLUP = ON };
PROPERTY ATMEL { TMS_PULLUP = ON };
/* Pin and pinnode definitions */
PIN = CLK; // CPU PHI2 Clock
PIN = SYNC; // CPU SYNC Output
PIN = RDY; // CPU RDY Input (Warning: use open-collector output)
PIN = STEPB; // Step control input (low-going pulse)
PIN = HALT_RUNB; // Enable single stepping (high), or run the CPU freely (low)
PIN = INST_CYCLEB; // Single step per instruction (high), or per clock cycle (low)
PIN = IOCLK; // Stretched clock output
PINNODE = RDY_1; // Internal RDY bit (needed to implement pseudo open-collector output)
PINNODE = STEP_STATE; // Internal state storage
PINNODE = STEPB_1; // STEPB input synced with the clock to prevent metastability (only one needed for double flopping because RDY is also registered)
PINNODE = INST_CYCLEB_1; // INST_CYCLEB input synced with the clock to prevent metastability (only one needed for double flopping because RDY is also registered)
PINNODE = HALT_RUNB_1; // HALT_RUNB input synced with the clock to prevent metastability (1/2)
PINNODE = HALT_RUNB_2; // HALT_RUNB input synced with the clock to prevent metastability (2/2)
/* Synchronising inputs to the clock (double-flopping) */
HALT_RUNB_1.D = HALT_RUNB;
HALT_RUNB_1.CK = CLK;
HALT_RUNB_2.D = HALT_RUNB_1;
HALT_RUNB_2.CK = CLK;
STEPB_1.D = STEPB;
STEPB_1.CK = CLK;
INST_CYCLEB_1.D = INST_CYCLEB;
INST_CYCLEB_1.CK = CLK;
/* RDY signal generation */
RDY_1.D = STEP_STATE & STEPB_1;
RDY_1.CK = CLK;
RDY_1.AP = ! HALT_RUNB_2;
/* Pseudo open-collector output, easier than adding the proper option on the command line arguments. */
RDY = 'b'0;
RDY.OE = ! RDY_1;
/* Internal state store */
STEP_STATE.AP = !(STEPB_1 # STEP_STATE);
STEP_STATE.AR = !(!RDY # INST_CYCLEB_1);
STEP_STATE.CK = SYNC;
STEP_STATE.D = 'b'0;
/* Output clock streched with RDY (stays high as long as RDY is low) */
IOCLK = CLK # !RDY;
I then programmed both an ATF1504 and an ATF1508, using ATMISP and the official ATDH1150USB, and built a testing setup using push buttons, DIP switches and LEDs. The CPLDs were happily programmed and the logic seem to work as it should.
Attachment:
IMG_9991.jpeg [ 443.57 KiB | Viewed 54542 times ]
Attachment:
IMG_9990.jpeg [ 446.95 KiB | Viewed 54542 times ]
As for a second revision of the boards, that project has kind of turned into a full-featured development board PCB including 12V programming, programmable clock, reset signal, etc. I plan on keeping the breakout board design shown here for quick and dirty projects, as the new version will include a lot of more advanced circuitry which is not always needed. More details to come in another post.