CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

12f675 rs232 problem transmit ok, receive bad, max232 ok

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
rherrera72



Joined: 30 Sep 2009
Posts: 3

View user's profile Send private message

12f675 rs232 problem transmit ok, receive bad, max232 ok
PostPosted: Wed Sep 30, 2009 6:29 pm     Reply with quote

Hello, I have this program that works fine on a 12f683 and I want to run it on a 12f675, same circuit, same everything, works ok also on a 12f509,

Dont laugh please Very Happy

******* .h file ************
Code:
#include <12F675.h>
#device adc=8

#FUSES NOWDT                      //No Watch Dog Timer
#FUSES INTRC_IO                 //Internal RC Osc, no CLKOUT
#FUSES CPD                      //Data EEPROM Code Protected
#FUSES PROTECT                  //Code protected from reads
#FUSES NOMCLR                   //Master Clear pin used for I/O
#FUSES NOPUT                    //No Power Up Timer
#FUSES NOBROWNOUT               //No brownout reset
#FUSES BANDGAP_HIGH         
#use delay(clock=4000000)
#use rs232(baud=9600,parity=N,xmit=PIN_A4,rcv=PIN_A3,bits=8)


***********.c file **************
Code:
#include "Z:\pk2cmd\12f675serial1.h"

void main()
{
   delay_ms(2000);
   printf("\n\rHola Mundo V0.0.1\n\r");

   while (true) putc(getc());

}

Its just for testing tx and rx of a max232, and works ok except in 12f675. When I push a key it puts a ? symbol, and press number 1 and appear "a", press 2 appears "b" on terminal, everything else works ok on the 675. That's why I don't think is malfunctioning, except this very issue, any ideas ?

I am sure that its something to do with an interruption or a comparator or something that I can not figure it out.

This is the output on the input "asdffdfasdaa12345676" more or less:
Quote:

Hola Mundo V0.0.1
������������qrstuvev

Circuit is in production with a 683, everything is ok there, please forgive my bad english.

Best regards
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Sep 30, 2009 7:08 pm     Reply with quote

It's possible that the calibration value for the 12F675's oscillator is
incorrect. This value is read from the ROM at the last address in the
12F675 (address 0x3FF). The 12F683 does not have this feature. It
doesn't have to read a calibration value from ROM.

You're using Code Protection, so you can't read the value with your
programmer and tell us what it is.

Do you have another 12F675 that is new, and fresh from the Microchip
factory ?

Read it with your programmer before you do anything with it, and see
what value is at address 0x3FF. Post it.

Now program it with your code, but don't set the PROTECT fuse.
Change it to NOPROTECT. After programming, read the value
at address 0x3FF again. Is it the same ? Or, did your programmer
change it ?

Also, what programmer are you using ? What is your compiler version ?
Guest








PostPosted: Thu Oct 01, 2009 9:55 pm     Reply with quote

Thanks for the answer, well I don't have another 12f675, but I have plenty 629 that have a oscillator value of 0x3448. I am going to try with this value in the 675. My programmer is the pickit 2 programming in a IMAC and the version of the programmer is a brand new 4.093. I never have programmed a 675 before, but everything seems all right except this very issue, it is completely weird.

All in all I am not in my site of work (I don't know how to say where you have tools, materials and time to work, some help is required Very Happy ).

I am posting any kind of results here.

Thanks again.
rherrera72



Joined: 30 Sep 2009
Posts: 3

View user's profile Send private message

PostPosted: Thu Oct 15, 2009 10:26 pm     Reply with quote

Yep, the problem is solved!!!!, the correct value of the OSCAL is 0x3464, the programmer changed to 34FF.

thanks a lot.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
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