|
|
View previous topic :: View next topic |
Author |
Message |
rherrera72
Joined: 30 Sep 2009 Posts: 3
|
12f675 rs232 problem transmit ok, receive bad, max232 ok |
Posted: Wed Sep 30, 2009 6:29 pm |
|
|
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
******* .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
|
|
Posted: Wed Sep 30, 2009 7:08 pm |
|
|
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
|
|
Posted: Thu Oct 01, 2009 9:55 pm |
|
|
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 ).
I am posting any kind of results here.
Thanks again. |
|
|
rherrera72
Joined: 30 Sep 2009 Posts: 3
|
|
Posted: Thu Oct 15, 2009 10:26 pm |
|
|
Yep, the problem is solved!!!!, the correct value of the OSCAL is 0x3464, the programmer changed to 34FF.
thanks a lot. |
|
|
|
|
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
|