Reply by eilidhs_daddy October 25, 20102010-10-25
The IO Config tool doesn't always make code that works.
Sometime (and yes, I reported this to Rabbit, and they agreed) it makes byte-wide writes to the some of the configuration registers which should really just be bit-wise, which blow away existing bits in those registers causing the processor to just hang.

I see this often, and always use the IO Config tool as a basis and then twek the code it generates.

I can't remember the specifics but it happened to me anytime I was using all the serial ports on an rcm4000

I'll see if I can find the old code....

-Kenny

--- In r..., "Dave McLaughlin" wrote:
>
> Explain in more detail why it doesn't work?
>
> It works here and I am sure for others?
>
> Dave...
> ---
> Very funny Scotty, now beam down my clothes!!!
> ---
> http://www.axoninstruments.biz
> ---
>
> From: r... [mailto:r...] On
> Behalf Of iw2nzm
> Sent: 24 October 2010 15:28
> To: r...
> Subject: [rabbit-semi] Re: RCM4000: Ethernet and serial
>
>
>
> I did, but it doesn't work. Anyway, how to set the serial F on PE2 and PE3?
> The documentation says yes and no in different tables/figures as I said
> before.
>

Reply by iw2nzm October 24, 20102010-10-24
It can't work because the PE2 and PE3 are not connected to the 50-pins connector.
If you look at the schematics of RCM4000 you will see they are configured to bring signals to NAND flash.
Instead the RCM4010 is sold without the NAND flash (and with a couple of 0R0 installed) so the PE2 and PE3 are available.

Honestly I didn't understand this reading the user manual. I had to check the signals' path with a multimeter and then I got confirm from the schematics.

So, are you sure you can use serial F on PE2/PE3 with RCM4000?

Bye
Marco

--- In r..., "Dave McLaughlin" wrote:
>
> Explain in more detail why it doesn't work?
>
> It works here and I am sure for others?
>
> Dave...
> ---
> Very funny Scotty, now beam down my clothes!!!
> ---
> http://www.axoninstruments.biz
> ---
>
> From: r... [mailto:r...] On
> Behalf Of iw2nzm
> Sent: 24 October 2010 15:28
> To: r...
> Subject: [rabbit-semi] Re: RCM4000: Ethernet and serial
>
>
>
> I did, but it doesn't work. Anyway, how to set the serial F on PE2 and PE3?
> The documentation says yes and no in different tables/figures as I said
> before.
>

Reply by Dave McLaughlin October 24, 20102010-10-24
Explain in more detail why it doesn't work?

It works here and I am sure for others?

Dave...
---
Very funny Scotty, now beam down my clothes!!!
---
http://www.axoninstruments.biz
---

From: r... [mailto:r...] On
Behalf Of iw2nzm
Sent: 24 October 2010 15:28
To: r...
Subject: [rabbit-semi] Re: RCM4000: Ethernet and serial

I did, but it doesn't work. Anyway, how to set the serial F on PE2 and PE3?
The documentation says yes and no in different tables/figures as I said
before.
Reply by iw2nzm October 24, 20102010-10-24
I did, but it doesn't work. Anyway, how to set the serial F on PE2 and PE3? The documentation says yes and no in different tables/figures as I said before.

Please, if you are sure it's possible, may you tell me how to?
When I try to write the PEFR the MCU hangs up.

Furthermore I've just tried another way:

the PE2-PE3 (pins 34-35 of the MCU) are not connected to the connector pins 34-35.
In fact, the schematics of RCM4000 shows they are disconnected from MCU due to the NAND flash configuration.

It is possible to change the hw configuration in order to use PE2/3 and NOT the NAND flash?

Marco

--- In r..., "Dave McLaughlin" wrote:
>
> Although the application is pretty bad, use the IO config tool to configure
> all your IO and then you only have to make one call to setup the ports. I
> have all 5 serial ports working before with the RCM4000 so it is possible.
> You can see this in the IOconfig tool.
>
>
> Dave...
> ---
> Very funny Scotty, now beam down my clothes!!!
> ---
> http://www.axoninstruments.biz
> ---
>
> From: r... [mailto:r...] On
> Behalf Of iw2nzm
> Sent: 24 October 2010 01:44
> To: r...
> Subject: [rabbit-semi] Re: RCM4000: Ethernet and serial
>
>
>
> Perhaps I'm wrong. And I will be very happy to be:
>
> may I use the serial F on PE2/PE3?
>
> The RCM4000 user manual:
>
> http://www.rabbit.com/documentation/docs/manuals/RCM4000/RC4000UM.pdf
>
> says yes in both table 2 and table 3.
> But figure 7 says only PE0 is available.
>
> It the figure is right it's *impossible* to use serials C, D and F at the
> same time!
>
> I think the documentation is not very handy on this topic.
>
> Marco
>

Reply by Dave McLaughlin October 24, 20102010-10-24
Although the application is pretty bad, use the IO config tool to configure
all your IO and then you only have to make one call to setup the ports. I
have all 5 serial ports working before with the RCM4000 so it is possible.
You can see this in the IOconfig tool.

Dave...
---
Very funny Scotty, now beam down my clothes!!!
---
http://www.axoninstruments.biz
---

From: r... [mailto:r...] On
Behalf Of iw2nzm
Sent: 24 October 2010 01:44
To: r...
Subject: [rabbit-semi] Re: RCM4000: Ethernet and serial

Perhaps I'm wrong. And I will be very happy to be:

may I use the serial F on PE2/PE3?

The RCM4000 user manual:

http://www.rabbit.com/documentation/docs/manuals/RCM4000/RC4000UM.pdf

says yes in both table 2 and table 3.
But figure 7 says only PE0 is available.

It the figure is right it's *impossible* to use serials C, D and F at the
same time!

I think the documentation is not very handy on this topic.

Marco
Reply by iw2nzm October 23, 20102010-10-23
Perhaps I'm wrong. And I will be very happy to be:

may I use the serial F on PE2/PE3?

The RCM4000 user manual:

http://www.rabbit.com/documentation/docs/manuals/RCM4000/RC4000UM.pdf

says yes in both table 2 and table 3.
But figure 7 says only PE0 is available.

It the figure is right it's *impossible* to use serials C, D and F at the same time!

I think the documentation is not very handy on this topic.

Marco

--- In r..., Tom Collins wrote:
>
> On Oct 23, 2010, at 2:33 AM, iw2nzm wrote:
> > serCopen(19200L);
> > WrPortI(SCCR,&SCCRShadow, 0x02);
> > serDopen(115200L);
> > WrPortI(SDCR,&SDCRShadow, 0x03);
> > serFopen(57600L);
> > WrPortI(SFCR,&SFCRShadow, 0x23);
> >
> > WrPortI(PBDDR,&PBDDRShadow,0xFF); // Port B Input and output Pins
> > WrPortI(PCAHR,&PCAHRShadow,0xC0); // Port C Input and output Pins
> > WrPortI(PCFR,&PCFRShadow,0x15); // Port C Input and output Pins
> > WrPortI(PEAHR,&PEAHRShadow,0x44); // Port E Input and output Pins
> > WrPortI(PEALR,&PEALRShadow,0x30); // Port E Input and output Pins
> > WrPortI(PEDDR,&PEDDRShadow,0xA4); // Port E Input and output Pins
> > WrPortI(PEFR,&PEFRShadow,0xA4); // Port E Input and output Pins
> > WrPortI(TAT1R,&TAT1RShadow,0xFF); // Timer C
> > WrPortI(TCCSR,&TCCSRShadow,0x01); // Timer C
> > WrPortI(TCDHR,NULL, 0xE3); // Timer C
> > WrPortI(TCDLR,NULL, 0xCD); // Timer C
> Try letting RS232.lib take care of the port initializations for you. I think that the function help for serCopen lists macros you can set in your program to control which pins are used for Tx and Rx for each serial port (if you're not using the default pins).
>
> Your serial initialization should be as simple as:
> serCopen(19200L);
> serDopen(115200L);
> serFopen(57600L);
>
> At that point, you can read and write each serial port, and the timers are set up correctly for the baud rates requested.
>
> -Tom
>

Reply by Tom Collins October 23, 20102010-10-23
On Oct 23, 2010, at 2:33 AM, iw2nzm wrote:
> serCopen(19200L);
> WrPortI(SCCR,&SCCRShadow, 0x02);
> serDopen(115200L);
> WrPortI(SDCR,&SDCRShadow, 0x03);
> serFopen(57600L);
> WrPortI(SFCR,&SFCRShadow, 0x23);
>
> WrPortI(PBDDR,&PBDDRShadow,0xFF); // Port B Input and output Pins
> WrPortI(PCAHR,&PCAHRShadow,0xC0); // Port C Input and output Pins
> WrPortI(PCFR,&PCFRShadow,0x15); // Port C Input and output Pins
> WrPortI(PEAHR,&PEAHRShadow,0x44); // Port E Input and output Pins
> WrPortI(PEALR,&PEALRShadow,0x30); // Port E Input and output Pins
> WrPortI(PEDDR,&PEDDRShadow,0xA4); // Port E Input and output Pins
> WrPortI(PEFR,&PEFRShadow,0xA4); // Port E Input and output Pins
> WrPortI(TAT1R,&TAT1RShadow,0xFF); // Timer C
> WrPortI(TCCSR,&TCCSRShadow,0x01); // Timer C
> WrPortI(TCDHR,NULL, 0xE3); // Timer C
> WrPortI(TCDLR,NULL, 0xCD); // Timer C
Try letting RS232.lib take care of the port initializations for you. I think that the function help for serCopen lists macros you can set in your program to control which pins are used for Tx and Rx for each serial port (if you're not using the default pins).

Your serial initialization should be as simple as:
serCopen(19200L);
serDopen(115200L);
serFopen(57600L);

At that point, you can read and write each serial port, and the timers are set up correctly for the baud rates requested.

-Tom
Reply by iw2nzm October 23, 20102010-10-23
Hello again.

I still have some problems.
At first I want to get the board working only with serials.

This is my initialization routine:

serCopen(19200L);
WrPortI(SCCR,&SCCRShadow, 0x02);
serDopen(115200L);
WrPortI(SDCR,&SDCRShadow, 0x03);
serFopen(57600L);
WrPortI(SFCR,&SFCRShadow, 0x23);

WrPortI(PBDDR,&PBDDRShadow,0xFF); // Port B Input and output Pins
WrPortI(PCAHR,&PCAHRShadow,0xC0); // Port C Input and output Pins
WrPortI(PCFR,&PCFRShadow,0x15); // Port C Input and output Pins
WrPortI(PEAHR,&PEAHRShadow,0x44); // Port E Input and output Pins
WrPortI(PEALR,&PEALRShadow,0x30); // Port E Input and output Pins
WrPortI(PEDDR,&PEDDRShadow,0xA4); // Port E Input and output Pins
WrPortI(PEFR,&PEFRShadow,0xA4); // Port E Input and output Pins
WrPortI(TAT1R,&TAT1RShadow,0xFF); // Timer C
WrPortI(TCCSR,&TCCSRShadow,0x01); // Timer C
WrPortI(TCDHR,NULL, 0xE3); // Timer C
WrPortI(TCDLR,NULL, 0xCD); // Timer C
it hangs (both in debug or release mode) when I configure port C and port E.

If I don't configure them I can't receive data on serials, of course.

Where am I wrong?

Thanks!
Marco

Reply by iw2nzm October 19, 20102010-10-19
> The Ethernet will work because it has it's own clock, independent of the
> CPU clock. The RCM4000 CPU doesn't run at 20MHz -- it uses the CPU clock
> of 29.49MHz, doubled to 58.98MHz.
>
> I haven't used the I/O configurator, but I imagine you should use the CPU
> clock speed of 29.49MHz. The I/O configurator doesn't need to know
> anything about the separate 20MHz clock that drives the Ethernet
> interface.
Ok, thank you very much.
Tomorrow I'll try that way.

Marco

Reply by Tom Collins October 19, 20102010-10-19
iw2nzm said:
>
> Thank you for your answer.
> I almost got it but there is a thing I don't understand.
>
> You say: "The RCM4000 uses a 20MHz clock for the Ethernet, and a 29.49MHz
> clock, doubled to 58.98MHz as the processor clock."
>
> But I must set the clock to 20.000 MHz in order to run the Ethernet (in
> fact on the board there is a 20 MHz crystal).
>
> If in the I/O configurator I set the clock to 29.49MHz clock, doubled to
> 58.98MHz the eth won't work.
>
> Please may you clarify this point?
>
> Thanks again!
> Marco
>

The Ethernet will work because it has it's own clock, independent of the
CPU clock. The RCM4000 CPU doesn't run at 20MHz -- it uses the CPU clock
of 29.49MHz, doubled to 58.98MHz.

I haven't used the I/O configurator, but I imagine you should use the CPU
clock speed of 29.49MHz. The I/O configurator doesn't need to know
anything about the separate 20MHz clock that drives the Ethernet
interface.

-Tom