Sorry this is non-MIOS, but I guess it’s still ASM. ![]()
How much extra init junk needs to be done to activate all five banks on a 16F87x as digital outputs?
I’m trying to play with some shift register code and rather than constructing a circuit using a smaller chip that I understand a little better, I figured I’d use this hybrid Core/JDM thing I’ve got, which already has most of the access available. To begin with, I figured I’d get the minimal stuff needed just to set/clear the pins I have available, and found that they didn’t seem to be turning on as I requested. I then moved into MPLAB’s simulator to see if I could get it going in there before blaming the circuitry.
In MPSIM, I’ve got the config lines and bank switching worked out OK (I think), and I’ve got that error suppress line to keep it from throwing the “not in bank 0” errors at me. I’ve also got the 16F877 file properly included. From what I can remember, I’ve got it switching to bank1, loading 0x00 to the WREG, then calling TRISx five times for the five ports. Then I move back to bank0, stick an 0xFF in the work register, and dump that to the five ports in a similar manner (trying to turn them all “on”), and I end it with a “looped” goto line.
What I *get* in the register view panel when I stop is (hex) 10,FF,FF,FF,00 for the five ports. I realize the A&E ports are shorter in width. I think I’ve even tried to access them separately with smaller numbers assigned, but get the same thing (PortE always stays off, and the fifth bit is the only thing I can successfully activate on PortA).
I’m guessing there’s something special which needs to be done for those two to be seen as regular (digital) output ports (the ADCON1 register or something for instance??). Can anyone briefly point me in the right direction?
I’m also guessing there may be something about some of the pins in this circuit, which may make them unsuitable as digital outs, but I figure if I can get the simulator working for all of them, I can move to some usable pins afterward (I should have more than enough). The circuit is a 20MHz Core board with a female header for all the LCD lines, and males for the DIN/DOUT/AIN and Mux pins of the PIC. (there are likely some pullups on the required lines).
Much Thanks,
George