6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat May 11, 2024 1:53 pm

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: FLIP-FLOP FLOP
PostPosted: Fri Nov 05, 2010 9:45 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8178
Location: Midwestern USA
I've been trying to implement a wait-state generator in either a 16V8 or 22V10 GAL and just can't seem to get a working flip-flop going. The code I've hacked together so far looks like this:

Code:
Name      flipflop;
PartNo    00;
Date      10/28/2010;
Revision  01;
Designer  BigDumbDinosaur;
Company   BCS Technology Limited;
Assembly  None;
Location  ;
Device    g22v10;

pin 1     = c;
pin 2     = d;
pin 3     = clr;
pin 4     = pre;
pin 13    = oenab;

pin 14    = q1;
pin 15    = !q2;

d         = q2.dq;
q1        = c & d;


WINCUPL refuses to compile this mess for reasons that totally elude me. Any suggestions?

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Nov 05, 2010 10:40 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
Are you sure that the 20V10 supports flip flops. The help guide contains the warning:

"Note that the compiler supports only the flip-flop capabilities that are physically implemented in the device. For example, the compiler does not attempt to emulate a JK-type flip-flop in a device that only has D-type registers. Any attempt to use capabilities not present in a device will cause the compiler to report an error."

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Nov 05, 2010 10:48 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
If you look in the DevHelp.pdf file you can see what features are supported on different chips. For the 22V10 you have:

G22V10 Architecture
Mnemonic: G22V10 PLCC Mnemonic: YES (G22V10CPLCC)
DIP Pin Count: 24 Total Product Terms: 132
Extensions: OE D AR SP Pin Controlled Power Down: Yes

Where as the ATF1508 is

F1508ispplcc84 Architecture
Mnemonic: F1508ispplcc84 Mnemonic: PLCC
Pin Count: 84 Total Product Terms: 320
Extensions: D T S R OE OEMUX CK CKMUX AR DQ LQ IO IOD IOL
IOCK IOAR

CUPL adjusts to match the features of the target device. Its not a common language across all devices.

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
 Post subject: FLIP-FLOP FLOP
PostPosted: Fri Nov 05, 2010 11:04 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8178
Location: Midwestern USA
According to the Atmel data sheet, the 22V10 has both combinatorial and registered outputs. I quote from page 8 of the data sheet:

The ATF22V10CZ/CQZ has 12 inputs and 10 I/O macrocells. Each macrocell can be configured into one of four output configurations: active high/low, registered/combinatorial output.

The availability of registered outputs should make it possible to implement a flip-flop. Note that the smaller 16V8 has registered outputs available as well. I choose the 22V10 because I needed more outputs.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Nov 05, 2010 11:23 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8178
Location: Midwestern USA
BitWise wrote:
Where as the ATF1508 is

F1508ispplcc84 Architecture
Mnemonic: F1508ispplcc84 Mnemonic: PLCC
Pin Count: 84 Total Product Terms: 320
Extensions: D T S R OE OEMUX CK CKMUX AR DQ LQ IO IOD IOL
IOCK IOAR

CUPL adjusts to match the features of the target device. Its not a common language across all devices.

Good luck trying to get your hands on this part. Also, it's a PLCC84 package and is way beyond my needs.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Nov 06, 2010 3:11 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1685
Location: Sacramento, CA
BDD,

I have adapted this from an Atmel Example (BARREL22). It compiled without errors but I did not verify it worked in WinSim or on hardware. There may be an issue of polarity with the OE pin function.

Note - the ATF22V10 has only asynchronous reset and synchronous preset.

Here's the code:

Code:
Name      Register;
Partno    1;
Date      11/05/10;
Revision  01;
Designer  Daryl;
Company   Rictor;
Assembly  None;
Location  None;
Device    g22V10;

/**  Inputs  **/

PIN 1  = clock;                /* Register Clock       */
PIN 2  = D;                    /* Data Input           */
PIN 3  = clr;
PIN 4  = pre;
PIN 13 = !outen;               /* Output Enable        */

/**  Outputs  **/

PIN 14 = Q1;                   /* Register Output      */
PIN 15 = Q2;                   /* Combinatorial Output */

/** Logic Equations **/

Q1.d   =  D;                   /* data input           */

Q1.sp  = pre;                  /* synchronous preset   */

Q1.oe  = outen;                /* tri-state control    */

Q1.ar  = clr;                  /* asynchronous reset   */

Q2     = !Q1;                  /* inverted output      */


Good luck!

Daryl


Top
 Profile  
Reply with quote  
 Post subject: FLIP-FLOP FLOP
PostPosted: Sat Nov 06, 2010 4:39 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8178
Location: Midwestern USA
8BIT wrote:
I have adapted this from an Atmel Example (BARREL22).

As you say, it does compile. However, it won't simulate. In fact, I tried several of Atmel's examples and while all of them would compile for their target devices without error, none would simulate. Having already run across several bugs in WINCUPL, I'm starting to suspect that this is not a particularly good development environment.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Nov 06, 2010 5:13 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
You could try the state commands
Code:
field state = enb;

$define ON      'b'1
$define OFF      'b'0

sequenced state {

present OFF
   if    res         next ON;
   default next OFF;

present ON
   if   zp & !r_w      next OFF;
   default next ON;
}

This was part of a simple flip flop to control the enabling of a ROM. A reset makes the ROM enabled and it stays that way until the first write to zero page.

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Nov 06, 2010 5:21 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
Here is the complete source and test file. I just tested it on my PC and it both compiles and simulates.

http://www.obelisk.demon.co.uk/forum/SIGNALS.PLD
http://www.obelisk.demon.co.uk/forum/SIGNALS.si

When you run it you should get output like this

http://www.obelisk.demon.co.uk/forum/SIGNALS.PNG

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
 Post subject: Re: FLIP-FLOP FLOP
PostPosted: Sat Nov 06, 2010 8:08 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1685
Location: Sacramento, CA
BigDumbDinosaur wrote:
As you say, it does compile. However, it won't simulate. In fact, I tried several of Atmel's examples and while all of them would compile for their target devices without error, none would simulate. Having already run across several bugs in WINCUPL, I'm starting to suspect that this is not a particularly good development environment.


OK, I took some time this morning to build the WinSim file for my code above, and it did simulate for me. Here is a capture of the output:

Image

Note the synchronous preset in column 7-9, the asynchronous clear in column 13, and the output disable in column 14-15.

While it simulates correctly, it would be best to verify this in hardware.

Complete source, sim, and jed files are located here (winsim.pdf is capture of the sim output):
http://sbc.rictor.org/support/reg.zip

Daryl


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: