WinPicProg Forums Forum Index WinPicProg Forums
A forum to support WinPicProg
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problems with 876A but not with 876

 
Post new topic   Reply to topic    WinPicProg Forums Forum Index -> Questions
View previous topic :: View next topic  
Author Message
IanPegg



Joined: 11 Sep 2006
Posts: 45
Location: Northampton UK

PostPosted: Sun Dec 24, 2006 9:28 pm    Post subject: Problems with 876A but not with 876 Reply with quote

Hi. Probably something stupid I'm doing. I've done a lot with the 16F628 thanks to all Nigels stuff (tutorials and hardware). Now I'm trying the 16F876. Problem is, I only have one 16F876 which is an 04 and I think that means it can only run at 4Mhz (please correct me if I'm wrong). This being the case, I can't use it on the main board I've built because of the 20Mhz crystal. The other 16F876s I have should be OK but they are all the "A" version. So, I've managed to download the beta version of the software and get this working. However, I can't seem to program the "a" version of the chips. I can burn the non-"A" version OK.

I'm using the PLMS OziPic'er (with74 HC14 buffer instead of 7407/05)

I assume that if I want to do the "A" version, then I need to change the header on my asm file and replace 16F876 with 16F876A. After this, I need to select PIC16F876A in WinPicProg and it should work? Trouble is, it doesn't - well sometimes it does but usually I just get program verify error at 0x005 or some such. If I erase the PIC but then immediately read it, it still shows data.

Basically, there are very strange things going on which are inconsistant and therefore difficult to describe exactly. Maybe something is a bit border line somewhere. Any ideas? What are good settings for Prog Delay and Vp delay? Also, I note that there is a setting for MCLR in WinPicProg 1.95 but as my programmer doesn't have a line for this, I guess I can just ignore it.
_________________
Ian
Back to top
View user's profile Send private message
Nigel Goodwin
Site Admin


Joined: 03 May 2006
Posts: 135
Location: Lower Pilsley, North Derbyshire

PostPosted: Mon Dec 25, 2006 6:22 pm    Post subject: Reply with quote

You need to alter the config settings as well, they are probably different for the A version. There's no problem over the crystal frequency, a 4MHz 876A will work fine at 20MHz - they don't make different versions, they simply select them on test after manufacture (assuming they even do that?, I suspect they arbitarily just label some 4MHz at random).

I've NEVER heard of a 4MHz chip not working at the higher rating!.
Back to top
View user's profile Send private message Send e-mail
IanPegg



Joined: 11 Sep 2006
Posts: 45
Location: Northampton UK

PostPosted: Tue Dec 26, 2006 3:21 pm    Post subject: Reply with quote

Nigel. Thanks for that. I did change the config from 0x3D18 to 0x393A for both the "A" and non "A" versions (also the set up code for the A to Ds and the delay routines). I'll check to see if the "A" is different.

Still have a bit of a strange problem. If I start with an "A" chip, select PIC16876A for the drop down in WinPicProg 1.95e and erase it, then read it, it still has the same data. If I change the Processor on the drop down to PIC16876 (non "A") but not the chip itself, it will erase and when I read, appears to have no data as expected. However, to programme it, I have to select the "A" version, otherwise I just get error messages.

At the moment, I can't get either chip to do what I want. I'm just trying to get a programme which works fine and a 16F628 to work on a 16F876 by using port C instead of port A. Having said that, this is the first time I have tried using my "Main board 2" so there could be problem here although it checks out pin to pin. Is there any way of checking if the crystal is OK? (I dont have a scope or anything).
Thanks
_________________
Ian
Back to top
View user's profile Send private message
IanPegg



Joined: 11 Sep 2006
Posts: 45
Location: Northampton UK

PostPosted: Sat Dec 30, 2006 5:17 pm    Post subject: Reply with quote

Hi. Still having problems. To cut a long story short I have cut out as many variables as possible. I have a very short programme which simply displays the letter "A" on an LCD. This works fine on a 16F628 with the LCD connected to port A. I have built a new main board 2 to use the 16F876 as per the tutorial hardware. I have changed the code as per the tutorials. i.e List p=16F876 instaed of 628, include "P16F876.inc" instead of 628. _config 0X393A instead of 0X3D18. Setup code BANKSEL ADCON1 etc instead of CMCON. Delay routines changed i.e. d1 movlw 0xE7 instead of 0XC7 etc.... Finally I have changed all references to Port A and TrisA to PortC and TrisC. I have a new 16F876 chip, not the A version. I am using the original WinPicProg software, not the Beta version. I can programme the chip - no error messages. I can read, write and verify the chip. When I put it in the new main board and connect the LCD to Port C - I get nothing. Help please.
_________________
Ian
Back to top
View user's profile Send private message
KC



Joined: 05 May 2006
Posts: 99
Location: Victoria BC Canada

PostPosted: Sun Dec 31, 2006 2:59 am    Post subject: Reply with quote

Try and see if you can flash LEDs on PortC of the F876, especially with the pins you'll use to connect to the LCD.
_________________
KC
Back to top
View user's profile Send private message
IanPegg



Joined: 11 Sep 2006
Posts: 45
Location: Northampton UK

PostPosted: Sun Dec 31, 2006 1:21 pm    Post subject: Reply with quote

Hi and thanks for that. Tried your suggestion and yes I can flash LEDs on Port C (the one I want to connect the LCD to) on the 876 PIC. Basically I took tutorial 1.2 and adapted it as per Nigels instructions for the 876, and substituting all references for Port A to Port C. So at least I now know that the hardware is fine, and my "OzPic" board is fine with 28 pin chips. I also know that the LCD works fine with a "628" on Port A. Could it be that the LCD routines need to be changed to suit a PIC running at 20MHz?
_________________
Ian
Back to top
View user's profile Send private message
IanPegg



Joined: 11 Sep 2006
Posts: 45
Location: Northampton UK

PostPosted: Sun Dec 31, 2006 4:42 pm    Post subject: Reply with quote

The post I made here was a mistake - I've just deleted it all
_________________
Ian
Back to top
View user's profile Send private message
KC



Joined: 05 May 2006
Posts: 99
Location: Victoria BC Canada

PostPosted: Sun Dec 31, 2006 8:22 pm    Post subject: Reply with quote

Quote:
Could it be that the LCD routines need to be changed to suit a PIC running at 20MHz?
It's possible, but not likely because the code will only be running about 5x faster which the LCD should handle OK. You could modify Nigels delay routines so that there are 5x as many cycles wasted just to be sure.
Quote:
The post I made here was a mistake - I've just deleted it all

Maybe post your modified code here if you are still stuck.
_________________
KC
Back to top
View user's profile Send private message
IanPegg



Joined: 11 Sep 2006
Posts: 45
Location: Northampton UK

PostPosted: Mon Jan 01, 2007 12:53 pm    Post subject: Reply with quote

Hi and many thanks.

I seem to have digressed from my original problem which I thouht was to do with differences between the "A" and "nonA" version of the PIC. This seems to be largely resolved but I still have problems which I think are now down to my coding so I think I should post this under a new topic. For info, I can get the LCD to work on port C of the 876 using Nigels tutorial 3.1 with only the modifications needed for that chip.

To summarise the issues I was having with the 876/876A I can clarify the following.

1. Using WinPicProg Beta version, to erase an 876A, I have to set the processor to PIC16F876 (the non A Version). Then I can erase it and subsequently when I read it, the data is no longer there. If I select the "A" version, it shows that the data is retained after an erase.

2. To write to the "A" version, I need to then set the processor to PIC16F876A as expected otherwise I get error messages.

3. A PIC 16F876 - 04 will run quite happily with a 20 MHz crystal as Nigel said it would.

4. The "A" version does need any different _config setting to the non-A version. If you have this chip, just change "LIST" to P=16F876A and "include" to "P16F8876A"

One quick question - do I need to erase the PIC each time before writing or will the write operation automatically erase first?

Many thanks for your help and I will post a new topic with the problems I now have.
_________________
Ian
Back to top
View user's profile Send private message
KC



Joined: 05 May 2006
Posts: 99
Location: Victoria BC Canada

PostPosted: Tue Jan 02, 2007 5:20 am    Post subject: Reply with quote

Quote:
One quick question - do I need to erase the PIC each time before writing

Nope.
Quote:
or will the write operation automatically erase first?

Yes, writing to the chip is all you need to do, to program it with new code.
_________________
KC
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WinPicProg Forums Forum Index -> Questions All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group