--- Andre Miller wrote: > If all you want to do is set certain output pins > high/low you can do this > easily in PICC, it has already defined variables for > the pins, and it > depends of course which target PIC you're compiling > to. Note that > Microchip's C18 compiler uses a different syntax for > this (usining a union > on the port, I think). > > For example: > > // Give the output bits some nice names (which I > noticed you did, and then > commented out) > > #define CS RA0 // Chip Select output > #define SCLK RA1 // Serial Clock > output > #define SDI RA2 // Serial Data In output > > // Make CS high: > CS = 1; > > // Make SCLK low > SCLK = 0; Hehe, weird. I had exactly that code, totally identical, it first, but I seemed too simple :). Now, I found this in some code of Mike Pearce: #define bitnum(adr, bit) ((unsigned)(&adr)*8+(bit)) Then I just set: "static bit SCLK bitnum(PORTA, 0)" and I use SCLK as a single bit. > One thing I did notice is that you didn't set any > fuses (configuration bits) > in your program, without those, depending on how > you're programming your > pic, it most likely won't work, or wont do what you > want it to. The fuses > set things like osc type (HS, XT), watchdog timers, > brownout timers, etc. > > Also, you are using Port A, and port A usually has > special features, such as > an A/D, and you need to specifically turn off this > functionality otherwise > those pins won't behave as expected. Not sure about > the specific PIC you are > using, but some PIC's have certain Port A pins as > input only (is is that > output only?). It might be better to use Port B for > testing purposes. I know that, the pga.h file will be but a small part of my project. I've also made a mpc.h file, a setup.h file, an all.c file, ... The final goal is a full featured digitally controlled preamp. Input selection with the BB MPC506, volume control with the BB PGA2310, VFD for info & menu's, IR remote control, power switching (to turn amplifiers, crossover, .. on/off when the preamp is activated/deactivated), support for as many 3.1,5.1,6.1, ... (you get the point) channels as I want (that what the volume[pga_chips] array is for), etc., etc. As you see I've still got tons of work and heaps of stuff to learn :). Oh well... Thanks, Anthony ===== Website: http://members.lycos.nl/anthonyvh __________________________________ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.