hi guys.. i'm new to micro p and C++ and i'm given a proj to use real time clock on C++ form but using micro p codes.. can some 1 help me?
thanks in advance...
The datasheet for the device usually has assembly opcodes, memory layout, etc listed, or a reference to a different app note that does have programming information.
The C++ compiler needs to be specific to your uC, such as AVR, PIC, Intel, etc. Even then, not all uC's made by those companies are supported by a compiler, especially PICs.
Finally, most code is written in C, as there isn't usually much memory to work wih, and the functions are pretty straight forward, not needing classes/methods/inheritance and all the other goodies that C++ provides. At the same time, C++ compilers are available, as well as Pascal. C, Basic, and Assembly are the major languages used.
thanks for your reply. i just need to show the time and date on the C++ amd using the silicon lab to write the code for my RTC. how should i write the code? because i really have no idea on how to start.. thanks alot.
Get a silab chip (example C8051F226) with a SPI (Serial Peripheral Interface) and get a RTC chip with SPI too (example Maxim DS1305). Use SPI programming to program and get time from the RTC chip.
If you are already provided with a dev board, there is no way of knowing what is connected to any of the ports.
Are you required to work in C++? That actually makes the project harder, rather than easier (the original intent of C++). Standard C is the high level language of choice for microcontrollers, although compilers exist for other languages, C is by far the most commonly seen.
Let me get it right - you are trying to interface the C8051F310 with a RTC chip?
I suggest you get to familiarise yourself with the following:
(1) The SPI protocol
(2) How to do data transfer of the SPI on your F310.
(3) Understand how to program your RTC chip (say DS1305). Inside the RTC chip is basically a series of registers. Use the SPI to write/read into the registers for time setting/reading.
yes i'm required to show the RTC results in the C++ form. i'm really struggling in this.. hahaha. hmm.. the RTC is in the micro p bored, C8051F320. thanks for helping me so much this far.. i'm getting to understand this more and more thanks alot.
I am doing the project to make a microcontroller communicate with PC.
I am facing the problem writing the C++ code for command button to ask uC to display the data in my label.
How to write the code for C++ to get the data from the microcontroller?
i'm using a C8051F320-dk which already have a USB connector and a RTC.
my data will be the date, and time provided from the RTC. please help.