EmbeddedRelated.com
Forums
Memfault State of IoT Report

PortB question

Started by Sylvain Bissonnette March 3, 2013
1. Goto C:\DCRABBIT_XX.XX\Utilities, then open IOConfig.exe.
2 Change your IO On "Parallel Ports Pin Assignments according to your needs.
3 Klik File - Save Library- typo C:\DCRABBIT_XX.XX\LIB\Rabbit4000\mylibrary.lib in "Library File Pathname"
4. Open mylibrary.lib C:\DCRABBIT_XX.XX\LIB\Rabbit4000 used Dynamic C and see this line:

void BoardInit()
{
// ClockCheck();
// The following differ from BIOS settings
WrPortI(PBDDR,&PBDDRShadow,0xFF); // Port B Input and output Pins
WrPortI(PCDDR,&PCDDRShadow,0xFF); // Port C Input and output Pins
WrPortI(PCFR,&PCFRShadow,0x00); // Port C Input and output Pins
WrPortI(SPCR,&SPCRShadow,0x84); // Port A Input and output Pins
}

5. Open your program from Dynamic C IDE add as follows:

//////////////////////////////////////////////////////////////////////

#use "rcm57xx.lib"
//#use "mylibrary.lib"; // call mylibrary.lib from here OR paste code direct in code

main()
{
int i;

brdInit(); // Press for view this settings
// Select brdInit in "C:\DCRABBIT_10.56\LIB\RABBIT4000\RCM5XXX\RCM57XX.LIB" then
// press Ok, you will see the default settings for your board in here
// Click View Source for edit RCM57xx.LIB you can change the library or directly here but I do not advise it.
// Change library from mylibrary.lib or direct paste as follows:

// paste your config in here
WrPortI(PBDDR,&PBDDRShadow,0xFF); // Port B Input and output Pins
WrPortI(PCDDR,&PCDDRShadow,0xFF); // Port C Input and output Pins
WrPortI(PCFR,&PCFRShadow,0x00); // Port C Input and output Pins
WrPortI(SPCR,&SPCRShadow,0x84); // Port A Input and output Pins

//WrPortI(SPCR, NULL, 0x84); // Port A as output
//WrPortI(PBDDR, &PBDDRShadow, 0xff); // Port B as output
//WrPortI(PBDDR, &PBDDRShadow, 0xff); // Port C as output
while(1)
{
// add your programs in here

//WrPortI(PADR, &PADRShadow,i);
//WrPortI(PBDR, &PBDRShadow,i);
//WrPortI(PCDR, &PCDRShadow,i++);
}

}
//////////////////////////////////////////////////////////////////////
--- In r..., Sylvain Bissonnette wrote:
>
> Hi to all of you,
>
> What is wrong in my 10 line of code, Not all pine toggle
>
> main()
> {
> int i;
>
> WrPortI(SPCR, NULL, 0x84); // Port A as output
> WrPortI(PBDDR, &PBDDRShadow, 0xff); // Port B as output
> WrPortI(PBDDR, &PBDDRShadow, 0xff); // Port C as output
> while(1)
> {
> WrPortI(PADR, &PADRShadow,i);
> WrPortI(PBDR, &PBDRShadow,i);
> WrPortI(PCDR, &PCDRShadow,i++);
> }
> }
>
> > ,_._
>

I found it:

SCLKB (used by serial flash on RCM5750/RCM5760 and RCM6700 family.)
Due to serial boot flash requirements, the RCM6700 familys edge connector
pin 27 (PB0 / SCLKB) must not be used for general purpose I/O. Although
reserved for SCLKB only, this usage may be shared with an off-minicore SPI
device.
I am having similar issues but I cant get my pin 2 of port B to simply go high. I followed your help and thansk for pointing out the utility.l

Memfault State of IoT Report