Cypress GPIF waveform behavioral model

I sent an email to the fx2lib mailing list that I thought would make good information for a bigger audience. Eventually, I’ll probably provide a Verilog behavioral model for the GPIF on the Cy7C68013 (and variants), but for now, this may help a few of you:

  • Rdy0,1, txpire etc, are registered (The data 7:0 is too). That means if Rdy0, rdy1 are true when the decision point tests them, that they were actually set during the previous clock cycle.
  • When you enter a state, any control lines you set are registered out. That means if you set ctl0 high on state 2, that whatever you connect to the gpif receives the high a clock cycle later.

I started to develop a behavioral model for this. It goes something like this if you are familiar with Verilog:

reg [2:0] state;
reg rdy0_r, rdy1_r;
reg ctl0_r,ctl1_r,ctl2_r;
reg data_r[7:0];
always @(posedge clk) begin
rdy0_r <= // rdy0 signal
rdy1_r <= // rdy1 signal
data_r <= // data signals
case (state)
  STATE0:
   begin
     ctl0_r <= // state 0 ctl0 state
     // example decision point logic
     if (rdy0_r) begin
        state <= STATE1;
     end
   end
  STATE1:
    ctl2_r <= // whatever you set the control lines to in state 1.
   // example read state // do something with data  
    someoutput <= data_r; // whatever
    if ( !rdy0_r) begin // decision point logic
     state <= STATE2;
   end
  STATE2:      
   // etc... I don't yet have code to dynamically read the gpif output 
   // so until then, I just coded each state the same as I did in the
   // gpif designer.
endcase
end

Anyway, I was able to get a functioning simulation of my device from the perspective of the 8051 by modeling the GPIF this way. When I get some time, I'd like to make this generic enough to parse the GPIF designer output and model each state dynamically so the simulation can simply call the single read, single write, and fifo waveforms and the model will execute the waveform correctly. For now, if you're going down this road of simulation, you should be able to simply mimic your GPIF waveform this way.

Enjoy!

Posted in Hardware, Programming | Tagged , , , , , , , | 4 Comments

Java upload handler for YUI Image Uploader

Vijay Oruganty has been kind enough to provide a Java upload handler for the YUI Rich text image uploader.

I’ve attached the Eclipse project here.

Here is Vijay’s comments on the project:

[the attached file] has the whole eclipse project including the required libraries to build the project using ant. It has the compiled classes and the binary war (lib/ic_editor.war). The main java source (the upload handler) is iic_editor/src/com/hrbfa/iceditor/controller/RequestProcessor.java’,

Feel free to comment or ask questions about the project on this post.

Posted in Programming | Tagged , , , , | 8 Comments

Quick SSH Tip

I’d wager many of you know this already. Having done this a couple times the last two days though, I thought I’d add it for those that don’t. Maybe it’s useful to someone.

Problem: You want to log into a remote server with SSH and you don’t want to type a password. You know about key pairs and authorized_keys and are ready to copy your public key. You might be tempted to do it like this:

  1. SCP your identity to the remote machine (have to type your password again).
  2. ssh to the remote server (have to type your password again)
  3. append the public id to the authorized keys file
  4. delete the copied file
  5. Exit
  6. try the keyless login

Here is where you can save a few steps. You can append the file with ssh instead of copying the file over with scp. This saves you a login and typing your password once.

cat id_dsa.pub | ssh remote_server "cat >> [path to user home]/.ssh/authorized_keys[2]"

There. Type your password once for the copy and then test the passwordless login.

Posted in System Administration | Tagged , , | 5 Comments

The further declining value of Turbotax and Quicken

Last year I posted a rant on the declining value of Turbotax and Quicken. I just finished filing my taxes for the 2008 tax year and thought I’d write a quick follow up after sticking to my guns for the 2008 year.

Summary:

  • I dropped Quicken altogether. I switched to an Open Source Free program called GnuCash. This might not be for everyone, but for me personally, I love it. You can review yourself some of the GnuCash features if you like. I personally switched because of the way I was able to do Budgeting with GnuCash.
  • I dropped Turbotax this year too. A quick Google search before I started doing my taxes yielded a number of online tax services. The highest rated were Taxact and TurboTax. Because I had my previous years data in TurboTax, I went ahead and entered this year’s data. Then, I entered all my information into Taxact. I was pleasantly surprised that the numbers came out exactly the same. (They should, the forms are standard and it’s all just math basically.)

    So Taxact costs $16.95 for Federal + State and TurboTax costs ~$64.50. I will admit that some of the interface issues that TurboTax offers are a little nicer than Taxact, but for me, I’ll use the extra ~$50 somewhere else.

Posted in Miscellaneous | Tagged , , , , , | 1 Comment

fx2lib documentation and source download

I’ve uploaded documentation and a source download for fx2lib. Here is the copy of the Sourceforge announcement.

The fx2lib sources are stable enough to build complete firmware implementations for the cypress fx/fx2 variants of the 8051 chipset.
The current release includes library functions for:

  • delay functions
  • endpoint functions
  • register definitions
  • type definitions
  • macros for common tasks
  • GPIF functions
  • i2c functions
  • serial IO
  • USB jump tables
  • vendor commands and setup data.

Library documentation is located at: http://fx2lib.sourceforge.net/docs/

Sources can be downloaded from the project download page: https://sourceforge.net/project/showfiles.php?group_id=247216

Development on fx2lib occurs in a git repository at: http://github.com/mulicheng/fx2lib/

Check out my other posts on fx2 programming for reference. If you are interested, there is much information to discuss on the fx2lib mailing list too. Check the fx2lib home page for information on joining the list.

Posted in Programming | Tagged , , , , , | Comments Off on fx2lib documentation and source download

Converting financial CSV data to OFX or QIF import files

As a side project, I created a CSV to OFX converter that applies custom mappings to CSV data to export them to QIF or OFX files. This morning, I added the ability to override the built-in mappings with custom mappings that suite your needs.

Basically, you can take financial data from any institution and modify one of the existing mappings to provide the information needed for each export format. Once you’ve done that for your bank, you can import CSV data and export OFX or QIF for import into whichever financial software you prefer.

csv2ofx requires wxPython. You can retrieve the latest source with git:

> git clone git://github.com/mulicheng/csv2ofx.git 
> cd csv2ofx
> # use csv2ofx from the source directory
> ./csv2ofx
> # or install it site-wide
> python setup.py install
> # csv2ofx installed in path

You may also download a zip or tar archive from github if you prefer to grab a copy but don’t want to track the source repository. Go to the source repository for csv2ofx and click the download link.

There are directions in src/mappings.py and the README file for modifying mappings to suite your needs.

Contributions are welcome. Enjoy.

Update: 02/17/10
Added MS Money Rep and UBS support to csv2ofx

Posted in Software | Tagged , , , , , , | 17 Comments