Re: [Fx2lib-devel] Change sync delay macro (Daniel O'Connor)
Status: Beta
Brought to you by:
mulicheng
From: Daniel O'C. <doc...@gs...> - 2011-03-02 23:11:34
|
On 03/03/2011, at 9:37, Dennis Muhlestein wrote: > I never edited the gpif files. I used the converter script (supplied by > fx2lib). Reason being fx2lib has it's own gpif functions that used the Ahh, I forgot about that. > macro as SYNCDELAY(). You only need the byte arrays from the gpif.c > file produced by the gpif designer, not the whole file, which like you > say, was targeted for Keil. I don't recall but there may be other > things that didn't work correctly in the generated file. You'll have to > compare with the fx2lib gpif functions to double check. I have an unmodified file working, it wasn't too hard to get working, I have 2 shim files. fx2.h -> #include <fx2types.h> #include <fx2macros.h> #include <delay.h> #define xdata __xdata fx2sdly.h -> /* IFCLK 48MHz, CPU clock 48MHz */ #define SYNCDELAY SYNCDELAY3 To be honest, after using the GPIF designer a few times I was sorely tempted to write a bunch of macros to generate the GPIF data words :-/ > > On 03/02/2011 03:15 PM, Daniel O'Connor wrote: >> >> On 02/03/2011, at 4:11, -t wrote: >>> Hi, >>> I modified SYNCDELAY to match the Cypress version - this is useful because GPIF designer generates code which calls it and it's a pain to re-edit the file each time you change your design. >>> >>> ---> Hi Daniel, sync delay is used in more places that just GPIF implemenations. Various registers are gated by different clock domains. When the CPU writes to these specific registers the contents may not be updated if the sync delay is not executed. The amount of delay is dependent on the two main clock domains. All the details of sync delay can be reviewed in the Cypress TRM. This one originally had me scratching my head for several days... Hope this helps :)<--- >> >> I understand that, however when you generate a file with GPIF designer it uses SYNCDELAY; vs fx2lib's SYNCDELAY(); >> >> My change alters the calling convention to match Cypress so you don't have to edit the generated file each time. >> >> -- >> Daniel O'Connor software and network engineer >> for Genesis Software - http://www.gsoft.com.au >> "The nice thing about standards is that there >> are so many of them to choose from." >> -- Andrew Tanenbaum >> GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C >> >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> Free Software Download: Index, Search& Analyze Logs and other IT data in >> Real-Time with Splunk. Collect, index and harness all the fast moving IT data >> generated by your applications, servers and devices whether physical, virtual >> or in the cloud. Deliver compliance at lower cost and gain new business >> insights. http://p.sf.net/sfu/splunk-dev2dev > > > ------------------------------------------------------------------------------ > Free Software Download: Index, Search & Analyze Logs and other IT data in > Real-Time with Splunk. Collect, index and harness all the fast moving IT data > generated by your applications, servers and devices whether physical, virtual > or in the cloud. Deliver compliance at lower cost and gain new business > insights. http://p.sf.net/sfu/splunk-dev2dev > _______________________________________________ > Fx2lib-devel mailing list > Fx2...@li... > https://lists.sourceforge.net/lists/listinfo/fx2lib-devel > -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C |