Re: PortB question

"[email protected]" <[email protected]>
Newsgroups gmane.comp.hardware.rabbit-semiconductor
Message-ID <[email protected]>


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 <CTRL H> 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 [email protected], Sylvain Bissonnette <bibi@...> 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++);
>    }
> }
> 
> > ,_._
> >
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.