Putting a PIC16F88 into and out of sleep mode

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

christoph
Flowcode V4 User
Posts: 382
Joined: Tue Nov 01, 2011 4:28 pm
Has thanked: 196 times
Been thanked: 26 times

Re: Putting a PIC16F88 into and out of sleep mode

Post by christoph »

Thankyou Benj,

Here is attachment
Attachments
NEW_16F1823-CHIP.fcf
(15 KiB) Downloaded 517 times

christoph
Flowcode V4 User
Posts: 382
Joined: Tue Nov 01, 2011 4:28 pm
Has thanked: 196 times
Been thanked: 26 times

Re: Putting a PIC16F88 into and out of sleep mode

Post by christoph »

Hi Benj,

PLEASE USE THIS ATTACHMENT to look at but it still wont compile unfortunately...

Chris
Attachments
C_code_semicolon_added_to_NEW_16F1823-CHIP.fcf
(11 KiB) Downloaded 522 times

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: Putting a PIC16F88 into and out of sleep mode

Post by Benj »

Hi Chris,

Right the compile errors regarding the interrupt have now been fixed in this updated definition file.
16F1823.fcd
(6 KiB) Downloaded 441 times
You need to copy this file to your "C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD" directory and restart Flowcode.

There is also a compilation error regarding your oscon C code.

This needs changing from oscon to osccon, i.e. two c's and then this should work also.

christoph
Flowcode V4 User
Posts: 382
Joined: Tue Nov 01, 2011 4:28 pm
Has thanked: 196 times
Been thanked: 26 times

Re: Putting a PIC16F88 into and out of sleep mode

Post by christoph »

Hi Benj,

Have done all that but it still wont compile or pick up the INTERRUPT to the Macro in simulation, instead it comes up with 13 'paragraphs' (for want of a better description) of errors and ending in code 1......see the first attachment for last part but all the previous is similar.

I would just mention - if it is significant - that you said copy the File to "C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD" which it has but I dont 'see' the(x86) there??


This is all very wierd because a chart attachment ADDED TO MY FOLLOWING POST is my original one which DOES work (apart from sleep which doesn't simulate) but I cant use it because it only has 4 available IOC and anyway is far too big for the PCB which is why I need THIS 1823 chip.
Attachments
PIC16F1823_Print_out_of_last_four_paragraphs_of_thirteen_paragraphs_of_errors.jpg
(395.82 KiB) Downloaded 5667 times

christoph
Flowcode V4 User
Posts: 382
Joined: Tue Nov 01, 2011 4:28 pm
Has thanked: 196 times
Been thanked: 26 times

Re: Putting a PIC16F88 into and out of sleep mode

Post by christoph »

This is the chart that works ok - see attachment
Attachments
BRAND NEW 16F883 TRANSMITTERy.fcf
(11 KiB) Downloaded 549 times

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: Putting a PIC16F88 into and out of sleep mode

Post by Benj »

Hmm, Just tried it here and it's compiling correctly for me.

Are you using Flowcode 4.5?

Flowcode v4 is now well out of support so I can't spend too much time on this but will do my best to help you to get it working.
C_code_semicolon_added_to_NEW_16F1823-CHIP.fcf
(11 KiB) Downloaded 507 times
C_code_semicolon_added_to_NEW_16F1823-CHIP.hex
(1.38 KiB) Downloaded 425 times
C_code_semicolon_added_to_NEW_16F1823-CHIP.c
(20.78 KiB) Downloaded 468 times
From your error messages it looks like the compiler does not have any of the registers declared. Maybe the compiler in your version does not support the chip or an include is not being included correctly. Compare your C file with mine using a text editor, are there differences?
I would just mention - if it is significant - that you said copy the File to "C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD" which it has but I dont 'see' the(x86) there??
the (x86) in the path is something added by Microsoft on 64-bit computers to help signify legacy 32-bit programs.

christoph
Flowcode V4 User
Posts: 382
Joined: Tue Nov 01, 2011 4:28 pm
Has thanked: 196 times
Been thanked: 26 times

Re: Putting a PIC16F88 into and out of sleep mode

Post by christoph »

Hi Benj,

I have Flowcode 4 version 4.3.7.63 dated 2010

I don't know how to compare files but will have a look on the web or if you can tell me what is a free one if I need to download something.

What is a way out of this - can I upgrade to a 4.5 so that I dont make all my current charts unuseable?

I really need that chip...

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: Putting a PIC16F88 into and out of sleep mode

Post by Benj »

You could try Help -> Check for updates, this still seems to be working for v4.

I think this is the direct v4.5 link.
http://www.matrixmultimedia.com/softwar ... codeV4.exe

christoph
Flowcode V4 User
Posts: 382
Joined: Tue Nov 01, 2011 4:28 pm
Has thanked: 196 times
Been thanked: 26 times

Re: Putting a PIC16F88 into and out of sleep mode

Post by christoph »

Oh - that seems to have 'killed' v4. The 1823 chart is now missing the RS232 and ALL the components like comms, LED's, Switch arrays etc etc are all saying "unregistered" now!

HELP!

christoph
Flowcode V4 User
Posts: 382
Joined: Tue Nov 01, 2011 4:28 pm
Has thanked: 196 times
Been thanked: 26 times

Re: Putting a PIC16F88 into and out of sleep mode

Post by christoph »

When I click on help in Flowcode it has never appeared to work but a windows panel basically says it isn't supported so I cant do anything 'there'.

It Does now say it is v4.5,18,74 so that HAS changed.

christoph
Flowcode V4 User
Posts: 382
Joined: Tue Nov 01, 2011 4:28 pm
Has thanked: 196 times
Been thanked: 26 times

Re: Putting a PIC16F88 into and out of sleep mode

Post by christoph »

Now it has gone full circle and although I put in the Licence key and it SAYS it is recognised and all ok, when I pick any chart, everything is still unregistered. I had this problem at the beginning of all these other problems so I am now back to totally unuseable. I know this is v4.5 but I still need to use it. Trouble is it comes up with the message in the attachment and that is from when I click to enable the registration and the only other selection is the web and that takes me to an error page 404 which takes me into all MM's latest things and ultimately nowhere.

I really need to get this sorted urgently - cant I just re-register from scratch with the 4.5,18,74 version without any reference to what went before cos the seems to be conflicting actions creeping into this
Attachments
When I try to register.jpg
(184.41 KiB) Downloaded 5655 times

christoph
Flowcode V4 User
Posts: 382
Joined: Tue Nov 01, 2011 4:28 pm
Has thanked: 196 times
Been thanked: 26 times

Re: Putting a PIC16F88 into and out of sleep mode

Post by christoph »

OK, I have now 'repaired' Flowcode and it is now showing the components when clicked on but each time I bring up a chart it brings up the panel quoting I have 30 days to register etc. so may not be giving me full access/!

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: Putting a PIC16F88 into and out of sleep mode

Post by Benj »

Hi Chris,

Registration is a two part process.

First you must enter your CD key which unlocks the 30 day usage.

You must then follow up with your existing username and key from when you activated Flowcode 4. It should be in your emails still.

If not then let me know and I can dig out your activation details for you.

christoph
Flowcode V4 User
Posts: 382
Joined: Tue Nov 01, 2011 4:28 pm
Has thanked: 196 times
Been thanked: 26 times

Re: Putting a PIC16F88 into and out of sleep mode

Post by christoph »

Hi Benj,

I HAVE all my 'Flowcode V4 for PIC details i.e. 6-part Licence/CD Key (ending XCUFY2) and my 7-part Licence/CD Key (ending with ZEWXJQ).

The problem every time is that when the 'Flowcode reminder' panel comes up, I click on 'Enter Key' and it comes up with the 'Error' panel which I show in previous posting attachment.

Therefore I am left with the 'OK' button on the 'Reminder' panel which when I click, simply allows the chart to come up OR the Visit Website button which takes me to a Matrix M. page which says '404 Page Not Found' in huge lettering followed by the statement: "There's nothing here...but what you seek may still exist elsewhere...try these links to find what you are looking for or use the search bar at the top of the page". The first option simply takes me back to all your latest things which doesn't get me anywhere.

christoph
Flowcode V4 User
Posts: 382
Joined: Tue Nov 01, 2011 4:28 pm
Has thanked: 196 times
Been thanked: 26 times

Re: Putting a PIC16F88 into and out of sleep mode

Post by christoph »

After many hours trying various things I decided to re-install Flowcode via my account where everything 'lines up' correctly like keys and user names etc. and I can now compile BUT:

1) It is taking up to 6 minutes!
2) As you can see, it is STILL saying UNREGISTERED.
3) I dont understand the cautions, much less what to do about them - perhaps you could either tweak the last Flowchart I attached since you were saying that it did work in your case or at least let me know what to do myself for any significant ones so that I know in the future.
4) Every time I open a flowchart I get am still getting 'User Account Control' panel saying "unidentified program etc." and I have to click to allow / then 'Reminder' panel where I have to click 'ok' because if I try to click on 'Enter Key' I get the violation panel / so 'ok' and into drawing.
5) The interrupt is STILL saying PORT B but you were saying that should work ok on hardware and thankfully there IS PORT C in the ports list now BUT (see item 6)....
6) PORTS LIST shows a PORT B as well, is this a problem?
7) It STILL WILL NOT SIMULATE like the F883 attachment I posted DOES even on my PC and always has, so what could be the difference as all my compilation and config. files are the same!??

Maybe you can see tell what is going on from the compile attachments. I couldn't get two attachments into the same post last time I wanted to so I may have to do 2 postings to send the end of the compile file.
Attachments
FIRST_PAGE_SCREEN_SHOT_of_6_MINUTE_COMPILATION_.jpg
(367 KiB) Downloaded 5642 times

christoph
Flowcode V4 User
Posts: 382
Joined: Tue Nov 01, 2011 4:28 pm
Has thanked: 196 times
Been thanked: 26 times

Re: Putting a PIC16F88 into and out of sleep mode

Post by christoph »

Second attachment re compile...
Attachments
SECOND_PAGE_SCREEN_SHOT_of_6_MINUTE_COMPILATION.jpg
(351.81 KiB) Downloaded 5642 times

christoph
Flowcode V4 User
Posts: 382
Joined: Tue Nov 01, 2011 4:28 pm
Has thanked: 196 times
Been thanked: 26 times

Re: Putting a PIC16F88 into and out of sleep mode

Post by christoph »

Hi Benj or anyone from the MM team,

I know you guys are busy but I am stuck with two priority problems that are specifically to do with REGISTRATION and the Flowcode-LISTED CHIP ( the PIC16F1823 ) which does'nt simulate whereas the PIC16F887 DOES!

I have no control over either of these factors as they are controlled within Flowcode and Matrix Multimedia administration respectively but nevertheless, I have spent the last TWO days trying everything from the postings, the web and my gathered information to no avail. I did a complete computer check over the weekend including defrag. and it is all perfect and running fast so I know these issues are not a PC problem - besides, all my other programmes run exactly as they should. I have compared the files you sent me Benj and they match ok.
RegMe.exe does not recognise my activation code - please see following attachments

I am desperately trying to finish this project within a limited time period but I cannot move at all now....!

I would also like to find out why it takes 6 minutes to to compile and download to chip and get the other answers to my items list shown on the recent posting.

Many thanks in advance and would be really grateful to get all these fixed today,

Chris

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: Putting a PIC16F88 into and out of sleep mode

Post by Benj »

Hello Chris,

The activation code you're entering should also have a username.

e.g. in the text field enter the details like this.

Username
Activation Code

Let me know if this works.

Also please don't post your keys on a public forum. Apart from piracy issues if you ever wanted to upgrade and claim your discount someone may already have claimed it.

christoph
Flowcode V4 User
Posts: 382
Joined: Tue Nov 01, 2011 4:28 pm
Has thanked: 196 times
Been thanked: 26 times

Re: Putting a PIC16F88 into and out of sleep mode

Post by christoph »

Sorry Benj but I not sure where you mean as not on the reg panel - I have seen a place for the user name if I am removing Flowcode and then re-installing it - is that where you mean? If so, then it is already there correctly but I can go through the process again.

I guess you removed the last postings! - I agree!

Chris

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: Putting a PIC16F88 into and out of sleep mode

Post by Benj »

Hi Chris,

In the activation code window that you showed in your screen shot simply type your username and activation key on individual lines in the same text field.

Username
Activation key

e.g. don't uninstall again. Just go to the activate window and input your details into the activation text box.
Activation.jpg
Activation.jpg (54.22 KiB) Viewed 17302 times
The "Name = " and "Code = " are not needed.

just:

Name
Code

Let us know how you get on.

christoph
Flowcode V4 User
Posts: 382
Joined: Tue Nov 01, 2011 4:28 pm
Has thanked: 196 times
Been thanked: 26 times

Re: Putting a PIC16F88 into and out of sleep mode

Post by christoph »

Hi Benj, yes fully registered again at last, thankyou for that.

I am left with the problem of the PIC16F1823 interrupt not switching when any one of the switches RA0,1,2,4 or 5 is operated. ( I am using RA3 for MCLR 'tied' to +ve ).

In desperation I have compared C code for this 16F1823 flowchart with the 16F883 flowchart (where the interrupt works like a dream and the operating principle is exactly the same) and changed obvious things such as PORT B to Port A where required but it was virtually all identical.
The only part I wasn't sure about on 16F1823 was probably the important part near the end of the coding under the Interrupt 'Enable PORT A' heading. There are 4 lines e.g. first line 'ioca = ioca (I cant replicate the vertical bar) 0xc0 etc which I don't understand - shouldn't there be 6 lines for the 6-IOC capability the chip has (and what happens about the fact that I am using one of them, RA3 for MCLR?).

I think all it requires is a quick look at the the 'Interrupt' with the benefit of your expertise to fix it. I have attached the two relevent flowcharts.

Can you give me some ideas as to what to try to overcome the 6 or more minutes it takes to compile and also send to chip.

Then I can stop bothering ya Benj - I know we are all busy - but I need to catch up with this 'like yesterday' as the saying goes.

Thanks,

Best regards,

Chris
Attachments
BRAND NEW 16F883 TRANSMITTER.fcf
(15 KiB) Downloaded 465 times
NEW_16F1823_CHIP - Copy.fcf
(11 KiB) Downloaded 547 times

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: Putting a PIC16F88 into and out of sleep mode

Post by Benj »

Hi Chris,
PIC16F1823 interrupt not switching when any one of the switches RA0,1,2,4 or 5 is operated.
I take it this is in simulation. V4 only had limited simulation of interrupts so this could explain what you are seeing. The simulation may only work for PortB but the downloaded code should work as expected. Have you tried this on hardware?
There are 4 lines e.g. first line 'ioca = ioca (I cant replicate the vertical bar) 0xc0 etc which I don't understand - shouldn't there be 6 lines for the 6-IOC capability the chip has (and what happens about the fact that I am using one of them, RA3 for MCLR?).
If you look at the chip datasheet then it will explain the IOCA register for you. If the MCLR is in MCLR mode then it's basically disconnected from the PortA registers so won't trigger an interrupt.

christoph
Flowcode V4 User
Posts: 382
Joined: Tue Nov 01, 2011 4:28 pm
Has thanked: 196 times
Been thanked: 26 times

Re: Putting a PIC16F88 into and out of sleep mode

Post by christoph »

Hi Benj,

I didn't want to get to hardware before clearing up the fact that F883 simulates and so why doesn't F1823 - so that's cleared that up with your explanation now.

Yes I have the full set of F1823 data sheets and although I understand the 'words' and the 'working' I do not know how it translates into C code. What DOES "ioca = ioca (I cant replicate the vertical bar) 0xc0" mean? I could probably work the rest out from that then. The hex value of 0xc0 didn't seem to match any conversion into decimal/binary/octal that I could relate to and same on the other 3 lines. COULD YOU EXPLAIN THAT LINE for me?

Then I can breadboard and check it out.
Many thanks,

Chris

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: Putting a PIC16F88 into and out of sleep mode

Post by Benj »

Hi Chris,

Code: Select all

ioca = ioca | 0xc0;
this line of code takes the value in the ioca register and performs a bitwise OR on the register.

e.g. if ioca is equal to 0x01

then the line ioca = ioca | 0xc0; would end up with ioca equal to 0xc1.

0b00000001
OR
0b11000000
=
0b11000001

The | symbol is on the same key as the \ symbol i.e. next to the Z key.

For more information on C operators see this page.
http://www.tutorialspoint.com/cprogramm ... rators.htm

christoph
Flowcode V4 User
Posts: 382
Joined: Tue Nov 01, 2011 4:28 pm
Has thanked: 196 times
Been thanked: 26 times

Re: Putting a PIC16F88 into and out of sleep mode

Post by christoph »

Hi Benj,

Ahhh... sorry I have that vertical bar ALSO on the key that is below the escape key but as a third icon and didn't spot that elsewhere - thankyou!

Many thanks re the ioca explanation, I'm now fired up and can work with that!

Many thanks,

Chris

Post Reply