shaun_c_m
Junior Member level 2

16f877 serial
hello, i was wondering if anyone could help me with a pic arrangement using a serial protocol. im attempting to create a single master multiple slave combination using the 16F877A pic for all units.
what i would need is for the master device to be able to initiate a transfer to one of the slaves. i need it to address the slave which is to be transmit to, and also have a general call option.
the master will need to be able to send 10 bytes to the slave device(s) in question, and these will be stored into tempory memory as variables. i will alocate fixed locations for these.
the speed of transfer is not a major issue. i will be running at 20 Mhz crystal, and i need the transfer to complete in under one tenth of a second max. i was planning to write software for this part, but when i realised that there was hardware to perform it, i started trying to use it instead.
i have been trying to use the I2C function, but i am not limited to using this particular method.
the master should interupt the slave devices
the slave should ignore if address does not match
if address matches then the following 10 bytes should be recieved and stored
the communication will only be in 1 direction, master to slave
the distance between devices will be 30 cm (pcb track length) max
i can spare 2 pins (3 if absolutely neccesairy)
it should be a reliable, ie low corruption protocol
the devices will be running on independant clocks, but all at 20 MHz
there will be 1 master, 5 slaves
ports that are analogue capable are allready being used
i am using the 40 pin version of the chip
i am using assembler to program, but i dont know if relocateable code is working reliably due to using a strange programmer (velleman VM111). when i was playing about with PWM i eventually got it working by removing the relocation and hard coding it into specific banks, but as i only have limited experience with pics, im finding this difficult with I2C.
given the low speed requirement of the task, it would probably be easier to write software to perform it. however if anyone can give me any advice on using the hardware i would appreciate it. also if anyone has any code/ a step by step guide on how to implement such a function i would be appreciative.
thanks
(sorry if it was all a bit long winded)
hello, i was wondering if anyone could help me with a pic arrangement using a serial protocol. im attempting to create a single master multiple slave combination using the 16F877A pic for all units.
what i would need is for the master device to be able to initiate a transfer to one of the slaves. i need it to address the slave which is to be transmit to, and also have a general call option.
the master will need to be able to send 10 bytes to the slave device(s) in question, and these will be stored into tempory memory as variables. i will alocate fixed locations for these.
the speed of transfer is not a major issue. i will be running at 20 Mhz crystal, and i need the transfer to complete in under one tenth of a second max. i was planning to write software for this part, but when i realised that there was hardware to perform it, i started trying to use it instead.
i have been trying to use the I2C function, but i am not limited to using this particular method.
the master should interupt the slave devices
the slave should ignore if address does not match
if address matches then the following 10 bytes should be recieved and stored
the communication will only be in 1 direction, master to slave
the distance between devices will be 30 cm (pcb track length) max
i can spare 2 pins (3 if absolutely neccesairy)
it should be a reliable, ie low corruption protocol
the devices will be running on independant clocks, but all at 20 MHz
there will be 1 master, 5 slaves
ports that are analogue capable are allready being used
i am using the 40 pin version of the chip
i am using assembler to program, but i dont know if relocateable code is working reliably due to using a strange programmer (velleman VM111). when i was playing about with PWM i eventually got it working by removing the relocation and hard coding it into specific banks, but as i only have limited experience with pics, im finding this difficult with I2C.
given the low speed requirement of the task, it would probably be easier to write software to perform it. however if anyone can give me any advice on using the hardware i would appreciate it. also if anyone has any code/ a step by step guide on how to implement such a function i would be appreciative.
thanks
(sorry if it was all a bit long winded)