Welcome to Laser Pointer Forums - discuss green laser pointers, blue laser pointers, and all types of lasers



help with programmable logic chips?

danq

New member
Joined
Sep 18, 2007
Messages
835
Points
0
I've been trying to mess with programmable logic chips and such...
have no problem defining the logic (havng been a programmer for ~30 yrs), and designing circuits is pretty easy.
But I'm having a real problem getting the logic to the chip! I can't seem to find the right software to go between the design-level and the physical programmer/burner.

There are a half-dozen pretty good design packages made by the chip manufacturers; but they will only go to the physical level on their own chipsets... most of which have hundreds of pins, and I'm trying to stay very compact - I don't really need more than a 20- or 24-pin chip (actually there are only 2 input and 5 output bits needed).

I have a 'universal programmer', a TOP2005 that I picked up cheap; and have designed using TI's version of the old PAL16R8 (TI #TIBPAL16R8) as the object chip. Have gotten a design that works - have tested it with simulation modules; and was able to get output in both VHDL and ABEL formats. But still need to translate one of those to a format the programmer wants (.bin, .hex, .jed) (or to .pld, for WinCupl, from which I can get a .jed file).

I have spent literally dozens of hours trying to get software to match up; I could have generated a binary file manually by now!

Anybody out there who can help me settle this?
suggestions for another way to go?

This is going to be a pretty cool thing once I get it done, and I intend to share it all with LPF folks when there's something to show.

 :)
DanQ
 



Benm

Well-known member
Joined
Aug 16, 2007
Messages
8,113
Points
113
Well, here is what i've been using succesfully on PIC's:

- mikroC language
- microchip PicKit2 programmer + software from microchip to use it

You basically compile your program to a .hex file (which is assembly in a different format) and then load that into the pic chip.

All of this can be much more finicky than you'd expect - the idea is simple but the tools sometimes seem to have a mind of their own ;)
 

razpiroz

New member
Joined
Nov 14, 2008
Messages
1
Points
0
Hi. I'm new to lasers AND microcontrollers, and I'm building a programmable laser using and Arduino board. It's only 35 bucks and the software is robust. The whole Arduino project is open-source, too, which is kind of cool. True, the concept may be beneath your skill level, but if you want quick results, go to Arduino.cc and you'll find what you need.
 

danq

New member
Joined
Sep 18, 2007
Messages
835
Points
0
thanks for all the suggestions - I will definitely check them all out! and report back.
it may take a while before I can get to it, my computer sitting-time is being constrained again... :p

DanQ
 

Bionic-Badger

Well-known member
Joined
Oct 26, 2007
Messages
5,463
Points
83
So the chips and boards that are suggested above are not exactly what you're looking for.  Basic/Java stamps, PICs, etc. are microcontrollers, and use compiled code, not programmable logic.  They're great if you want to write programs, but for actual programmable logic, which is at the gate-level, you'll want to get an FPGA or CPLD.

For my own need, I use Xilinx parts, specifically Spartan 3e's, but there are also nice FPGAs from Altera and others.  I got mine from Sparkfun; however, that may be overkill for your needs, and the board is somewhat large.

For you, the place to start is a site like Digilent which sells FPGAs and CPLDs for prototyping and education.  Since you don't need a lot of IOs or a big programming platform, I'd look at the CoolRunner module they sell on there (bottom).  It's quite inexpensive (< $20), easy to work with, and pretty powerful.  If you're looking to support larger or more powerful designs, you may want to look at their Spartan 3e boards.  The nice thing about those boards is that they come with a lot of prototyping parts, so you can interface with VGA ports, buttons, etc. on the board itself, without having to wire them up yourself.

For programming these devices, the CoolRunner board will need the JTAG USB cable Digilent sells.  It is also compatible with the FPGA product from Sparkfun, which is the actual reason I got one.  The Spartan 3e development boards on Digilent don't need that cable, as they have their own USB programming interface.

For software, look no further than Xilinx's free ISE webpack software.  It will handle all the compiling and bit-file for the device, and for the Spartan 3e development boards, also allow you to program the devices.  For devices that use the JTAG cable, you will still need to use the Adept software from Digilent to transfer the bit file to the device.  I've used both packages and they work very well.

On another note, you might want to determine exactly what your needs are--whether you want to actually get involved with programmable logic as opposed to compiled programs (microcontrollers).  Programmable logic is more complex and more powerful, but often a microcontroller will do everything you need.  As far as microcontrollers go, I like using Arduino boards (I buy mine at Sparkfun).  They feature an Atmel microcontroller, but in a convenient and easy-to-use package that connects to your computer.  They also have a lot of good support libraries for interfacing with virtually any protocol standard (SPI, I2C, one-wire, etc.), and you can write your own custom computer interfaces for it (Flash, etc.) if you can communicate via the serial port (the USB connection acts as a serial port).
 

lasersbee

Well-known member
Joined
Sep 20, 2008
Messages
17,628
Points
113
On another note, [highlight]you might want to determine exactly what your needs are[/highlight]--whether you want to actually get involved with programmable logic as opposed to compiled programs (microcontrollers). Programmable logic is more complex and more powerful, but often a microcontroller will do everything you need.
I concur....
 

Kage

New member
Joined
Mar 5, 2008
Messages
285
Points
0
lasersbee said:
On another note, [highlight]you might want to determine exactly what your needs are[/highlight]--whether you want to actually get involved with programmable logic as opposed to compiled programs (microcontrollers). Programmable logic is more complex and more powerful, but often a microcontroller will do everything you need.
I concur....
Ditto.

If all you need are 7 I/O lines, even a PIC 16F84 would probably be more than enough.
 

danq

New member
Joined
Sep 18, 2007
Messages
835
Points
0
Thanks all... I pretty much decided from the start that what I want is programmable logic, for several reasons.
Today I got into the Lattice site, downloaded their software... looks like it will do the job. This will take a few days to get through a first trial, so if ya don't hear from me, I'm busy with it.
:)
DanQ
 

Benm

Well-known member
Joined
Aug 16, 2007
Messages
8,113
Points
113
So the chips and boards that are suggested above are not exactly what you're looking for. Basic/Java stamps, PICs, etc. are microcontrollers, and use compiled code, not programmable logic. They're great if you want to write programs, but for actual programmable logic, which is at the gate-level, you'll want to get an FPGA or CPLD.
This really depends on needs as suggested. True programmable logic offers better performance than doing the same function in a microcontroller, so if you really need the speed, there is little choice.

If you don't need the performance, starting with PIC's, AVR's and such might be a good choice because it offers a platform that extends. If at some point you need to go beyond the gate level, or require procedural things and such, you already have the development tools and programming hardware there, and it's even likely your existing uC's would suffice.
 

danq

New member
Joined
Sep 18, 2007
Messages
835
Points
0
yeah... and in some ways it might be easier to go that route. But my app is really simple, limited in function and very few I/O bits - basically it just translates momentary pushbutton switch actions to control a laser driver. I know that if I used a micro, it could have a clock and stopwatch and auto-logging of current/voltage/power/temp and video of the beam to the nearest PC via bluetooth; but until Kenom sells gold barrels I'll put that off.

I obviously have size restrictions, so can't use a pre-built card; so I need to stick to a single chip as small as possible, and without outboard components.

I have a 'program' already designed and simulated/verified, all I need to do now is get it compiled and written to a chip.

:)
DanQ
 

Bionic-Badger

Well-known member
Joined
Oct 26, 2007
Messages
5,463
Points
83
The microcontroller would still probably be much better for that. Programmable logic chips are often quite a bit larger than simple microcontrollers since they need to support arbitrary logic, not to mention they're expensive too. You can get some really small and simple PIC chips, like those from Microchip, to do what you need without the extra baggage. Many have internal oscillators, etc. so it's basically power-program-and-go.

Have you actually spec'ed out some hardware you're going to use, or are you just simulating at this point? It's one thing to have a simple design, another to have a piece of hardware that will allow you to realize it.
 

danq

New member
Joined
Sep 18, 2007
Messages
835
Points
0
Bionic-Badger said:
Have you actually spec'ed out some hardware you're going to use, or are you just simulating at this point?  It's one thing to have a simple design, another to have a piece of hardware that will allow you to realize it.
Well, I know that I didn't approach this quite as methodically as I should, at first... I thought it would be just a matter of getting a chip that would be sufficient, then programming it and "there ya go".

Except for the chip, the hardware is my own circuitry. Actually I breadboarded everything already - including discrete logic circuitry! and verified that it works.

Then I just ordered a simple chip to start out with - a TI "TIBPAL16R8" and a programmer that says it will deal with that chip. Did not realize at that time what an ordeal it was going to be to get a high-level compiler to go from design all the way to the programmer format.

The logic circuit that I ended up with was made using "StateCad", because what I'm doing lends itself well to a Finite-State Machine approach. Statecad is a pretty good tool, but it outputs VHDL code and I need then to have a compiler from there to the hardware level.

That's where my long journey got bogged down. The compilers ("synthesis tools") all were limited to the hardware chips of the vendors, and none of them seem to make the old PAL16R8 except TI, which (of course) has no compiler...

But one of the links someone gave me led to Lattice; and they have some 'primitive' stuff still - they call it "Legacy" - and there's software to support it. I think. Last night I tried and failed to get all the way to a .bin, .hex, or .jed, but I'm pretty fuzzy at 2am so will check it out again prob tonight.

Thanks for the link, Bio-b; I wasn't satisfied with the gargantuan size of any of the chips I've seen so far, and will check out that Microchip link straight away.

But I may be mute on this topic for a bit, have limited physical ability and energy recently and must partition it out carefully because I'm falling behind on important things (like prepping the house for winter, tying my shoes, making some shoes to tie...) So, if I don't respond to further discussion for a while, it's not because I'm not interested.
 

Bionic-Badger

Well-known member
Joined
Oct 26, 2007
Messages
5,463
Points
83
$2.50 is pretty expensive if all you want is a state machine encoder. It may even be that the chip is not re-programmable as well, rather the connections are permanently fused during programming. Unless you need extremely fast state-machine encoding, you would probably do better to buy a really cheap microcontroller and write a state machine using that. The package size is also really large compared to many simple microcontrollers, since these devices are designed mostly to replace legacy TTL logic systems with a single chip.
 

danq

New member
Joined
Sep 18, 2007
Messages
835
Points
0
yeah, it looks like I can get more firepower than I need in an 8-lead msop package from Microchip - thanks for the leads!

but today is for gardening...
:)
DanQ
 

Benm

Well-known member
Joined
Aug 16, 2007
Messages
8,113
Points
113
Oh yes, those entry level PIC's come cheap sometimes...

I guess this is also the reason some people use them for the most simplistic off applications (like a 5 input AND gate) - they are easier to keep in stock then a whole array of TLL/CMOS chips. As long as you don't need the speed, it sounds reasonable ;)
 




Top