Jump to content
43oh

joeyeisinger

Members
  • Content Count

    5
  • Joined

  • Last visited

Reputation Activity

  1. Like
    joeyeisinger reacted to simpleavr in Inconsistent behavior   
    i just tried the ...usi08.c under avrgcc and it works.
    [EDIT] example code should be msp430x20x3_usi_07.c (master example)
     
    i don't have a slave and hooked it up instead to a pcf8563 rtc chip and changed the slave address (0xa2)
     
    it may be confusing as the time delay is 5000 counts between transmissions and it's like 200Hz, u may think that the led is constant on. i changed the time delay count to 50000 and it clearly shows on-off-on.
     

    while(1) { USICTL1 |= USIIFG; // Set flag and start communication LPM0; // CPU off, await USI interrupt _NOP(); // Used for IAR for (i = 0; i < 50000; i++); // Dummy delay between communication cycles, change to 50000 for better visual }
     
    i also verify by changing the slave address to something else and got constant led on. this verifies the master code works.
     

     
    can u try to change your delay count to eliminate the led flicking confusion?
     
    if that still doesn't work, may be it's a slave side problem.
     
     
    personally i won't use this code unless i am doing i2c all the time, software i2c is a lot more flexible and does not take up much space. and u can do it w/ any pins.
  2. Like
    joeyeisinger reacted to simpleavr in Inconsistent behavior   
    the difference for P1.6 between launchpad and breadboarded is that on the launchpad it is connected to a LED (unless u removed the jumper).
     
    may be to need to setup your pull-up / pull-down for P1.6 and P1.7 (if these are your SDA/SCLs) if u haven't done so
     
    typical i2c requires the bus master to have pull-ups, if u don't breadboard them physically, u should use internal pull-ups
     
    P1OUT |= 0xc0; // p1.6, p1.7 as pull-up high
    P1REN |= 0xc0; // enable resistor for the two pins
×
×
  • Create New...