6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Apr 27, 2024 9:15 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Mon Feb 06, 2023 4:52 am 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1207
Location: Soddy-Daisy, TN USA
Good evening everyone.

So I am dusting off my old ATF1508 and the first thing I wanted to do is simply take a clock input and divide it way down to blink an LED.

It's been a while since I did this but I am 90% sure I got it to work previously. But tonight, I am getting errors.
Here is the code I am using (keep in mind I've just about forgotten everything I know about CPLD...lol):

Code:
Name     1508Blink ;
PartNo   ATF1508AS ;
Date     8/27/2021 ;
Revision 01 ;
Designer Engineer ;
Company  Cecil Meeks ;
Assembly None ;
Location Soddy-Daisy, TN USA;
Device   f1508ispplcc84;   /** ATF1508AS with In-System programming **/

/***************** INPUT PINS *********************/
PIN 83   = GCLK;

/**************** OUTPUT PINS *********************/
PIN 27 = BLINK;

/**************** BURRIED STATES ******************/
Pinnode [51..48] = [S3..0];      /** 4-bit counter to divide global clock **/


/**************** Clock Divider ******************/
S3.t = [S2..0];
S2.t = [S1..0];
S1.t = S0;
S0.t = 'b'1;
[S3..0].ck = GCLK;
[S3..0].ce = 'b'1;

BLINK = ![S3..0];



Attached are the errors I am getting (sorry, I can't seem to copy the text from WinCUPL's output).

Any help would be appreciated.

Thanks


Attachments:
Error.png
Error.png [ 9.41 KiB | Viewed 6018 times ]

_________________
Cat; the other white meat.
Top
 Profile  
Reply with quote  
PostPosted: Mon Feb 06, 2023 5:40 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8144
Location: Midwestern USA
cbmeeks wrote:
Code:
Name     1508Blink ;
PartNo   ATF1508AS ;
Date     8/27/2021 ;
Revision 01 ;
Designer Engineer ;
Company  Cecil Meeks ;
Assembly None ;
Location Soddy-Daisy, TN USA;
Device   f1508ispplcc84;   /** ATF1508AS with In-System programming **

/...blah, blah, blah...

BLINK = ![S3..0];  <——— won’t work as expected

Try BLINK = [S3..0]:'h'0 and see what happens. :)

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


Top
 Profile  
Reply with quote  
PostPosted: Mon Feb 06, 2023 12:40 pm 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
cbmeeks wrote:
Code:
/**************** Clock Divider ******************/
S3.t = [S2..0];
S2.t = [S1..0];



I think you need to tell it what operator to use when combining the bits, like this:

Code:
/**************** Clock Divider ******************/
S3.t = [S2..0]:&;
S2.t = [S1..0]:&;


Or test equality with a specific value as BDD said.


Top
 Profile  
Reply with quote  
PostPosted: Mon Feb 06, 2023 3:24 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1207
Location: Soddy-Daisy, TN USA
Thanks! Those suggestions worked and now I can compile.

But I have run into another issue. The ATMISP7 app (that I run under Wine/Linux) cannot find the programmer over the USB cable.

Running the "Scan USB Cable" says nothing is detected.

Have any of you got ATMISP7 to work with Linux? Or, is there another way I an upload the data to the CPLD?

Thanks.

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Mon Feb 06, 2023 5:37 pm 
Offline
User avatar

Joined: Fri Aug 03, 2018 8:52 am
Posts: 745
Location: Germany
hmm, I wonder if it would be easier to set up a full virtual machine running some windows version (like NT/2000/XP) and pass the USB Programmer to the VM than trying to get wine to work with it.


Top
 Profile  
Reply with quote  
PostPosted: Mon Feb 06, 2023 8:51 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1207
Location: Soddy-Daisy, TN USA
Yeah, that's what I used to do. I just didn't want to do that on this new machine.
I actually have a junky old P4 laptop in the garage that runs Windows XP. I might just run the WinCUPL stuff on that machine.

_________________
Cat; the other white meat.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 9 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: