RA5 on 16f88

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

RA5 on 16f88

Post by siliconchip »

hi all can anyone tell me how to light a led on a pic16f88 on Ra5 using flowcode i have done a simple flowchart but cannot get a led to light can anyone point me in the right direction please many thanks

User avatar
STibor
Posts: 263
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 116 times
Been thanked: 113 times
Contact:

Re: RA5 on 16f88

Post by STibor »

Hi
Look at the data sheet 10-th page.
RA5 MCLR input only can be.
http://ww1.microchip.com/downloads/en/d ... 30487c.pdf

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: RA5 on 16f88

Post by siliconchip »

ok thanks my mistake but i see that RA6 RA7 can be either inputs or outputs how do i configure the pic16f88 to use these as outputs, flowcode allows these to light leds but when i use hardware i cannot light these leds on these ports ???????, what am i missing

User avatar
STibor
Posts: 263
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 116 times
Been thanked: 113 times
Contact:

Re: RA5 on 16f88

Post by STibor »

Internal Oscillator with I/O on RA6 and RA7

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: RA5 on 16f88

Post by Benj »

STibor is correct it's probably a config setting you are missing.

Are you using the matrix EB006 programmer or HP488 dev board, I think only v7 and v8 EB006 boards support the extra two I/O pins when the oscillator jumper is in the I/O position.

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: RA5 on 16f88

Post by siliconchip »

hi benj i am using a developement board from mikroelektronica EASY PIC 5 in all other respects the board is fine and i have checked the book that came with the board for config settings but cannot get to light a LED on RA6 or RA7 could you please suggest another PIC possibly 18 - 20 pin with at least 6 outputs on porta for 6 LEDS and enough outputs on portb to run a 2x16 lcd must also have ADC cheers

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times
Contact:

Re: RA5 on 16f88

Post by dazz »

How are you downloading the hex file to your easypic 5 ?? i use an easypic7 can you post your flowcode file

attached is a hex file try it and see if it works it should flash all led's on port a
test.hex
(840 Bytes) Downloaded 312 times
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: RA5 on 16f88

Post by siliconchip »

hi dazz i use mikro-prog suite from mikroelektronica for downlooading HEX ive only done a simple flowcode program just to see if i can light LEDS on the desired outputs if i can get either of these outputs to work i shall create something i have in mind

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times
Contact:

Re: RA5 on 16f88

Post by dazz »

Have you set up mikroeprog in flowcode
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: RA5 on 16f88

Post by siliconchip »

i have tried your HEX file but when i load it into mikro prog i get "error at line 23 line to short"

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times
Contact:

Re: RA5 on 16f88

Post by dazz »

ok can you post your flowchart up

and try these config settings before burning your flowchart see if it works

config.jpg
config.jpg (199.62 KiB) Viewed 11317 times
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: RA5 on 16f88

Post by siliconchip »

LED flashing on RA6
Last edited by siliconchip on Sat Jun 23, 2012 1:19 pm, edited 2 times in total.

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: RA5 on 16f88

Post by siliconchip »

hex file
Attachments
RA6.hex
(748 Bytes) Downloaded 224 times

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: RA5 on 16f88

Post by siliconchip »

looking closely at my board i have noticed that because i am using a 4MHz crystal this is connected to RA6 and RA7 on the 16f88, therefore i think i will need to use an internal oscillator on the chip to free these two ports up how do i initialise this timer through flowcode ????

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: RA5 on 16f88

Post by kersing »

To set the oscillator you will have to use a C code block to set osccon to the desires value.

For a 4 MHz clock enter the following in the C code block (remove all existing text):

Code: Select all

osccon = 0x60;
Also in the processor configuration dialog of mikroProg set Oscillator to INTRC with both RA6 and RA7 as I/O.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: RA5 on 16f88

Post by siliconchip »

hi i have entered osccon = 0x60; as suggested , i notice on the data sheet that the following is said about internal oscillator "Internal oscillator block:
- 8 user selectable frequencies: 31 kHz,
125 kHz, 250 kHz, 500 kHz, 1 MHz, 2 MHz,
4 MHz, 8 MHz

what do i need to change in the c code to choose different frequencies

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: RA5 on 16f88

Post by kersing »

To select different frequencies change the value of osccon. See chapter 4.6.3 of the data sheet for the bits in the register.

The osccon values are:
0x70 : 8MHz
0x60 : 4MHz
0x50 : 2Mhz
0x40 : 1Mhz
0x30 : 500kHz
0x20 : 250kHz
0x10 : 125kHz
0x00 : 31.25kHz
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: RA5 on 16f88

Post by siliconchip »

excellent thanks for the info i now can use RA6 and RA7 as outputs as well as internal oscillator thanks to all for your contributions

Post Reply