MediaWiki API result

This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.

Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.

See the complete documentation, or the API help for more information.

{
    "batchcomplete": "",
    "continue": {
        "gapcontinue": "Relay_CPU",
        "continue": "gapcontinue||"
    },
    "warnings": {
        "main": {
            "*": "Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
        },
        "revisions": {
            "*": "Because \"rvslots\" was not specified, a legacy format has been used for the output. This format is deprecated, and in the future the new format will always be used."
        }
    },
    "query": {
        "pages": {
            "3035": {
                "pageid": 3035,
                "ns": 0,
                "title": "Read before write",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "==== Read before Write ====\n\nThe issue with 'read before write' is that, unlike a PIC18, it is impossible for a program running on the PIC16 to read the state of its output port latch.\n\nThe classic issue occurs when individual port bits are set, or toggled, causing outputs on the pins to behave unexpectedly.\n\nThis happens because the PIC16 reads the state of the port pins to calculate the value to write to the port. When the PIC16 writes to the port, it writes the value for all the pins at the same time.\n\nFor example with trisb set to zero, if you set portb.1=1, then later set portb.2=1. If portb.1 is excessively loaded, the PIC16 will read portb.1 as a zero and write 4 (0b100) to portb, instead of the expected 6 (0b110) to portb.\n\nThere are three solutions to the above issue:\n\nOne solution is to use a processor that does allow us to read the state of its output pins -- such as the LATx register on the PIC18 processors.\n\nThe second, and by far the best is to ensure the output pins are not excessively loaded.\nThis is the best solution, as code not necessarily under your control, such as UART and I2C code will not affect the remainder of your application.\nUnfortunately, this doesn't work when implementing an open-collector bus.\n\nThe third solution is to use some kind of 'shadow' register, in which the individual bits can be manipulated, then the resulting CHAR values can then be written to the port.\nYou use this shadow register to emulate the LATx registers on other processors.\n\nThe various _port macros below, if called in place of the _bit macros, should do the job:\n<pre>\nunsigned char sport[2]; // amend to # PIC ports\n\n#define set_port(port, no)\\\n\tset_bit(sport[&port-PORTA], no);\\\n\tport=sport[&port-PORTA];\n\n#define clear_port(port, no)\\\n\tclear_bit(sport[&port-PORTA], no);\\\n\tport=sport[&port-PORTA];\n\n#define test_port(port, no)\\\n\ttest_bit(sport[&port-PORTA], no)\n\n#define toggle_port(port, no)\\\n\ttoggle_bit(sport[&port-PORTA], no);\\\n\tport=sport[&port-PORTA];\n</pre>\n\n== Further reading ==\n\n* [http://massmind.org/techref/readmodwrite.htm The Read-Modify-Write problem]\n* [http://circuitguru.com/79/pic-microcontroller-read-modify-write-bugs/ Circuit guru: \"PIC microcontroller read-modify-write bugs\"]\n* [http://www.cornerstonerobotics.org/curriculum/lessons_year2/erii_rmw_problem.pdf Cornerstone Robotics: \"Read-Modify-Write (RMW) Problem with Mid-Range PIC Microcontrollers ... and Avoiding the Read-Modify-Write (RMW) Problem with LATx Registers in PIC18Fxxxx\"]\n* [http://electronics.stackexchange.com/questions/7684/what-causes-turning-on-an-single-output-pin-on-a-microchip-pic16f690-to-spontane Stackexchange: \"What causes turning ON an single output pin on a Microchip PIC16F690 to spontaneously turn OFF another pin on the same port?\"]\n\n\n[[Category:BoostC]][[Category:PIC]]"
                    }
                ]
            },
            "7098": {
                "pageid": 7098,
                "ns": 0,
                "title": "Real Time Clock -- Keeping Time with a Microcontroller",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "Often a micro controller project needs to know what time ( perhaps including date ) it is, say for a data logging project, or even more directly a clock.  This article deals with methods of keeping time.\n\n=== Real Time Clock Modules ===\n\nThis is a module includes a highly precise oscillator ( often based on a clock crystal ), suitable counters to count the oscillations, and an interface for the micro controller.  There is a good overview at Wikipedia http://en.wikipedia.org/wiki/Real-time_clock  and an easily available one can be found at Sparkfun https://www.sparkfun.com/products/99  Often these devices are very low power making them practical for battery powered projects, or for mains powered projects with battery powered backup.  Real time clocks information is easy to find on the web, this article will largely focus on other methods.\n\n=== Just Use the Micro controller Clock ===\n\nMicro controllers all have clocks for timing their own processing.  You can use software and the counter timers ( on most chips ) to determine the time.  You will also have to write software to manage the clock.  Accuracy of the oscillator  is important here, and generally crystals are the most accurate.   A  .01 percent accurate crystal will be off by about 10 seconds a day.  This may be accurate enough or not.  With more complex software you can add correction routines to the clock and increase the accuracy of the clock pretty much as much as you want, until you are limited by the stability of  oscillator, one again a .01 percent stability is about 10 seconds a day.  Probably the most important factor for stability is temperature.  So if you temperature is more or less constant stability may be good.  Aging of the crystal can also effect the stability.  You can improve this accuracy by feeding the temperature to an error correction routine, or you can use a temperature controlled \u201coven\u201d to improve the stability.  ( Some of these techniques can also be used with real time clock modules or may be built into them ).  \n\n=== Use the Power Line ===\n\n\n\nThe power line ( mains power ) runs at 60 Hz and over the long term is very stable.  If you are using a plug in power supply then this is an easy option.  \n\nOverview:  This assumes that you are using a transformer based power supply.  This will have a low voltage AC output.  Some of this you will rectify, filter, and probably regulate.  Use a second tap on the transform and a diode for half wave rectification.  You do not filter this, instead put a resistor in series with it and a diode to the regulated  micro controller power.  This will give you a 60 Hz wave clipped at 0 volts and the micro controller voltage.  This signal is safe to feed into a micro controller input pin.\n\nThere are several ways to process this signal, here is one:\n\nSet the input pin to input and feed it to a counter.  When the counter gets to a count of 60 ( some counters count up, some down, do what is appropriate for you processor ).  it should trigger an interrupt and and count the second.\n\nFull code, schematics, etc. for the PIC microcontroller can be found in the project at: [[PIC based Stepper Motor Dancing Analog Clock]]\n\n\n[[category:Microcontroller]]\n[[category: clock]]"
                    }
                ]
            }
        }
    }
}