Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 14th March 2004, 04:05 PM   (permalink)
Default Program Help

I am trying to write a program for a project which includes a PIC connected to a DS1307 real time clock and 24LC64 serial EEPROM but I can't find anything on writing a Basic program for these. Both will be using I2C and will connected seperately to simplify the program plus I have enough free ports for this. If anyone knows any tutorials or could give me a simple program I would be very greatful
Timmymna is offline  
Old 14th March 2004, 07:08 PM   (permalink)
Default Re: Program Help

Quote:
Originally Posted by Timmymna
I am trying to write a program for a project which includes a PIC connected to a DS1307 real time clock and 24LC64 serial EEPROM but I can't find anything on writing a Basic program for these. Both will be using I2C and will connected seperately to simplify the program plus I have enough free ports for this. If anyone knows any tutorials or could give me a simple program I would be very greatful
I can't help you with BASIC code, but there are I2C routines in my tutorials. Also connecting them separately won't simplify things, it will make it more complicated - I2C is designed (and intended) to connect all devices on a single bus. If you connected them separately you would access them exactly the same as you would on the same bus, but have to do it twice.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 14th March 2004, 09:56 PM   (permalink)
Default

Thanks for the reply, I've worked it out now
I have another question though.
I am reading the value for the month from the real time clock but its as a number such as 0 - jan, 1 - feb, 2 - mar etc, and wanted to write some code so I could display the month name rather than the number. Could I do this with a lookup table or would I have to do something like
if month = 0 then monthname = "jan"
if month = 2 then monthname = "feb"

Any help is much appreciated
Timmymna is offline  
Old 15th March 2004, 06:45 AM   (permalink)
Default

Quote:
Originally Posted by Timmymna
Thanks for the reply, I've worked it out now
I have another question though.
I am reading the value for the month from the real time clock but its as a number such as 0 - jan, 1 - feb, 2 - mar etc, and wanted to write some code so I could display the month name rather than the number. Could I do this with a lookup table or would I have to do something like
if month = 0 then monthname = "jan"
if month = 2 then monthname = "feb"

Any help is much appreciated
The classic way would be a string array, but I don't know if your BASIC allows them. Lookup tables generally only return a single byte.
Does your compiler allow Case/End Case statements, you could use that, if not your If/Then solution looks favourite.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 05:20 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker