Porting from MOD5272 to MOD5270

Discussion to talk about hardware related topics only.
DBrunermer
Posts: 67
Joined: Thu Apr 21, 2011 7:06 am
Location: Pittsburgh, PA

Porting from MOD5272 to MOD5270

Post by DBrunermer »

Is there any kind of article available that talks about porting a project from the 5272 to the 5270? I mean, I know the obvious speed difference, but does anyone have experience doing this, and can you tell me how hard it was for you? Thank you, Dan Brunermer
User avatar
TomNB
Posts: 538
Joined: Tue May 10, 2016 8:22 am

Re: Porting from MOD5272 to MOD5270

Post by TomNB »

The answer is: it depends on how you wrote you application. For example, all the example in \nburn\examples\standardstack build for any of the platforms without any changes. That is 118 examples as of the current release covering tcp, udp, serial, i2c, spi, html, file system, to name just a few. So extremely compatible. No changes at all.

The 5272 and 5270 are different processors, so if you have your own custom code that controls something processor specific, you may need to change a few lines of code. For example, the timer configuration registers may be different. You can make use of the platform #define to use the same source code on multiple platforms if you have a few lines of code to change. For example:

#if (defined MOD5272)
// 5272 code
#elif (defined MOD5270)
// 5270 code
#endif

If you are porting you may want to look at the MOD54415, our latest core module. Great price, 32MB Flash, 64MB DDR2 ram, 250MHz processor. Extremely fast with nearly every peripheral you an think of, nclude a/d, d/a, multiple spi, multiple i2c, 8 serial ports, single or dual Ethernet, lots of good stuff. https://www.netburner.com/products/core ... s/mod5441x
DBrunermer
Posts: 67
Joined: Thu Apr 21, 2011 7:06 am
Location: Pittsburgh, PA

Re: Porting from MOD5272 to MOD5270

Post by DBrunermer »

Hi Tom, thanks for the quick reply! My long term plan is to migrate to the MOD5441X. I actually have a dev-kit here, and a redesigned board to test it on, but I've been having a really tough time porting to that. It's so much more capable; I've been having a tough go figuring out how to map the interrupts and timers and function calls. I'll get it eventually I'm sure, it's just been tough.

The 5272 I'm using now is using your OS, so it sounds like I should be mostly OK. Here's a typical function I might have:

void SetupEncSyncUnit( void )
{
// This function will map the external encoder sync function. Normally, the FC_DONE line from the CPLD is used to signal
// the CPU that data can now be latched and loaded. In this case, the FC_DONE line is being reused for ENC_LOCK. Then,
// after the INT has been raised, the CPLD goes back to normal mode. Likewise, after the ENC_LOCK int is finished,
// the CPU must remap to the old FC_DONE from frequency firing
sim.pitr &= 0xDFFFFFBF;
sim.icr4 = 0x08000000;
vector_base.table[90] = (long)&SyncEncImage;
sim.icr4 = 0x0D000000;
return;
}

Would something like this get broken, or would it be a 1 to 1 kind of change?

Thanks again, Dan B.
User avatar
TomNB
Posts: 538
Joined: Tue May 10, 2016 8:22 am

Re: Porting from MOD5272 to MOD5270

Post by TomNB »

For anything like that you would need to compare the sim registers and vector table for each processor. The 5272 and 5270 are both V2 cores, so it might be the same. I wish the processor numbers were done in ascending order. Its not obvious that the 5270 is a newer faster part than the 5272. The second number is the core number, so the 5441x family is a V4 core. You will need to make some changes to code such as this for the V4. They also refer to all the timers as DMA Timers, but they are really just timers you can use for anything you want.
DBrunermer
Posts: 67
Joined: Thu Apr 21, 2011 7:06 am
Location: Pittsburgh, PA

Re: Porting from MOD5272 to MOD5270

Post by DBrunermer »

In my MOD5272 design, I use some of the Port C pins for GPIO. I see that's configurable on this processor, but I'm wondering if I can set the data bus to just 16 bits, or will that screw up something on the Netburner module itself?
Vernon
Posts: 177
Joined: Sat Oct 10, 2009 6:33 pm

Re: Porting from MOD5272 to MOD5270

Post by Vernon »

TomNB wrote: If you are porting you may want to look at the MOD54415, our latest core module. Great price, 32MB Flash, 64MB DDR2 ram, 250MHz processor. Extremely fast with nearly every peripheral you an think of, nclude a/d, d/a, multiple spi, multiple i2c, 8 serial ports, single or dual Ethernet, lots of good stuff. https://www.netburner.com/products/core ... s/mod5441x
Totally agree - this module is awesome especially considering it is only $20 more than the 5270. Just having on board A/D is worth it even if it didn't have the performance advantage. No more 5270 for me.
DBrunermer
Posts: 67
Joined: Thu Apr 21, 2011 7:06 am
Location: Pittsburgh, PA

Re: Porting from MOD5272 to MOD5270

Post by DBrunermer »

I don't disagree, and I'm moving in that direction ultimately. But the problem is, for that one, the package size is different, and I literally have to redesign the rest of my product to make space for it. We're a 10# of crap in a 5# bag kind of place, and I just don't have .3" of extra space for it.

But in the meantime, do you know if Port C can still be used for GPIO, or does it have to be a 32 bit data bus?
User avatar
TomNB
Posts: 538
Joined: Tue May 10, 2016 8:22 am

Re: Porting from MOD5272 to MOD5270

Post by TomNB »

Just for reference, the mechanical measurements are identical for the headers, mounting holes and Ethernet jack. It is just that the tail end is a little longer.

Can you give me a page number from the manual you are referring to with the port c question?
DBrunermer
Posts: 67
Joined: Thu Apr 21, 2011 7:06 am
Location: Pittsburgh, PA

Re: Porting from MOD5272 to MOD5270

Post by DBrunermer »

Yeah, so on Page 5 of the "Pinout and Signal Description" PDF for the MOD5270, it lists pins 6-13, 15-20 as Data Bus - Data xx, where xx is 15-0.

In mod5272_datasheet_pinout_diagram, those same pins are just listed as PCxx, where they can be used as general purpose I/O.

What I'm wondering is if I can still use Port C for I/O, or if the platform now only uses these as data lines (maybe it isn't called Port C anymore). I know the CPU can be configured for different sizes based on the devices you have attached, and I know the CPU can be configured for only 16 bits, but if the platform, like your side of the board, needs all 32 bit data lines, then I'm guessing I can't do what I want.

My current design on the MOD5272 uses J2.23, PC3, as an enable/disable to a FET for controlling a relay. I do this at startup
// NEW Voltage Enable Method: Port C
sim.pcddr = 0xFFFF;
sim.pcdat = 0x0000;
That sets port C for outputs and turns them off. When I want it on, I write:
sim.pcdat |= 0x0008;
When I want it off I write:
sim.pcdat &= 0xFFF7;

On the 5272, the manual says it's controlled by WSEL on reset. I'm kind of assuming that it's held high during reset for 16 bit data bus. I haven't found the corresponding bit for the 5270 yet, and don't know if it's the same. Maybe it's not an option and I'm totally wrong.

Does that clarify the question? Thanks, Dan B.
User avatar
pbreed
Posts: 1080
Joined: Thu Apr 24, 2008 3:58 pm

Re: Porting from MOD5272 to MOD5270

Post by pbreed »

You can not use the data bus on EITHER the 5270 or 5272 as GPIO.
To do so would cause the system to stop executing correctly....
Post Reply