Adding EEprom

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Adding EEprom

Post by jollybv »

Hi Guys

I have run out of program memory in the chip in using PIC18F46K80 and would like to change to the PIC18F47J13 which has 128k program memory and pin out are the same. The only thing is that it dose not have any eeprom on board so i would like to fit a 24lC640 my only problem is I don't understand the memory component as it dose not let you select a pin for the CS must i use any pin and just before i read or wright pull the CS down and when finished pull it up.

Another question if i change from 8 bit chip to 16 bit will the program still work?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Adding EEprom

Post by Benj »

Hello Brian,

I see the EEPROM module uses SPI communications. Yes you use any I/O pin to drive the CS signal. Simply pull it low to start a transaction and pull it high again when your done.

More info on SPI comms can be found here.
http://www.matrixtsl.com/blog/simplifie ... c-and-spi/

The program should still work fine on a move from 8-bit to 16-bit. The only problems might be if you have any C code or other device specific code in your program. You may also have to move your connections around to satisfy the layout of the new device.

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Re: Adding EEprom

Post by jollybv »

Hi Ben

My chips have arrived now i want to start playing around with them Please let me know if I'm thinking on the right lines. The PIC18F47J13 can have a clock speed of 48Mhz, I need to increase the speed i scan the SD card so if I connect a 48Mhz crystal will this shorten the scan time and will the delays in the program all stay the same

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Re: Adding EEprom

Post by jollybv »

Hi Guys

Im Trying to get this flasher program to work on the PIC18F47J13 but keep getting an Error code 3. I have tried changing the config settings but still the same can someone please help

Target Detected
Device ID Revision = 00000001

Erasing ...
Erase device complete

Programming Device ...
Configuration Memory
Address: 0001fff9 Expected Value: 000000fc Received Value: 000000f4
Programming failed

Failed to perform Program !!!
C:\Program Files\Flowcode 6\tools\PICkit3\PK3CMD.exe reported error code 3


FINISHED
Attachments
Flasher.fcfx
(3.51 KiB) Downloaded 264 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Adding EEprom

Post by Benj »

Hello Brian,

Try using MPLAB 8.92 to send new firmware to the PICkit. I get similar issues sometimes and re-flashing the firmware normally brings the PICkit back to life. Saying this I have also had a few PICkit's just fall over a die after a while so this is a potential.

Increasing the clock speed will increase the SPI rate and as long as you adjust the clock frequency setting in your project options delays should still work correctly.

Normally you can use a lower frequency crystal and use the PLL module on the chip to multiply the frequency up to 48MHz. Saves having 48MHz signals flying around on your hardware generating high frequency noise.

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Re: Adding EEprom

Post by jollybv »

Hi Ben

Thanks for that what i found In the Config Word Signature Bit setting if i set that to Bulk erase of memory area complete then it program's the PIC

Post Reply