After power up the ports are set to input. I don't see anything in those commands that set the port or the pin to output before you start writing to it. The fact that you say the pins are all tri-stated suggest the same.
You need to find the command to set the TRISB register to output on that pin. Since I'm not sure what language you're writing in I don't know what command you need to add but I'm sure you can work it out.
Both are valid commands according to the help file for the MicroCode Studio editor/compiler. Unfortunately results are the same (tri-state). Any other ideas?
I haven't used the 16F88 PIC but a search has shown it has the same pinout as the 16F84 and uses an internal oscillator. Pete is right in that you have to set the TRISA and TRISB registers to what you want.
For example using a 16F84 TRISA = %00000 'All PortA output pins output PORTA = 0 'Set all PortA pins LOW TRISB = %01000010 'RB1 & RB6 input all other PortB pins output PORTB = 0 'Set all PortB output pins LOW
If you go to
formatting link
there is a forum and an archive available. However it seems the forum may be down at the moment, either that or my PC is playing up.
I'm no expert but try the program below. I've dressed it up a little with remarks as it's a good habit to get into for when you start on much larger programs. I'll remember that and three months later when you look at it again it's "What?"
'******************************** ' Blinking LED program * '********************************
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.