|
|
View previous topic :: View next topic |
Author |
Message |
Ttelmah
Joined: 11 Mar 2010 Posts: 19591
|
|
Posted: Thu Feb 28, 2013 3:02 pm |
|
|
Two comments:
You have the debug fuse turned off, yet are trying to debug.
Read the data sheet. What clock rates can the internal oscillator do?. Is 20MHz one of them?.
Best Wishes |
|
|
Papi
Joined: 08 Dec 2012 Posts: 36
|
|
Posted: Thu Feb 28, 2013 3:21 pm |
|
|
PCM programmer wrote: | Pickit 3 is a Microchip product. It's not a CCS issue. I'll show you how
to use Google to search the Microchip forum. Copy and paste the
following line into the Google search box:
Quote: | site:microchip.com/forums pickit3 18F46K22 Debug Executive Programming failed |
Note how this confines the search to the Microchip forums and searches
for your exact problem. You'll quickly find the answer.
Short answer: Upgrade MPLAB IDE, preferably to the latest version. |
Appreciate PCM Programmer
I have already upgrade to MPLAB V8.89 also I found someone had the same problem from here
http://www.ccsinfo.com/forum/viewtopic.php?t=49397&highlight=pic18f46k22
Thank you |
|
|
Papi
Joined: 08 Dec 2012 Posts: 36
|
|
Posted: Thu Feb 28, 2013 3:36 pm |
|
|
Ttelmah wrote: | Two comments:
You have the debug fuse turned off, yet are trying to debug.
Read the data sheet. What clock rates can the internal oscillator do?. Is 20MHz one of them?.
Best Wishes |
Yes I made some changes as you suggested, but just found out that the MPLAB V8.63 was the problem, I just upgraded so I will test again.. |
|
|
Papi
Joined: 08 Dec 2012 Posts: 36
|
|
Posted: Fri Mar 15, 2013 8:09 am |
|
|
Am having problem at the moment I can't send a text at all using my GSM, am using GSM Enfora1218 so I have tried different ways seems not to work at at all, or the main problem is my code??But seems fine
Code: | #include <18f46k22.h>
#include <stdio.h>
#Fuses INTRC_IO,NOPLLEN,PRIMARY_ON,NOFCMEN,NOIESO,PUT,
#Fuses BROWNOUT,BORV29,NOWDT,
#Fuses CCP2C1,NOPBADEN,CCP3B5,
#Fuses NOHFOFST,TIMER3B5,NOMCLR,
#Fuses NOSTVREN,NOLVP,NOXINST,
#Fuses NOPROTECT,NOCPB,NOCPD,NOWRT,NOWRTC
#Fuses NOWRTB,NOWRTD,NOEBTR,NOEBTRB
#use delay(clock=2000000) // 20Mhz
#include "flex_lcd.c"
#use rs232(baud=9600, parity=N, xmit=PIN_C6, rcv=PIN_C7, bits=8, stream=PC, ERRORS)
void main()
{
char c;
char s = 0x1A;
set_tris_b(0x00);
lcd_init();
delay_ms(20);
printf("AT\r");
delay_ms(100);
printf("ATE0\r");
delay_ms(100);
printf("AT+CMGF=1\r");
delay_ms(100);
fprintf(PC, "AT+CMGS=\"*************\"\r");
delay_ms(300);
printf("hello\r");
putc(s);
lcd_gotoxy(1,2);
while (true)
{
c = getc();
printf(lcd_putc,"%c",c);
}
} |
Any advice I will appreciate, because I have tried to find out the problem but still am stacking. |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1941 Location: Norman, OK
|
|
Posted: Fri Mar 15, 2013 8:13 am |
|
|
What about this comment from TTelmah?
Quote: | Read the data sheet. What clock rates can the internal oscillator do?. Is 20MHz one of them?. |
You are not paying attention to what you are told...
MPLab has nothing to do with clock capabilities in the PIC. _________________ Google and Forum Search are some of your best tools!!!! |
|
|
Papi
Joined: 08 Dec 2012 Posts: 36
|
|
Posted: Fri Mar 15, 2013 8:31 am |
|
|
dyeatman wrote: | What about this comment from TTelmah?
Quote: | Read the data sheet. What clock rates can the internal oscillator do?. Is 20MHz one of them?. |
You are not paying attention to what you are told...
MPLab has nothing to do with clock capabilities in the PIC. |
Appreciate, I had problem before so the problem was solved and still I was using the same 20MHz, I will have look on that. |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Fri Mar 15, 2013 8:33 am |
|
|
I'll even help a little more..
you have 2 problems in here...
Code: | #Fuses INTRC_IO,NOPLLEN,PRIMARY_ON,NOFCMEN,NOIESO,PUT,
#Fuses BROWNOUT,BORV29,NOWDT,
#Fuses CCP2C1,NOPBADEN,CCP3B5,
#Fuses NOHFOFST,TIMER3B5,NOMCLR,
#Fuses NOSTVREN,NOLVP,NOXINST,
#Fuses NOPROTECT,NOCPB,NOCPD,NOWRT,NOWRTC
#Fuses NOWRTB,NOWRTD,NOEBTR,NOEBTRB
#use delay(clock=2000000) // 20Mhz |
_________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
Papi
Joined: 08 Dec 2012 Posts: 36
|
|
Posted: Fri Mar 15, 2013 8:47 am |
|
|
bkamen wrote: | I'll even help a little more..
you have 2 problems in here...
Code: | #Fuses INTRC_IO,NOPLLEN,PRIMARY_ON,NOFCMEN,NOIESO,PUT,
#Fuses BROWNOUT,BORV29,NOWDT,
#Fuses CCP2C1,NOPBADEN,CCP3B5,
#Fuses NOHFOFST,TIMER3B5,NOMCLR,
#Fuses NOSTVREN,NOLVP,NOXINST,
#Fuses NOPROTECT,NOCPB,NOCPD,NOWRT,NOWRTC
#Fuses NOWRTB,NOWRTD,NOEBTR,NOEBTRB
#use delay(clock=2000000) // 20Mhz |
|
Not too sure what is the problem there, because so far am using the same fuses and everything working fine so far, give me a hint please then I will have look.
Thanks |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19591
|
|
Posted: Fri Mar 15, 2013 9:16 am |
|
|
Imagine a guy, who takes the face off his speedo in the car, and repaints it, so it shows 200mph, when he is doing 100. Then drives along the road proudly saying to his passenger 'look my car can do 200'. Is his car doing 200mph?.
This is like the clock settings you are using. The chip will work, but the timings will all be wrong, because it cannot do 20MHz, with the internal clock selected.
Best Wishes |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Fri Mar 15, 2013 9:27 am |
|
|
Code: | #use delay(clock=2000000) // 20Mhz | Kind of sad that several people gave you hints to one obvious error but you still don't see it.
Since you seem to be blind to this error I'll tell you what's wrong: count the number of zeroes, you have one too little resulting in 2MHz instead of 20MHz.
That's also my main problem with this notation, you are writing code that is not self explaining and then have to add comments for clarity. Better use this notation: Code: | #use delay(clock=20MHz) | Shorter to write down,
easier to read,
less errors ,
no need to write comments.
Still left for you to fix: the combination of fuses does not match the setting for 20MHz. |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Fri Mar 15, 2013 10:55 am |
|
|
ckielstra wrote: | Code: | #use delay(clock=2000000) // 20Mhz | Kind of sad that several people gave you hints to one obvious error but you still don't see it.
Since you seem to be blind to this error I'll tell you what's wrong: count the number of zeroes, you have one too little resulting in 2MHz instead of 20MHz.
That's also my main problem with this notation, you are writing code that is not self explaining and then have to add comments for clarity. Better use this notation: Code: | #use delay(clock=20MHz) | Shorter to write down,
easier to read,
less errors ,
no need to write comments.
Still left for you to fix: the combination of fuses does not match the setting for 20MHz. |
Yep. And I typically go even a little shorter than that and just use:
Code: | #use delay(clock=20M) |
_________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Fri Mar 15, 2013 2:29 pm |
|
|
Hi Papi,
Unfortunately, this thread might just be a case study in how not to pursue a new project. After three months and 4 pages, it appears that there is very little that you actually have working.....
I would suggest that you take a step back, take a deep breathe, and start with the basics. First, I'd generate a schematic for your project, and then methodically test each part (GPS, GSM, etc.), before putting everything together to achieve your final goal. Every project you do should include an LED indicator that you can flash on startup to verify that the PIC is running as intended, and a serial port for diagnostic purposes.
Start with some modest victories, and build from there. If afraid that if you continue on your current path, your project is ultimately doomed!
What you want to do is achievable without a whole lot of difficulty, but no one is going to just hand you their complete code! We'll certainly help, but you've got to help yourself first. So far, there isn't a lot of evidence that you have.....
John |
|
|
Papi
Joined: 08 Dec 2012 Posts: 36
|
|
Posted: Fri Mar 15, 2013 3:57 pm |
|
|
Ttelmah wrote: | Imagine a guy, who takes the face off his speedo in the car, and repaints it, so it shows 200mph, when he is doing 100. Then drives along the road proudly saying to his passenger 'look my car can do 200'. Is his car doing 200mph?.
This is like the clock settings you are using. The chip will work, but the timings will all be wrong, because it cannot do 20MHz, with the internal clock selected.
Best Wishes |
Thank you Ttelmah
Yes I understand what you mean, appreciate. Yes on the daytasheet seems the cheap it cannot do 20MHz i will change and use 16MHz instead, I didn't notice that, I thought I could still use the same internal Oscillator from pic16....
Last edited by Papi on Fri Mar 15, 2013 7:10 pm; edited 1 time in total |
|
|
Papi
Joined: 08 Dec 2012 Posts: 36
|
|
Posted: Fri Mar 15, 2013 4:14 pm |
|
|
ckielstra wrote: | Code: | #use delay(clock=2000000) // 20Mhz | Kind of sad that several people gave you hints to one obvious error but you still don't see it.
Since you seem to be blind to this error I'll tell you what's wrong: count the number of zeroes, you have one too little resulting in 2MHz instead of 20MHz.
That's also my main problem with this notation, you are writing code that is not self explaining and then have to add comments for clarity. Better use this notation: Code: | #use delay(clock=20MHz) | Shorter to write down,
easier to read,
less errors ,
no need to write comments.
Still left for you to fix: the combination of fuses does not match the setting for 20MHz. |
Thank you ckielstra
Yes I can see now, ok that's fine and and I will make some changes.....Appreciate for your time and pointing the main problem, I might change to 16MHz instead of 20MHz |
|
|
Papi
Joined: 08 Dec 2012 Posts: 36
|
|
Posted: Fri Mar 15, 2013 4:19 pm |
|
|
bkamen wrote: | ckielstra wrote: | Code: | #use delay(clock=2000000) // 20Mhz | Kind of sad that several people gave you hints to one obvious error but you still don't see it.
Since you seem to be blind to this error I'll tell you what's wrong: count the number of zeroes, you have one too little resulting in 2MHz instead of 20MHz.
That's also my main problem with this notation, you are writing code that is not self explaining and then have to add comments for clarity. Better use this notation: Code: | #use delay(clock=20MHz) | Shorter to write down,
easier to read,
less errors ,
no need to write comments.
Still left for you to fix: the combination of fuses does not match the setting for 20MHz. |
Yep. And I typically go even a little shorter than that and just use:
Code: | #use delay(clock=20M) |
|
Thank you again bkamen
Yes I noticed the problem I will make some changes to that and fuses as well |
|
|
|
|
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
|