31

An illustrative example or two may help here. Take a look at the following hypothetical circuit: simulate this circuit – Schematic created using CircuitLab Suppose to start both A and B are high (1). The output of the AND is therefore 1, and since both inputs to the XOR are 1, the output is 0. Logic elements don't change their state instantly - ...


23

I think I've found your problem, and (I know you won't like this) an accurate schematic would have highlighted the problem to (at least some) readers straight away. :-) Looking at the starting voltage on the two pins in your two traces above, that voltage is around +3.3V. That tells me the PIC is powered from that voltage. Then we see the voltage rise to +...


23

NFC is a type of RFID. Not all RFID devices use NFC. NFC is a bundle of specific technologies and protocols used to communicate with storage devices (often credit cards or passive identifier tags). The NFC specifications cover everything from the radio frequency used (13.56 MHz) and the types of modulation used, to the communications protocol used to read ...


21

I feel a lot of these answers are not exactly hitting on the core question. The micro-controller has a clock simply because it executes (and is driven by) sequential logic. In digital circuit theory, sequential logic is a type of logic circuit whose output depends not only on the present value of its input signals but on the sequence of past inputs, the ...


19

The CAN pins do not have fixed pin assignments. Instead you are able to select which of the "Remappable Pins" you wish to use (RP0 through RP15). If you refer to page 180 of the datasheet, specifically the table titled "REGISTER 11-16" (RPINR26: Peripheral Pin Select Input Register 26), it details the register used to select the CAN RX pin location (C1RXR). ...


16

I would not write every event to EEPROM. Most of the time you will have power, so keep the live count in RAM. The amount of energy it takes to save the live value from RAM to EEPROM is pretty minimal. Use a capacitor to store enough energy to run the micro long enough after power fail is detected to copy the live data into EEPROM, then shut down cleanly. ...


15

Short answer: managers want a simple, testable, PROOF of function before committing to millions (or more) dollars to a design. Current tools, just do not give asynchronous designs those answers. Microcomputers and microcontrollers typically utilize a clocking scheme to insure timing control. All process corners have to maintain timing across all voltage, ...


14

You can do that, but what you'll get on your CAN bus will be UART using CAN voltage levels. You have to supply the MCP2551 with CAN protocol messages if you want to communicate with CAN devices on your bus. Same for listening: CAN messages are so different from the UART format that the UART won't know what to do with them. You'll have at least frame errors ...


14

It is a hoax, you can read more at Snopes and here. But to add a bit of info, the story became popular in 1998, so the scale they would be working in was at best 250 nano-meters, so the picture would have been taken with an electron scope. Here is the original picture: The image is a clever digital manipulation of an image that appears on the cover ...


14

You could try the following using an XOR: movlw 0x01 ; move 0x01 to W register xorwf lat, F ; XOR W with port & store result in port latch An exclusive OR operation will preserve the values in bits where the bits in the working register are set to zero and invert the values where it is set. So you could also use the same technique to toggle multiple ...


12

I work equally well on PIC and AVR (and others, too). I like AVRs largely because of AVR-libc. It's a decent embedded library that is open source and reasonably well documented (UNLIKE Microchip's plib, but plib does have full source, which I genuinely appreciate). AVRs use regular old gcc and gdb which means no idiotic IDEs getting in my way. The same ...


12

Microchips are made using a very wide variety of process steps. There are basically two main components to each step - masking off areas to operate on, and then performing some operation on those areas. The masking step can be done with several different techniques. The most common is called photolithography. In this process, the wafer is coated with a ...


11

C will be the same with some small compiler differences. Assembly will be quite different since it's a different architecture. I advise going with C, and maybe pick up enough assembly to be able to inline some important routines. For the IDE and programmer, Atmel have similar offerings to Microchip, just have a look at their website, download the free IDE ...


11

Both. And there's quite frequently a team of hundreds involved; the latest Intel flagship processor will probably have had over a thousand people involved in design decisions somewhere (especially if you count technical input from the foundry, which is vital if you're using a new manufacturing process). Generally the process involves: high level ...


11

It's really very simple and logical. The PIC 10 has 6 pins, and the PIC 12 has 8 pins. The PIC 16 uses the 14 bit instruction set, except when it uses the 12 bit instruction set, or when the model number is 4 digits starting with 1, then it uses the enhanced 14 bit instruction set. The PIC 18 uses the 16 bit instruction set, and the dsPIC 30 the 24 bit ...


11

This smacks of a grounds-not-tied-together issue. It looks like the USB-to-UART device has only 2 lines going to the Pictail board. I would presume those are just the UART Tx and Rx lines, and not ground. If the grounds of all three boards are not tied together, digital signals between the boards will be interpreted incorrectly and will lead to undefined ...


11

I'm assuming that you're measuring the voltage with respect to ground, not across the horn terminals. If so, what you are describing sounds like this: Except that the switch is likely a relay, MOSFET, SSR, or some other device that has a non-zero resistance even when "closed". In this case, both wires across the horn will be at the battery voltage when ...


11

I'm sorry this answer won't actually solve your problem. But it is too long to fit in a comment, and it will allow you to rethink your problem in the right way (because as it is, I think it is flawed). This kind of problems have to be solved taking account all components of the system, and making reasonable assumptions on what a potential hacker can or can'...


10

You can use any crystal so long as it is within the frequency range that the PIC crystal driver is specified for. The crystal driver of most PICs (I didn't look up your PIC specifically, that's your job) can be set to three different drive levels, usually called LP (low power), XT (crystal), and HS (high speed). The slower ones use less power but also have ...


10

Microcontrollers need to use a clock because they need to be able to respond to events that may occur at any time, including nearly simultaneously with either other external events or events generated by the controllers themselves, and will often have multiple circuits that need to know whether one event X precedes another event Y. It may not matter whether ...


10

x is a local variable. It doesn't necessarily even get a storage address. So, you can't necessarily assign an address to it. Make x global. "automatic" is the storage type of a variable, not the data type, so it being int is orthogonal to it being static or automatic. It's a bit surprising your debugger sees an address for the main-local x at all – it'd ...


9

A possible problem is that some PICs need a power-cycle to get into programming mode. The 12F675 in particular needs this when the configuration word in your application configures the MCLR pin as GPIO. When the pcikit2 powers your target chip it will provide the power cycle. With the independent +5V you supply it can't do this. After covering the most ...


9

If I were a beginner trying to undertand how a microcontroller functions I really wouldn't start with something this complicated. First off, the block diagram is not a circuit diagram. It does not show how one part is wired to another it identifies sub system blocks within the chip and how data flows between them. Consider the internal function blocks of a ...


9

It turns out that there are layers, but people sometimes skip those when talking about how a microchip works. The process that introduces layers is called Back end of line, or BEOL. It basically works like this: Create the 2D chip layer using photolithography Apply an insulating layer Drill holes into that layer Apply a conducting layer, also filling the ...


9

Here is a circuit which will provide a digital input to your microcontroller, and also provides a filtered power supply for your microcontroller. Transients can be nasty on a vehicle's 12V system, with voltages rising as high as 125v for 10 ms during a load dump. This circuit provides protection against negative voltages in addition to the positive spikes ...


9

This is, in my opinion, a confusing usage of the terms max and min. What they're saying is that the minimum voltage you should apply to an input that you want to drive high is 2.4V, but a typical device will read anything down to 1.3V as high--it's just not guaranteed. Likewise, the maximum voltage you should apply when driving a signal low is 0.8V, but ...


9

These chips are used as part of Apple's MFI Certification program. Basically, you have to be a certified developer to sell lightning cables. If you buy a lightning cable from a reseller, you may receive a notification on your iPhone like This accessory is not supported every time you plug in the lightning cable. The pop-up is quite annoying. Your iPhone ...


8

Look at this document which states:- Interrupt-on-change This feature is similar to the external interrupt facility , except that a port change interrupt will be triggered by any change (not just one type of transition) on any of the pins for which it is enabled. This makes it more flexible (being available on more pins), but also more difficult ...


8

I think your problem is based on confusion over exactly what the TMR1 Gate signal actually does. It does not, by itself, cause the timer to count, it merely enables it to count if there are suitable events occurring on its clock input. It's subtle, but if you look at "FIGURE 21-1: TIMER1 BLOCK DIAGRAM" in the datasheet (p. 179), you'll see the TMR1H/TMR1L ...


8

If you want to calculate the day-of-week yourself, here's a C implementation of part of a Perl module I wrote about 20 years ago. I like this algorithm because it doesn't require any looping or a table of month lengths. Note that ints are assumed to be 32 bits. /* Returns the number of days to the start of the specified year, taking leap * years into ...


Only top voted, non community-wiki answers of a minimum length are eligible