|
|
View previous topic :: View next topic |
Author |
Message |
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
Re: Writing to FRAM Chip with ID1,2,3 etc. does not work.... |
Posted: Sat Aug 02, 2003 1:19 pm |
|
|
In the second example, you have tied Pin A0 high and A1 & A2 low?
:=<font face="Courier New" size=-1>Using FRAM chip ID #0 works
:=
:=void write_fram(long int address, byte data)
:={
:= i2c_start();
:= i2c_write(0XA0);//Hard coded to use Chip ID #0 for Write
:= i2c_write((char)(address >> 8));
:= i2c_write((char)address);
:= i2c_write(data);
:= i2c_stop();
:=}
:=
:=With 8 FRAM chips I need to select the chip, this code does not work!
:=
:=void write_fram(long int address, byte data)
:={
:= i2c_start();
:= i2c_write(0XA2);//Hard coded to use Chip ID #1 for Write
:= i2c_write((char)(address >> 8));
:= i2c_write((char)address);
:= i2c_write(data);
:= i2c_stop();
:=}
:=
:=Time to up up the analyzer...
:=
:=</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516608 |
|
|
Hans Wedemeyer Guest
|
Re: Writing to FRAM Chip with ID1,2,3 etc. does not work.... |
Posted: Sat Aug 02, 2003 1:31 pm |
|
|
you caught it before I erased it... Thanks..
Wish I could get that debugger o work...
It's a pain doing this all with printf...
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516609 |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
Re: Writing to FRAM Chip with ID1,2,3 etc. does not work.... |
Posted: Sat Aug 02, 2003 7:08 pm |
|
|
Do you have anything else connected to RB6 & RB7 (I am assuming these are the debugging pins on your micro)? What does the circuit for your memory clear look like?
:=you caught it before I erased it... Thanks..
:=Wish I could get that debugger o work...
:=It's a pain doing this all with printf...
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516612 |
|
|
Hans Wedemeyer Guest
|
Re: Writing to FRAM Chip with ID1,2,3 etc. does not work.... |
Posted: Sat Aug 02, 2003 8:54 pm |
|
|
RB6,7 are dedicated for the ICD2 so there shoul;d be no problem there.
Memory clear !... I don't understand !
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516614 |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
Re: Writing to FRAM Chip with ID1,2,3 etc. does not work.... |
Posted: Sat Aug 02, 2003 10:34 pm |
|
|
The MCLR pin. How is it connected? Pullup resistor, series resistor... Where in the circuit is Pin 1 of the ICD connected? It should go straight to the chip.
:=RB6,7 are dedicated for the ICD2 so there shoul;d be no problem there.
:=Memory clear !... I don't understand !
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516615 |
|
|
Hans Wedemeyer Guest
|
Re: Writing to FRAM Chip with ID1,2,3 etc. does not work.... |
Posted: Sun Aug 03, 2003 12:52 am |
|
|
OK now I understand.
I use the power up timer, so in "normal mode" MCLR is connected by jumper to Vdd.
For ICSP and when the ICD2 is connected the jumper is removed and the MCLR goes directly to the Programmer or ICD2...
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516616 |
|
|
R.J.Hamlett Guest
|
Re: Writing to FRAM Chip with ID1,2,3 etc. does not work.... |
Posted: Sun Aug 03, 2003 4:33 am |
|
|
:=The MCLR pin. How is it connected? Pullup resistor, series resistor... Where in the circuit is Pin 1 of the ICD connected? It should go straight to the chip.
:=
:=:=RB6,7 are dedicated for the ICD2 so there shoul;d be no problem there.
:=:=Memory clear !... I don't understand !
MCLR, is the 'master clear', or 'reset'. It doesn't do anything at all to the processors 'memory', so I'd avoid referring to it as 'memory clear'....
Best Wishes
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516617 |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
Re: Writing to FRAM Chip with ID1,2,3 etc. does not work.... |
Posted: Sun Aug 03, 2003 8:14 am |
|
|
You might try this:
Use a 10K pullup with a 0.1uF cap to ground. Then a series 470 ohm resistor to MCLR. This is the way we do our designs and haven't had any problems with the ICD. It is also the way the PICDEM2 is wired.
:=OK now I understand.
:=I use the power up timer, so in "normal mode" MCLR is connected by jumper to Vdd.
:=For ICSP and when the ICD2 is connected the jumper is removed and the MCLR goes directly to the Programmer or ICD2...
:=
:=
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516621 |
|
|
Hans Wedemeyer Guest
|
Re: Writing to FRAM Chip with ID1,2,3 etc. does not work.... |
Posted: Sun Aug 03, 2003 9:49 am |
|
|
The resistor should not be needed at all. The if Power Timer is used MCLR can be wired to Vdd.
The PicDem boards do it, becasue some people want access tot MCLR during the program execution (forced reset) I've alwasy wondered why it was never multiplexed and allowed to become another I/O. The powerup timer dealys startup by just a few milliseconds, so for most applications, as in your case you can save the cost of the three components and the extra labor involove, not least save the board space...
However I think the issue is the CCS compiler/interface to MPLAB.
I can't see the resistor ect. casuing all the #fuese to be ignored.
I have every version of PCWH and will regress unitl I find one that works.
Thanks for the help..
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516625 |
|
|
Hans Wedemeyer Guest
|
Re: Writing to FRAM Chip with ID1,2,3 etc. does not work.... |
Posted: Sun Aug 03, 2003 9:51 am |
|
|
Yep that's why I got confused. This thread started with memory issues, which I fixed, and then led into the ICD2 problem so....
thanks
hansw
PS I do know what the MCLR is for :-) :-)
:=MCLR, is the 'master clear', or 'reset'. It doesn't do anything at all to the processors 'memory', so I'd avoid referring to it as 'memory clear'....
:=
:=Best Wishes
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516626 |
|
|
R.J.Hamlett Guest
|
Re: Writing to FRAM Chip with ID1,2,3 etc. does not work.... |
Posted: Sun Aug 03, 2003 10:22 am |
|
|
:=Yep that's why I got confused. This thread started with memory issues, which I fixed, and then led into the ICD2 problem so....
:=
:=thanks
:=hansw
:=PS I do know what the MCLR is for :-) :-)
:=
Yes. I think it was Mark's use of the term, that i felt it really worth 'correcting', before it confused anyone else!...
Good luck on getting the unit to work. :-)
:=:=MCLR, is the 'master clear', or 'reset'. It doesn't do anything at all to the processors 'memory', so I'd avoid referring to it as 'memory clear'....
:=:=
:=:=Best Wishes
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516629 |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
Re: Writing to FRAM Chip with ID1,2,3 etc. does not work.... |
Posted: Sun Aug 03, 2003 3:05 pm |
|
|
Our Marketing Department likes to have a "Reset" button on the products. Thus we usually need the extra components and it is one less jumper that the field guys have to remember to remove if they reflash the device. Besides, if you buy a 100 thousand resistors they become really cheap.
:=The resistor should not be needed at all. The if Power Timer is used MCLR can be wired to Vdd.
:=
:=The PicDem boards do it, becasue some people want access tot MCLR during the program execution (forced reset) I've alwasy wondered why it was never multiplexed and allowed to become another I/O. The powerup timer dealys startup by just a few milliseconds, so for most applications, as in your case you can save the cost of the three components and the extra labor involove, not least save the board space...
:=
:=However I think the issue is the CCS compiler/interface to MPLAB.
:=I can't see the resistor ect. casuing all the #fuese to be ignored.
:=
:=I have every version of PCWH and will regress unitl I find one that works.
:=
:=Thanks for the help..
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516634 |
|
|
Hans Wedemeyer Guest
|
Re: Writing to FRAM Chip with ID1,2,3 etc. does not work.... |
Posted: Sun Aug 03, 2003 9:26 pm |
|
|
It gets more interesting than that...
With the MCLR dedicated to the ICD-2 (as I do when programming ICSP) it all worked fine for several hours. Then the ICD 2 failed and would not pass the self test because it could NOT pull MCLR to GND !
So, I added a simple 10K pull up and bingo it all worked again...
Two lessons to be learned here...
1) Listen to someone that has experience with the item concerned (ICD 2)
2) If planning to ICSP only then not including the resistor is fine, but if planning to use ICD 2 then make sure to add a 10K pull up.... Look slike Micro Chip got cheap and could have included the 10K in the ICD 2.... see saving money ...
Thanks for the help.
Hans Wedemeyer
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516637 |
|
|
|
|
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
|