pic 16F88 I/O port issue, any suggestions?

For E-blocks user to discuss using E-blocks and programming for them.

Moderators: Benj, Mods

Post Reply
fransky
Posts: 10
Joined: Mon Nov 28, 2005 10:00 am
Contact:

pic 16F88 I/O port issue, any suggestions?

Post by fransky »

Hi there,

I have a newbee question regarding Eblocks operation with a pic 16F88, hope someone can help me?

After first installing everything and running some flowcode tutorials, everything seemed OK. At some point however, I noticed that the A port of the picmicro did not function as it should, the D7, D6 and D5 pins do not seem to act as digital I/O's. When I run the tutorials involving LED output board, or switch board as input generator, everything runs fine as long as I connect them to port B (and adapt the flowcode of course) but on port A only the firts 5 lowest bits acts as digital I/O's.

I started reading about configuration bits, I noticed that in ppp a config 1 word of 0x3F2E seems to be set, while in ppp for a pic16F88 a config1 word 0x3F2A seems to be set. I tried changing some settings, but nothing seems to help/make a difference.

Can someone help me solve this? Would appreciate your suggestions on this very much

I am using ppp v 3.5.8.21 and firmware version 7 on the programmer board.

best regards, Fransky

Ian
Posts: 110
Joined: Thu Sep 29, 2005 10:53 am
Location: Matrix Multimedia
Been thanked: 1 time
Contact:

Post by Ian »

generally speaking Port B is used for most operations but watch out for Low Voltage Programming, as it uses pin B3.

Port A is generally the 'odds and ends' port with pins doubling up for Analogue, comparator and (especially on smaller chips like the F88) reset and clock functions. Some PIC chips, such as the PIC16F84 only have a partial Port A. Others like the F88 have this partial Port A, but with the option to turn on other pins to up the Port A IO count.


The E-blocks board makes use of pins A5, A6 and A7 to provide reset, programming and clock functionality.

Pin A5 is linked to the Reset button, and A6 and A7 are linked to clock in and clock out functions.
None of these 3 pins are routed to the Port A output. this was done to prevent interference causing clock or reset errors.

The pins can be used as IO but you would need to run the chip on another board in order to make use of them (i.e. in the circuit you are designing the program for).

Pin A5 can be configured in PPP to RA5 or MCLR. MCLR allows you to use the reset button on the E-blocks board. A5 turns the pin into an input pin.
(Note: the 16F88 lists A5 as an input not as bidirectional IO).

Using the internal oscillator allows pins A6 and A7 to be used as IO. Using an external clock requires these pins to be used.

Remember however that none of these 3 pins are routed to the Port A socket, so you would need to put the PIC in a circuit designed for use of those pins.


On Config words...
0x3F2E is the same as 0x3F2A except that it sets the Watchdog timer.
Unless you are specifically using the watchdog timer it needs to be turned off as it will continually reset the program making ot appear to either jam or not function at all.

Config words can be set by selecting the various options or by entering a Config word. Entering a config word is a useful feature as it allows people to specify a config word for their program rather than having to specify a long list of configuration settings. Handy if sending a program file to someone.
It can also be used to determine the correct config word(s) to embed in a program.

If a program has config words already embeded (as is often the case in our test programs) then that takes precidence over any configuration settings in PPP. This enables programmers to lock in the configuration so that people don't disrupt the program by setting the wrong ocillator type or something.

fransky
Posts: 10
Joined: Mon Nov 28, 2005 10:00 am
Contact:

Eblocks and flowcode consistency?

Post by fransky »

Hi Ian,

Thanks for your helpful insight into the hardware configuration of the Eblocks programmer board and the consequences for using the 16F88 with this board.

What remains is a sense that apparently Eblocks and Flowcode are not as integrated a design tool as I figured. If I take the F88 tut1 from Flowcode as basis, modify the code to output the number 255 to the A port, add a set of LEDs to port A for monitoring and than run the simulation, all 8 bits of port A happily come on and also the inset figure showing the reponse of a 16F88 indicates 8 bits going positive.

In line with your previous mail, the actual hardware behaviour is significantly different in reality. Perhaps more an issue for the Flowcode development team, don't know if they are aware of this?

best regards, Fransky

Ian
Posts: 110
Joined: Thu Sep 29, 2005 10:53 am
Location: Matrix Multimedia
Been thanked: 1 time
Contact:

Post by Ian »

Hi Fransky,

Yes it's more of a Flowcode issue as Flowcode assumes that you have the correct configuration and circuit to use the outputs in a case like that.

Unfortunately we can't predict which development board, configuration or circuit the program will be used in, so we must allow for all possibilities.

However I will pass this along to the Flwocode development team so that they are are aware of the issues.

BedfordCollege
Posts: 10
Joined: Thu Nov 27, 2008 10:23 am
Contact:

Re: pic 16F88 I/O port issue, any suggestions?

Post by BedfordCollege »

I must agree with the concern of other contributors.

I was sold this as a teaching aid, and for a simple intro to programming I need my students to turn on some lights, respond to some switches and understand interrupts.
The use of interrupts fixes Port B as interrrupts ( as with the eBlock input board I am forced to use the whole port for inputs ) , so that leaves me with Port A for outputs, and it would appear that only 5 are available - there goes any chance of a traffic ligh simulator for instance )

It would appear that I am now forced to move up to a more complicated PIC and start using Ports C & D maybe - already more complicated than I wish to go as an introduction.... or am I missing an extremely handy mixed I/O board where each bit has a switch and led on so I can individually assign port bit directions?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: pic 16F88 I/O port issue, any suggestions?

Post by Benj »

Hello

The Switch and LED boards have both in and out connections so you can connect both switches and LEDs to a single port.

Post Reply