On Mon, 2011-10-03 at 17:41 -0400, V G wrote: > I know that FPGAs aren't *meant* to do this, and this is the sort of thin= g > that microcontrollers do, but what's the best way to get an FPGA to execu= te > some sequence of codes (in Verilog). >=20 > For example: >=20 > write 0x00 to port A > sleep 10ms > write 0x0F to port A > sleep 10ms > read port A to memory (either block RAM or SRAM) >=20 >=20 > I've read about state machines, but what else? State machines. Seriously, what else would you need? What's wrong with a state machine? Are you having trouble understanding how to code one? I'm sure you could cobble together some other structure (I'm envisioning timers and some ugly chunk of combinational logic), but chances are the synthesizer would get confused, and you'd end up with a design that either wouldn't meet timing and tell you, or a design that wouldn't meet timing without any warning that it wouldn't meet timing (meaning lots of debugging a design that works perfectly in SIM but not in the FPGA, take my advice, stay as FAR away from this situation as possible, it's not a fun place to be). FPGAs are VERY flexible in many ways, but are also VERY specific on the kind of structures they correctly/efficiently support. That said, as you mention, if you want to do "the sort of things that microcontrollers do", use a micro (either discrete or embedded). It's similar to using the right tool for the right job. A hammer can certainly put a screw into a wooden board, but a screwdriver is such much better. FWIW there are free 16F84 cores our there you can embed in your FPGA if you'd like to stay in the PIC world. TTYL --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .