CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

i2c, RS232?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
SiiE



Joined: 25 Aug 2010
Posts: 5

View user's profile Send private message

i2c, RS232?
PostPosted: Wed Aug 25, 2010 3:38 pm     Reply with quote

hi!

I have a little problem and I am stuck in my program so please I need help for this.

ok, this is the situation:

I have a list of text that I need to send to 3 pics at the same time, so I post my code. Is so simple, I just need send it on i2c or RDA, I dunno why, because I can't make a string of a 99999999 spaces because this list is repetitive.
Code:

#include <string.h>

void main()
{
int8 l[10405];
   setup_adc_ports(NO_ANALOGS);
   setup_adc(ADC_OFF);
   setup_psp(PSP_DISABLED);
   setup_spi(SPI_SS_DISABLED);
   setup_wdt(WDT_OFF);
   setup_timer_0(RTCC_INTERNAL);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_timer_3(T3_DISABLED|T3_DIV_BY_1);
   setup_comparator(NC_NC_NC_NC);
   setup_vref(FALSE);
//Setup_Oscillator parameter not selected from Intr Oscillator Config tab

   // TODO: USER CODE!!

while (true)
{

// i need put this in a array?? or i dont know, i know that this is wrong cuz //pic hasnĀ“t a lot of memory for all variables so?? any idea??
l[10404]="
*1*
l1=0x00014902;
l2=0x00024902;
l3=0x00044902;
l4=0x00084902;
*2*
l1=0x00014902;
l2=0x00024902;
l3=0x00044902;
l4=0x00084902;
*3*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*4*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*5*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*6*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*7*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*8*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*9*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*10*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*11*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*12*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*13*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*14*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*15*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*16*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*17*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*18*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*19*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*20*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*21*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*22*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*23*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*24*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*25*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*26*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*27*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*28*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*29*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*30*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*31*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*32*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*33*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*34*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*35*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*36*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*37*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*38*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*39*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*40*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*41*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*42*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*43*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*44*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*45*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*46*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*47*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*48*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*49*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*50*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*51*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*52*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*53*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*54*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*55*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*56*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*57*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*58*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*59*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*60*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*61*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*62*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*63*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*64*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*65*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*66*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*67*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*68*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*69*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*70*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*71*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*72*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*73*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*74*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*75*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*76*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*77*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*78*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*79*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*80*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*81*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*82*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*83*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*84*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*85*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*86*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*87*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*88*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*89*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*90*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*91*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*92*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*93*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*94*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*95*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*96*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*97*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*98*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*99*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*100*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*101*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*102*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*103*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*104*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*105*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*106*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*107*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*108*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*109*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*110*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*111*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*112*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*113*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*114*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*115*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*116*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*117*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*118*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*119*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*120*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*121*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*122*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*123*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*124*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*125*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*126*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*127*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*128*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*129*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*130*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*131*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*131*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*132*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*133*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*134*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*135*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*136*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*137*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*138*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*139*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*140*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*141*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*142*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*143*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*144*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*145*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*146*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*147*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*148*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*149*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*150*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*151*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*152*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*153*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*154*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*155*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*156*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*157*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*158*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*159*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*160*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*161*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*162*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*163*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*164*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*165*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*166*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*167*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*168*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*169*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*170*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*171*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*172*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*173*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*174*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
*175*
l1=0x00010004;
l2=0x00020004;
l3=0x00040004;
l4=0x00080004;
repeat=(100/100);
contador();";
}

}

So how can I do this???

Thanks in advance.
vinniewryan



Joined: 29 Jul 2009
Posts: 154
Location: at work

View user's profile Send private message MSN Messenger

PostPosted: Thu Aug 26, 2010 12:37 am     Reply with quote

You can make a simple counter code that sends the i2c data over and over until it reaches a certain number "X", this method would be very easy to setup, I've made a code snippet that you can try to integrate, it's pretty straight foreward although you'll need to make the listed changes to make it work.

Code:


//(Group A)
// l1=0x00014902;
// l2=0x00024902;
// l3=0x00044902;
// l4=0x00084902;
 
//(Group B)
// l1=0x00010004;
// l2=0x00020004;
// l3=0x00040004;
// l4=0x00080004;

int8 temp1=0;
int8 state=0;
int16 varX0=0; //number of zeros
int16 varX1=0;
int16 varX2=0;
int16 varX3=0;
int16 varX4=0;

//void main_function();{
//setup_i2c
//must set state to 1

X=();//how many times you want to send (Group B)". If you want group B to
//send continuously, remove the "if(temp1);" statement.
varX0=3;//amount of zero's

if(state==1)
{
   if(temp1<2) //send Group A 2 times;
   {

      varX1=14902;
      varX2=24902;
      varX3=44902;
      varX4=84902;
      temp1++;
      //i2c_transfer("*","%l","*","0x","%l","0x","%l","0x","%l',"0x","%l",count,varX1,varX2,"varX3","varX4");c
      count++;
   }
   else
   {
      temp1=0;
      state=2;
   }
}

if(state==2)
{
   if(temp1<X)
   {
      varX1=0x00010004;
      varX2=0x00020004;
      varX3=0x00040004;
      varX4=0x00080004;
      temp1++;
      //i2c_transfer("*","%l","*","0x","%l","0x","%l","0x","%l',"0x","%l",count,varX1,varX2,"varX3","varX4");   
      count++;
   }
   else //if temp is > X
   {
      //RESET (set state to 0, set temp1 to 0,set count to 0)
   }
}

//}//main_function

_________________
Vinnie Ryan
SiiE



Joined: 25 Aug 2010
Posts: 5

View user's profile Send private message

PostPosted: Thu Aug 26, 2010 9:30 am     Reply with quote

Thx vinniewryan but the problem is still here because that code is just if the group B won't change, and all groups (176 groups) change, and after that I need to put another 3334 groups with different values for all groups. So I need change all groups at the same time to 176 pics, *1* is for PIC 1 and *2* PIC 2 etc...

The values I obtain for a program that I made in Delphi7. So I can't change the code at my way, is possible to do that?? Maybe via RS232 can do this???


Thanks :D
vinniewryan



Joined: 29 Jul 2009
Posts: 154
Location: at work

View user's profile Send private message MSN Messenger

PostPosted: Thu Aug 26, 2010 11:45 am     Reply with quote

I see,

So I take it you're trying to read lines of text from an input, and send the read data out to 175 different pics, so I'm assuming *1* - *175* signifies which pic you're communicating with?

If this is the case, simply change the above code to read the incoming data and save it as varXX every frame, and send the data out every frame, incrementing which pic you're communicating with each time.

It would help me understand if you could post a basic map of what the general function of this program/MCU is, such as:

Code:

MCU reads incoming text
MCU converts text to i2c
MCU transmits data to 175 different one at a time
MCU repeats this every time the incoming text changes


Thanks!
_________________
Vinnie Ryan
SiiE



Joined: 25 Aug 2010
Posts: 5

View user's profile Send private message

ok this is the proccess
PostPosted: Fri Aug 27, 2010 10:11 am     Reply with quote

vinniewryan wrote:
I see,

So I take it you're trying to read lines of text from an input, and send the read data out to 175 different pics, so I'm assuming *1* - *175* signifies which pic you're communicating with?

If this is the case, simply change the above code to read the incoming data and save it as varXX every frame, and send the data out every frame, incrementing which pic you're communicating with each time.

It would help me understand if you could post a basic map of what the general function of this program/MCU is, such as:

Code:

MCU reads incoming text
MCU converts text to i2c
MCU transmits data to 175 different one at a time
MCU repeats this every time the incoming text changes


Thanks!



thxs vinnie the proccess that I do is this:

1.- I make a file .txt in delphi with the source that i need to send (*1* l1=0x00012389789; etc... like the other posted).

2.- In that file I need to copy/paste to put into my PIC that is a master for the other 176 PIC's that I need.

3.- The PIC need to send that information (with a minuimum about 882 lines with 10404 characters and maximum 17640 lines and 208080 characters) so for example:

*1*
l1=0x000123456;
l2=......
l3=......
l4=.....
*2*
.
.
.
*176*

//here will be more of that so..
*1*
l1=0x000123456
l2=....
l3=....
l4=....
.
.
.
*176*
//this is repetitive so i have 20 *1* and 20 *176* and every l1,l2,l3,l4 have different value.

4.- All the lines are different so everytime that I call for example l1 the next l1 have a diferent value so I need to send all the lines at the same time for all the 176 PICs.

The other 176 PIC's are Slaves so with the information that they get from i2c they will make the orders that I need.

About that you assume *1*- *176* is ok. That is what PIC (slave mode) i mean.



Thank you for your help!!
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Fri Aug 27, 2010 11:45 am     Reply with quote

176 PIC I2C slaves?

I trust you're using 10bit addressing as "normal" mode is only 7bits (1 bit reserved for Read/Write).

In any case, if you used 10bit addressing, you could easily have a "broadcast" address of say all 1's (not including the r/w bit) and then send required item to ALL slaves at the same time.

Granted the Slaves' ACK bit would have to be ignored by the master... but would get your through your datasheet a little faster...

No?

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
SiiE



Joined: 25 Aug 2010
Posts: 5

View user's profile Send private message

PostPosted: Fri Aug 27, 2010 12:37 pm     Reply with quote

bkamen wrote:
176 PIC I2C slaves?

I trust you're using 10bit addressing as "normal" mode is only 7bits (1 bit reserved for Read/Write).

In any case, if you used 10bit addressing, you could easily have a "broadcast" address of say all 1's (not including the r/w bit) and then send required item to ALL slaves at the same time.

Granted the Slaves' ACK bit would have to be ignored by the master... but would get your through your datasheet a little faster...

No?

-Ben


Hi Ben

Is my first communication via i2c so I dunno whats a 10bit adressing... About the broadcast how can I send it???
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Fri Aug 27, 2010 2:06 pm     Reply with quote

SiiE wrote:

Hi Ben

Is my first communication via i2c so I dunno whats a 10bit adressing... About the broadcast how can I send it???


You need to read the original specifications first:

http://www.benjammin.net/~bkamen/pdf/i2c-specification-v2.1-jan2000.pdf

This will explain how I2C works.

While I don't know any specific devices off the top of my head that do "broadcast" style addressing, it might be something you can do in your application --- at your decision.

TCP/IP uses broadcast addressing all the time. Essentially it's considered an address on the network of all 1's.

Without getting into the Collision Detection of something like ethernet, consider your I2C buss only uses the "broadcast" address when the Master wants to talk to all the slaves and requires that none of the slaves talk back.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
SiiE



Joined: 25 Aug 2010
Posts: 5

View user's profile Send private message

PostPosted: Sun Aug 29, 2010 11:36 am     Reply with quote

ok ty very much lemme check it :D
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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