slave

Status
Not open for further replies.

ppcv

New Member
Hi
need help on PIC controller(16F876A /18f2520) - coding. The controller
should work as slave - means - the controller will get 8 bit data from host - and the controller should dump the data in eeprom.
The host will send the serial clock at 1Mhz to 20Mhz and the data speed can also be the same.
If the controller doesnt able to load the entire 8bit data into eeprom - it has to download each bit in buffer and dump the data into external eeprom.
can u assist me in this .
 
Your speed requirements seem excessively high, a 16F876 running off a 20MHz clock runs internally at 5MHz - 200nS per instruction. Also, writing to EEPROM is a very slow procedure, taking milliseconds of time to do so.

What actually are you trying to do?.
 
Hi
Not a problem of the speed writing into the eeprom.
My intension is -my controller is connected to another master controller and controlled by the host controller with software in it.
First the master controller has to detect the slave controller,after detecting the slave controller - master will intiate the process by sending the serial clock of 1Mhz(now max) to 20Mhz - then the host will send a data to the slave max speed of 1Mhz.The data has to be stored in eeprom(as told earlier ).After getting the data from host- the slave will intiate the pattern generation to the driver circuit.Once the data is started downloading into eeprom - the controller can start the pattern generation.
by the time the pattern generation got finished - the data download into the eeprom should also finish.
this is my full application.
can u help me on this and kindly help me on this.
 
Speed is everything as Nigel has mentioned, as you have probably overestimated the humble PIC. A 20MHz PIC can only operate at 5MIPs max. That's millions of instructions per second. You can easily imagine how many instructions you need to simply read a single input, and pass it to EEPROM, not forgetting that the PIC still needs additional cycles for your "pattern generation" and that EEPROM always introduces significant delays. Furthermore, the PIC's limited RAM certainly places a huge constraint on how large your buffer can be.
 
Hi
18F2520 - operating frequency upto 40Mhz - can i use this controller for the application which i mentioned earlier.
in which method -and in which controller can i implement my application.
my main constraint is working voltage and mechanical dimensions of the controller -it should work from 2V to 5V and height of the controller.
can anyone suggest to proceed further.
 
ppcv said:
Hi
18F2520 - operating frequency upto 40Mhz - can i use this controller for the application which i mentioned earlier.

That gives 10MIPS.

Why are you trying to send data at such a high speed?, if you give more details of what we are trying to do we might be able to offer suggestions.
 
I took a quick glance at a PIC18 datasheet. The erase/write cycle time of an EEPROM is already 4ms. Hence if all other operations are assumed instantaneous, the highest write rate it can support is 250Bps, or 2Kbps. Still a far cry from your 1Mbps. Just trying to show you that your requirements are not a few times over-speced for the PIC, but actually a few orders of magnitude.
You have not mentioned the uP used for the master controller, so I'm assuming that it's fast enough to handle the 1Mbps transfer. If so, why not consider a direct write from the master controller to FLASH memory. You may still use a PIC to access this FLASH memory, and do whatever pattern generation you need.
 
If so, why not consider a direct write from the master controller to FLASH memory. You may still use a PIC to access this FLASH memory, and do whatever pattern generation you need.
 
I was referring to external FLASH memory like CF. Those are mostly rated to have maximum speeds in the range of MBps. Anything that goes through the PIC will gonna be too slow.

So it may be something like
1. Host controller queries for slave
2. Slave replies
3. Host controller writes to CF
4. Slave queries from CF

Of course, it would be best if you can relax your requirement for such high speeds.
 
yes, the idea given is fine.
can u pl.send me the tips or the source code which u said and it will be helpful to me.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…