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.
So at this point it may be safe to say that 12vdc @ 170mA power supply the power-up on the entire circuit is going beyond a Brown-out and doing what? Resetting the Pic, or starving it beyond it ability to function?
 
not sure really. I think that if there is not enough current to share then the pic should stop at some point and if Watchdog is on it will reset and if not it will hang until manual reset. you will need a 1A output for sure. if using 4 digits that about 644mA for 4 digits. then add in the PIC and anything else.

Try using a 1A supply and see if it helps.

EDIT:
Have a look at me 7 SEG 4 digit (not done yet)
7seg-jpg.23039

7seg2-jpg.23040
 

Attachments

  • 7seg.jpg
    7seg.jpg
    421.6 KB · Views: 1,062
  • 7seg2.jpg
    7seg2.jpg
    562.7 KB · Views: 923
Last edited:
Very first #FUSES is NOWDT

So remove that FUSE to allow a reset?

Also get a better PSU.. something like an old filtered Laptop psu brick.

Thanks I'll try both but it wont be for day or two until I get my gear unpacked again.
 
series would suck for this. If 1 led went out the whole segment would not work. Hence the parallel.

If you consider that a problem (which it shouldn't be, as wired in series the LED's would be reliable), then put them in parallel, but with an individual series resistor on each one - doing it like you've done it so far will drastically shorten the life of the LED's.
 
I wish i knew that before i built this. But Im sure it wont make too much of a hassle. Next time ill be sure to make some 5x7 matrix for a clock :D
 
I was following the thread and was doing custom PCB using the MAX6952 as the core.
The MAX6952 is a quad 5x7 LED matrix driver with SPI interface. Built in 5x7 character set too. About $18 from Digikey.
One PCB would contain a MAX6952 driving four 5x7 2" displays (10x14 grid) with space for an optional PIC for stand alone operation. Can be stacked in any direction for a larger matrix.
Kit expected to be near $90 though.
 
Nice bill! If it comes with the matrix i would buy it :D

Nigel: i guess i dont read too much lol. The next thing i have in mind is a nice large matrix. Maybe something big enough to put on my wall and make a USB interface and a custom program to display weather, time, date and some other things like email alerts etc...
LIKE 4 - 8 of these : **broken link removed**

STEVEYD: Be sure to let us know how it goes.

EDIT: Nigel i found this :
Powering Light Emitting Diodes (LEDs)
 
Last edited:
I've placed a Logic probe on pins 5&6 that are connected to the DS1307 RTC.

On several start ups there is NO signs of life on these pins, on the 2 occasions it did run during these tests, the circuit ran fine.

SO.. the problem is between the 628a and the DS1307, or just the DS1307?

I've replace the 1307 with a new one and still get the same results.

Now using a 13.6vdc 3.2amp psu.
 
Looking at the code I posted back on page 1 of this thread, and consider that the ds1307 is not communicating with the 628a on power-up, Do I have A2 and A3 inputs set correctly? should they be analog or digital and how to set them?
 
im using a DS1337. Do you have the main SCL and SDA pulled high?

EDIT: I dont see you "acknowledge" in the code. Here is my C code (but for C18) :


Code:
char rtc_write(char offset, char data){

    char temp;
    i2c_start();                //Start
    i2c_byte(slave_w);          //Slave Byte
    i2c_ack();                  //ACK
    i2c_byte(offset);           //Address Offset
    i2c_ack();                  //ACK
    i2c_byte(data);          //Slave Byte
    i2c_ack();                  //ACK
    i2c_stop;                    //Stop
    return temp;
}
char rtc_read(char offset){

    char temp;
    i2c_start();                //Start
    i2c_byte(slave_w);          //Slave Byte
    i2c_ack();                  //ACK
    i2c_byte(offset);           //Address Offset
    i2c_ack();                  //ACK
    i2c_start();                //Start
    i2c_byte(slave_r);          //Slave Byte    
    i2c_ack();                  //ACK
    temp = i2c_input();         //Get Data
    i2c_ack();                  //ACK
    i2c_stop;                    //Stop
    return temp;
}

Edit #2:
Added some images.
 

Attachments

  • 7seg2.jpg
    7seg2.jpg
    620.6 KB · Views: 287
  • 7seg3.jpg
    7seg3.jpg
    695.7 KB · Views: 217
Last edited:
Both are pulled high with 1K resistors.

Never knew about the ACK command.. Let me check all the files associated with the compile.
 
Here is the ds1307.c

Code:
//========================================
//========================================
//            ds1307.c
//              2008
//========================================
//========================================
#device PIC16F628A
#define RTC_SDA  41
#define RTC_SCL  42

#use i2c(master, sda=RTC_SDA, scl=RTC_SCL) 


//========================================
// initial DS1307
//========================================
void init_DS1307()
{
output_float(RTC_SCL);
output_float(RTC_SDA);
}

//========================================
// write data one byte to DS1307
//========================================
void write_DS1307(byte address, BYTE data)
{
short int status;
i2c_start();
i2c_write(0xd0);
i2c_write(address);
i2c_write(data);
i2c_stop();
i2c_start();
status=i2c_write(0xd0);
while(status==1)
{
   i2c_start();
   status=i2c_write(0xd0);
}
}

//========================================
// read data one byte from DS1307
//========================================
BYTE read_DS1307(byte address)
{
BYTE data;
i2c_start();
i2c_write(0xd0);
i2c_write(address);
i2c_start();
i2c_write(0xd1);
data=i2c_read(0);
i2c_stop();
return(data);
}

Nope dont see an ACK command in this code or the main code on the first page. Let me see if I can figure out where to place the command.
 
Now this brings me to another question.

Keep in mind I inherited this file and all its mess, so I dont understand some of the reasoning behind some of it at this point. and this is one of them..

The code contained in the ds1307.c is exactly the same as the code contained on the main program on page 1 of this thread.

The only difference is the
Code:
#include <16F628A.h> 
#define RTC_SDA         PIN_A2                
#define RTC_SCL         PIN_A3

and the
Code:
#device PIC16F628A
#define RTC_SDA  41
#define RTC_SCL  42

in this case they both define the same pins.

If they are both the same damn instructions, why does it need to
Code:
#include <ds1820.c>
in the main code then repeat itself a few lines later.

Should I remove the code on the main file or leave it there and remove the #include?

Or is there a reason for both I dont yet understand.
 
Compiler is CSS's PIC C compiler v4.047

The .pdf indicates the slave returns an ack bit after each byte recieved.
 
you have to wait for the bit tho. When that bit returns you can continue. If your pic is sending while the slave is sending then you slave wont get some info because its busy
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top