8-bit Knowledge Base

    Publish
     
      • Precision voltage reference as a current source

        cgiga | 06/158/2016 | 08:30 PM

        Question

        Can I use the precision voltage reference output to supply current to external devices?

        Answer

        When using the internal precision voltage reference, it is not recommended to use the output as a source for external components.  Measurements errors can occur since errors induced on the reference voltage are directly passed to the analog measurements.  

         

        If the system is required to use the reference connected to external components, then the load regulation of the reference must be maintained.  The current sourced by the reference cannot exceed the current specified in the data sheet to maintain the accuracy of the reference.  For example, the EFM8LB1 8-bit MCU specifies load regulation at 200 µA.  This current value should not be exceeded to maintain proper operation.  An external buffer amplifier can also be used to minimize the interference of the reference.

      • RTC Short Strobe Timing

        cgiga | 06/158/2016 | 08:26 PM

        Question

        I am following the data sheet examples for a write to the SmaRTClock registers, but the write is not successful. Why would this happen?

        Answer

        The original example in the data sheet used the instruction sequence:

         

        mov RTC0ADR, #095
        mov RTC0DAT, #000h
        nop

         

        This was an error in earlier versions of the data sheet. This instruction sequence shown above is setting the BUSY bit which is used for a read of the registers and should not be set when trying to write to the registers. Instead of using:

         

        mov RTC0ADR, #095

         

        use

         

        mov RTC0ADR, #015

         

        Issuing the command this way does not set the BUSY bit, and the write should proceed as expected.

         

        This issue is resolved in the latest revisions of the data sheet.

      • VBUS Detect

        Alan_S | 06/158/2016 | 08:17 PM

        Question

        How do I detect if a USB host is connected to my device?

        Answer

        In a self-powered system, it is generally desirable to be able to detect the presence of VBUS. VBUS indicates when a host device has been connected to or disconnected from the USB peripheral.

         

        For EFM8 devices, the VBUS signal may be enabled on a port pin and configured to generate
        system interrupts if the state changes. The VBUS control bits are found in the USB0CF register. VBUSEN enables the VBUS pin as an input to the USB module, while the VBUSIE bit enables the associated interrupt. VBUSI will be set any time the state of VBUS changes, and firmware may then read the state of the VBUS pin and act accordingly.

         

        For C8051 devices such as the C8051F320 and C8051F340, the VBSTAT bit in register REG0CN indicates the current logic level of the VBUS signal. It is possible to enable a VBUS interrupt that triggers when VBUS is connected.

      • SmaRTClock (RTC) oscillator options for C8051F975

        MitchC | 06/158/2016 | 08:13 PM

        Question

        The C8051F975 does not appear to have a pinout assignment for XTAL3 and XTAL4 as in the higher pin-count C8051F973/4.  Does the C8051F975 have the same RTC functionality as the C8051F973/4?  What can I use as an oscillator source for the RTC?

        Answer

        On the smaller packages available in the C8051F97x family (QFN24), the XTAL3 and XTAL4 pins are not bonded out, so it is not possible to use the RTC with an external crystal as the oscillator source. There may still be a couple of other options, however:

        1) Recommended: You can use the integrated low frequency oscillator (LFO) as the timebase to the RTC, as described in section 25.2.3 on page 258 of the revision 1.0 data sheet. The LFO will provide a low power, relatively accurate timebase for the RTC and requires neither external components nor internal shorting of the XTAL3 and XTAL4 pins. You can again verify the RTC frequency by routing the signal to a pin. (Note: The RTC timebase can be selected as the system clock and routed to a port pin. See Section “24. Clocking Sources” on page 242 for information on selecting the system clock source and Section “26. Port I/O (Port 0, Port 1, Port 2, Port 3, Port 4, Port 5, Port 6, Crossbar, and Port Match)” on page 278 for information on how to route the system clock to a port pin.) 

        2) It may still be possible to use the RTC oscillator circuit in self-oscillate mode as described in section 25.2.2 on page 258 of the C8051F97x data sheet (revision 1.0). Note that the frequency generated by this mode is a clock, but is not accurate.