Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

MCP3204 interfacing with 89C52 microcontroller

Status
Not open for further replies.

14dhrumit

Member level 3
Joined
Nov 17, 2012
Messages
61
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
Hamilton, Ontario, Canada
Activity points
1,653
I am using three sensors(soil moisture, LDR and rain sensor) with ADC MCP3204 which is interfaced with 89C52 controller and now i need to program that but i am not able to make it...
Moreover, I need to display the moisture content on LCD and that too in percentage(%).
Can anybody help,, please?? It would really be appreciated...
 

You have to use SPI.
 

Attachments

  • adcspi.jpg
    adcspi.jpg
    317.5 KB · Views: 95

what about the programming?

I am not good at it, so can you help me out?

- - - Updated - - -

and how am i suppose to do that?
 

There is no hardware SPI in AT89C52. You have to use Software SPI or use AT89S8253 which has hardware SPI. Can you use AT89S8253?

This project I did using AT89C51. I can recompile it for AT89C52 if you want.
 

Attachments

  • adc_spi.jpg
    adc_spi.jpg
    416.3 KB · Views: 106
Last edited:

I can but will there be any changes that i have to make in my hardware due to this controller??
If yes, then i can't use it. If there wouldn't be any kind of changes then only i can use it..
 

See the data sheet of AT89S8253 and compare pin functions with that of AT89C52. If you have differences then don't use as you don't want to make hardware changes. I can write the code for AT89C52 but using mikroC PRO 8051 and not Keil. If you want Keil C51 code then I need more time as I have to write Software SPI library for it.

Edit: There is no difference between the two chips except that it has SPI functions on PORTS 1.5, 1.6, and 1.7. I have used the same pins in SoftSPI code. IYou can use the AT89S8253 chip and I will write the code using mikroC using Hardware SPI library. If you want me to write the hardware or software SPI library then I need more time. I will post AT89S8253 Hardware SPI C Code and At89C52 Software SPI C code tomorrow.
 

Attachments

  • 8253spi.jpg
    8253spi.jpg
    140.7 KB · Views: 75
Last edited:

I have already seen that and all the features of 89C52 are included in that...

is it possible to load the code directly into the controller which is writtern in mikroC?
 

See, we generally use loaders like "flash magic" to load hex file in the controller.So, is it possible to use the same loader and load the hex file of the program written in mikroC?

- - - Updated - - -

amm, can you write for both the ICs? Is it possible?
 

See if you are talking about loading hex file into chip which already has a boot loader then it is possible. If you have already loaded a bootloader to your chip then you can use mikroC HOD bootloader software to load the hex file to the chip and you don't need any hardware programmer for it but to load the bootloader you need a hardware programmer. If there is bootloader in the chip then you can connect your board to USB port of PC an use mikroE loader to load the hex file. Yes, I will write code for both the chips tomorrow.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top