Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Reset a 16F628A at power up

Status
Not open for further replies.
This is how i do a "ACK":

Code:
void i2c_ack(void){
    SDA_TRIS = 1;   //SDA Input
    i2c_clock();
    while(SDA);
    SDA_TRIS = 0;
}

or

Code:
void i2c_ack(void){
    SDA_TRIS = 1;   //SDA = Input
    i2c_clock();
    delay_ms(5);
    //while(SDA);
    SDA_TRIS = 0; // SDA = Output
}
 
Last edited:
the main. Not the ds1307.c
Mainly because it sets the SDA_TRIS (which you should change to the actual SDA TRIS ex: TRISC 4)

Not sure how to set it in: CSS's PIC C compiler
 
Last edited:
im downloading the demo of it now to test it out.

EDIT:
In the help file i see:

I2C_WRITE( )

Sends a single byte over the I2C interface. In master mode this function will
generate a clock with the data and in slave mode it will wait for the clock from
the master. No automatic timeout is provided in this function. This function returns the ACK bit.
The LSB of the first write after a start determines the direction of data transfer (0 is master to slave).
Note that specific I2C protocol depends on the slave device.
 
Last edited:
I remember in my I2C experience some devices give an ACK and some don't. You've got look at the timing diagrams in the device datasheet.

One trick if you have a PICkit2 you can use the LA tool to watch the I2C data go by. If you're really lucky a tool with an I2C sniffer is a real lifesaver. I had an I2C multimaster system running and a I2C sniffer allowed me to see the problems very quickly.
 
SteveyD:

Have you yet to change the power supply? What type of dc-dc you are using? A 7805? If so whats the exact model? Some only output 100mA or 250mA you might need to check that also.

Bill:
I just remembered i have 8 MAX6953's on hand and will be testing it out soon today. I also ordered **broken link removed**. They are only $1.49 each if buying less than 8.
 
Bill:
I hate when you are right lol (just kidding). Im sure i can make a few Dot Matrix displays. Its not all bad i get to code a bunch to make a pic interface with the 5x7 displays i ordered and $12 for 10 displays (2 color) you cant go wrong. Ill have fun with it. Thanks for the info.
EDIT: I just calculated it... I can build 56 Displays for $40 Thats less than a $1 each (about $0.70) . (but then factor in the actual PCB and stuff and its more lol) But still a nice project!
EDIT2: Just got a small PCB form RS(radio shack $2) and will have a 2 digit 5x7 matrixs:

ACTUAL LEDS 5x7 = 33mm(H) x 25mm(W)
2 Digit Side by Side = 53mm (25mm x 2) + 3mm space in between
whole board: 47mm(H) x 72mm(W)

SteveyD:
After working on this with you for a while ive lost track. What exactly is the issue with the project?
 
Last edited:
Still encountering the same sporatic start-up with this code.

Wondering if I might have the #Fuses incorrect

Code:
#FUSES NOWDT, XT, NOPUT, NOBROWNOUT, NOMCLR, NOLVP, NOCPD //628A

Brownout is the same as BOR, correct?
Turning it on may allow a similiar condition as POR?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top