ADVERTISE SUBSCRIBE TECHNICAL ARTICLES EVENTS ETNdigi ABOUT USCONTACT
Oct 29/9 30/9 # Rohde supersquare
6/2-15/5 # Period: start idag om möjligt 6/2—15/5 egen prenannons, över- och  underdeldel

ETNtv

Watch ECF videos

 
ECF22 videos
  • Antti Tolvanen, Etteplan
  • Timo Poikonen, congatec
  • Kimmo Järvinen, Ziphera
  • Sigurd Hellesvik, Nordic Semiconductor
  • Hans Andersson, Acal BFi
  • Andrea J. Beuter, Real-Time Systems
  • Ronald Singh, Digi International
  • Pertti Jalasvirta, CyberWatch Finland
ECF19 videos
  • Julius Kaluzevicius, Rutronik.com
  • Carsten Kindler, Altium
  • Tino Pyssysalo, Qt Company
  • Timo Poikonen, congatec
  • Wolfgang Meier, Data-Modul
  • Ronald Singh, Digi International
  • Bobby Vale, Advantech
  • Antti Tolvanen, Etteplan
  • Zach Shelby, Arm VP of Developers
ECF18 videos
  • Jaakko Ala-Paavola, Etteplan CTO
  • Heikki Ailisto, VTT
  • Lauri Koskinen, Minima Processor CTO
  • Tim Jensen, Avnet Integrated
  • Antti Löytynoja, Mathworks
  • Ilmari Veijola, Siemens

logotypen

 2022  # square  (4)
TMSNet  advertisement
ETNdigi
Mar Apr May Jun # Farnell sajt skyskrapa
Mar 1-9/4 # Ansys sajt
A la carte
AUTOMATION DEVICES EMBEDDED NETWORKS TEST&MEASUREMENT SOFTWARE POWER BUSINESS NEW PRODUCTS
ADVERTISE SUBSCRIBE TECHNICAL ARTICLES EVENTS ETNdigi ABOUT US CONTACT
Tweet

TECHNICAL ARTICLES

MORE OPTIONS WITH 8 AND 16-BIT MICROCONTROLLERS

Tietoja
Kirjoittanut Veijo Ojanperä
Julkaistu: 08.11.2022
  • Devices
  • Embedded

8 and 16-bit MCUs are an invaluable tool for performing small, specialized tasks. The tasks aren’t necessarily complex, but they can be time consuming or time critical. By offloading the tasks, the 32-bit devices can have simpler implementations that improve reliability, reduce memory usage, and lower power consumption.

In today’s world, large 32-bit microcontrollers and microprocessors running a real time operation system (RTOS) are increasingly common. However, a single large microcontroller handling a complex application may run into issues with CPU resources with regards to small housekeeping tasks, which are not complex, but are time consuming.

Smaller devices, like 8 and 16-bit MCUs, can be used to offload these tasks from the 32-bit device. Consider the following example: a 32-bit MCU is used to control the non-safety features of a car, like the entertainment system, ambient lighting, and the A/C. The 32-bit device must allocate its resources to process all of the tasks associated with these features. A few examples include measuring the temperature of the cabin in multiple points, turning on/off the A/C systems, updating the graphical display, processing user inputs, adjusting lighting conditions, and playing music. Even for a large 32-bit device, this is a lot of work.

However, these tasks are more manageable if the 32-bit device offloads some of these tasks to sub processors that handle only 1 or 2 of these tasks but require little supervision in doing so. This frees up CPU resources on the main processor, which reduces software complexity while improving performance and execution time.

This solution is analogous to the benefits of peripherals in microcontrollers. Peripherals are small blocks of specialized hardware that can add new features (such as an operational amplifier or an analog-to-digital converter) or can reduce the amount of work the CPU must perform for a given function. In some cases, peripherals can run independently of the CPU after being initialized.

As an example, to show the benefit of peripherals, consider the generation of a Pulse-Width Modulated (PWM) signal. To generate PWM without a dedicated peripheral, simply set an I/O line HIGH, wait a certain number of cycles, set it LOW, wait some more, and repeat. This eats up a lot of CPU cycles and is difficult for something like an RTOS to execute reliably. A PWM peripheral, by contrast, lets the CPU set the desired waveform parameters while performing other tasks.

The first example provided shows the benefit of offloading a CPU intensive task. In this case, an 8-bit MCU is used to create an I/O expander. I/O expanders are not complex devices; however, they use a lot of CPU time due to the frequent servicing of interrupts. By using a dedicated MCU for just this task, the larger 32-bit device can reduce it is I/O utilization and the number of interrupts it needs to handle. Additionally, the I/O expander’s feature set is set in software, which allows it to be customized and tuned for the application. 

The second example in this article shows the performance of core-independent peripherals to create a Voltage-to-Frequency (V/F) converter that operates independently of the CPU. The only functionality the CPU has in this example is to initialize the peripherals and to print debug messages to UART. In a larger system, the CPU could perform another simple task while the V/F ran in the background.

Figure 2 - Lookup Table of the Advanced I/O Expander.

I/O EXPANDER

The biggest benefit of creating an I/O expander using an 8-bit MCU is the flexibility. The feature set of an I/O expander ASIC is baked into the device, whereas the MCU defines its behavior based on the software it executes. This flexibility allows the MCU-based version to be adapted to fit the needs of the end application.

IMPLEMENTING THE ADVANCED I/O EXPANDER

Internally, the advanced I/O expander operates on a lookup-table based structure. Before reading or writing, a virtual address is sent. This address does not correlate with registers on the microcontroller – it is only specific to the lookup table. This means that features not in the hardware registers of the microcontroller can be added transparently. Entries in the table can be easily rearranged for specific uses as well. Another benefit of this structure is the ability to add permissions to the lookup table. For instance, to create a read-only register, simply omit the write lookup table entry.

This more complex structure also lends itself to non-standard functionalities. The function “MEM OP” allows the MCU to save or load its current General-Purpose Input and Output (GPIO) configuration to memory.

MEM OP can also reset the GPIO configuration to the parameters set when compiling.

Optionally, the microcontroller can be set to load the saved settings on power-up. If enabled, the microcontroller attempts to load the settings in configuration 0. If the configuration fails checksum validation, then the MCU will revert to the compile time constants. This feature can be disabled in the software, if not desired.

 

Figure 3 - Functionality of MEM OP.

TAKEAWAYS FROM THIS SOLUTION

The advantage of the MCU based solution is in the extreme amount of flexibility. Unlike the ASICs on the market, the MCU can be configured with non-standard functionalities specific to the application in use. This application was developed for the general-purpose PIC16F15244 family of MCUs.

For more information about the implementation or to try out the example, please see the README files in the source repositories. Demonstrations of the advanced I/O expander with an Arduino are also available.

Source Code, Documentation, and Demonstrations: https://github.com/microchip-pic-avr-examples/pic16f15244-family-advanced-i2c-io-expander

Figure 4 - Application Schematic for the TC9400/TC9401/TC9402 10 Hz to 100 kHz V/F Converter.

VOLTAGE-TO-FREQUENCY
(V/F) CONVERTER

The voltage-to-frequency converter improves upon the traditional analog solution by reducing the Bill of Materials (BOM) and thus the design area. Many of the V/F converters on the market require external resistors and capacitors to operate, whereas the microcontroller only requires generic decoupling and pull-up components (required by all MCUs) to function.

Rather than using analog techniques to digitize, the MCU uses a combination of core-independent peripherals and features. The MCU measures the input signal with the internal Analog-to-Digital Converter with Computation (ADCC) then divides a clock signal to create a variable frequency output. In this example, the peripherals have been setup to operate autonomously of the CPU after initialization. This means the CPU could be used for other tasks in the end-application.

One challenge with the MCU based approach is that it does not perform as well as the analog solution does. The resolution of the output is intrinsically limited by the ADCC. Nominally, the ADCC is 12-bits, but with the way the program is configured, the ADCC runs at an oversampled 14-bit resolution. Likewise, the on-board Numerically Controlled Oscillator (NCO) that synthesizes the output frequency has finite resolution and can have jitter in its output, depending on the value measured by the ADC.

The MCU based solution can be split into three distinct blocks of peripherals – an analog sampling block, an output oscillator block, and a duty cycle generator.

ANALOG SAMPLING BLOCK

The analog sampling block is responsible for the analog-to-digital conversion. For an output of 100 kHz to be possible with the frequency limits of the device, the ADCC has been configured to oversample, then average down to get a 14-bit result.

A downside to this oversampling is the extra statistical noise added to the result. The noise is compensated for by averaging the oversample and adding hysteresis. To implement hysteresis, the threshold interrupt feature of the ADCC is used. (For simplicity, only the specifics of how this example uses the threshold interrupt feature will be covered.)

When the ADCC finishes computing the averaged oversample, the resulting value is compared to a setpoint register in the peripheral. If the difference between the two is greater than or less than set thresholds, then an interrupt is triggered. The CPU masks this interrupt and is unaffected, however this interrupt triggers a Direct Memory Access (DMA) copy of the averaged oversample result to the setpoint register of the ADCC, creating hysteresis. If the thresholds are not exceeded, then the DMA copy will not occur, which will not trigger the output oscillator block’s DMA to update.

Figure 5 - Analog Sampling Block Implementation.

OUTPUT OSCILLATOR BLOCK

The output oscillator block (pictured left) of this solution is responsible for generating a clock signal at the desired output frequency. This output signal is internally connected to the duty cycle generator, which halves the frequency of the output but creates a 50% duty cycle output. Due to this, the output oscillator block runs at twice the frequency of the output.

The heart of the output oscillator block is a Numerically Controlled Oscillator (NCO). The NCO peripheral works by adding an increment value to an accumulator on the rising edge of an input clock. The accumulator overflow is used to derive the output of the peripheral. (For the full explanation on the NCO, please consult the datasheet.)

In this example, NCO2 has been setup to internally create the required input clock frequency to get a 100 kHz output from a 14-bit input. The 14-bit result is used because the native 12-bit result from the ADCC is not large enough to generate the 100 kHz output without an external clock source.

DUTY CYCLE GENERATOR

The Duty Cycle Generator block of this solution (pictured right) is responsible for the creation of a 50% duty cycle output. This feature is optional – the output from the NCO can be used directly, although the duty cycle will vary to a much larger degree.

This generator is implemented using one of the Configurable Logic Cells (CLC). The CLCs are small blocks of discrete configurable logic, similar to a single cell of an Field Programmable Gate Array (FPGA). CLCs can be used as discrete logic gates, such as AND-OR or OR-XOR. They can also be configured as latches or flip-flops. In this solution, a CLC was implemented as a J-K flip-flop with Reset. J and K are kept at logic HIGH.

The output oscillator block is used as the clock for the flip-flop. Every input clock pulse causes the output to toggle, which generates a 50% duty cycle. Note: frequency jitter from the output oscillator block will affect the duty cycle.

Timer 6 is used as an astable “watchdog” timer. If the output does not produce an edge (rising or falling), then the timer will overflow and generate a clock pulse to the CLC. This controls the low side of the output frequency range. Rather than reaching DC, the output toggles at the half of the frequency of the timer, for an output of 6 Hz. 

TAKEAWAYS FROM THIS SOLUTION

This example demonstrates the use of hardware peripherals to create a core-independent function that ordinarily would have to be created with an external integrated circuit. One of the biggest benefits to this configuration is that the peripheral operation is setup in software, making it easy to adjust the example to the end-application. For implementing the example, the PIC18-Q43 family of MCUs was selected due to the large number of peripherals in use. 

For more information about this example, please see the README document in the example repository. The example repository also contains an implementation of a frequency-to-voltage converter that can be implemented on the same device as the voltage-to-frequency converter.

Table 1: Ideal Outputs of the 100kHz V/F Converter, with Watchdog Turned Off.

Table 2: Ideal Outputs of the 10kHz V/F Converter, with Watchdog Turned Off.

 

By Robert Perkel, Microchip Technology

 

Originally published in ETNdigi issue 2-2022

back to top
MORE NEWS

Huawei laittaa hurjia summia tutkimukseen

Huawei on ollut melkoisissa vaikeuksissa länsimaissa sekä älypuhelimiensa että verkkolaitteidensa kanssa, mutta yhtiö ei ole luovuttanut millään tavalla. Yhtiö kertoo vuosikertomuksessaan, että sen viime vuoden liikevaihto oli noin 85,9 miljardia euroa ja nettovoitto noin 4,7 miljardia euroa.

Nyt tekoäly tulee piirien suunnitteluun

Mikään ei tällä hetkellä puhuta ihmisiä tekniikan alalla niin paljon kuin tekoäly. Ei siis ole ihme, että tekniikkaa sovelletaan yhä useammilla alueilla. Nyt EDA-talo Synopsys on esitellyt piiriensuunnittelun työkalut, joissa tekoälyä hyödynnetään oikeasti ensimmäistä kertaa.

Tesla Model Y oli helmikuun myydyin auto Euroopassa

Uusien autojen kauppa elpyi helmikuussa. Euroopassa myytiin runsaat 900 000 uutta henkilöautoa, mikä on 12 prosenttia enemmän kuin vuotta aikaisemmin. Sähköautojen kova kysyntä on kasvun tärkein moottori tällä hetkellä. Teslan Model Y nousi samalla myydyimmäksi automalliksi, raportoi JATO Dynamics.

Älykäs ja nopea ohjaus ottaa kaiken irti pikalatauksesta

Gallium-nitridi on materiaali, joka on mullistanut latauksen. Nopeus perustuu piitä selvästi nopeampaan kytkentään, mutta samalla tämä on asettanut haasteita elektroniikan ohjaukselle. Vanhat ohjaimet eivät ole pysyneet mukana. ROHM korjaa ongelman uudella pulssiohjaustekniikallaan.

Taipuisat puhelimet jäävät pienen joukon luksukseksi

Jokaisen uusimman polven taivuteltavia älypuhelimia kokeillut tietää, miten hienoista laitteista on kyse. Niiden hinta on kuitenkin ollut suurien myyntimäärien tiellä. Tutkimuslaitos IDC:n taivuteltavien myynti kasvaa tänä vuonna 50 prosenttia, mutta osuus kokonaismarkkinoista on edelleen marginaalinen.

Nokia leikkaa tukiaseman virrankulutusta koodilla

Nokia AVA (Analytics and Virtual Assistant) on Nokian kehittämä tekoälyalusta. Se on suunniteltu auttamaan palveluntarjoajia hallitsemaan ja optimoimaan verkkoaan sekä tarjoamaan parempaa asiakaspalvelua ja tukea. Nyt uusittu AVA leikkaa tukiasemien virrankulutusta.

Linuxeja on yli 600, tässä suosituimmat

Linux-jakelujen tarkkaa määrää on vaikea antaa, sillä uusia luodaan ja olemassa olevia muokataan koko ajan. On kuitenkin arvioitu, että tällä hetkellä saatavilla on yli 600 erilaista Linux-jakelua. Näitä ovat suositut jakelut, kuten Ubuntu, Debian, Fedora, CentOS ja Arch Linux, sekä vähemmän tunnetut jakelut, jotka on räätälöity tiettyihin tarkoituksiin, kuten tietoturvaan, koulutukseen, multimediatuotantoon ja pelaamiseen.

Moni haittaohjelma perustuu vanhaan koodiin

Kyberturvallisuusyhtiö Fortinetin FortiGuard Labs julkaisi äskettäin Global Threat Landscape -puolivuotisraporttinsa, jossa kartoitettiin vuoden 2022 jälkipuoliskolla yleisimmin esiintyneitä uhkia ja verkkorikollisten menettelytapoja. Raportti paljastaa verkkorikollisten kierrätysinnon lisääntyneen – vanhaa koodia vahvistetaan ja täydennetään aiempaa useammin

Laaja tutkimus selvitti: Näin paljon vihreä siirtymä maksaa Euroopassa

Vihreä siirtymä on jo pitkään ollut niin yritysten kuin poliitikkojen lempiaihe. Se lupaa meille kasvua, työpaikkoja ja tietenkin päästötöntä energiaa. Mutta kuinka kalliiksi vihreä siirtymä tulee eurooppalaisille? Tämäkin käy ilmi Panasonic Toughbookin teettämästä ja White Space Strategy -tutkimuslaitoksen toteuttamasta selvityksestä

Testaa avoimen kännykkäverkon radioyksiköitä

Open RAN on avoin standardi, jossa mobiiliverkon voi toteuttaa yhdistämällä verkon komponentteja eri valmistajilta. Optimistisimmissa ennusteissa ORAN-osuus kokonaismarkkinoista voisi nousta jopa puoleen tämän vuosikymmenen aikana.

RISC-V tuo nyt puheohjauksen moniin laitteisiin

Renesas on laajentanut RISC-V-valikoimaansa ensimmäisellä ohjainpiirillä, joka on suunniteltu puheohjattuihin HMI-järjestelmiin. Uusi 32-bittinen R9A06G150-piiri on sovelluskohtainen vakiopiiri, joka tuo kustannustehokkaan, tuotantovalmiin puheohjausjärjestelmän moniin sulautettuihin laitteisiin.

Business Finlandin veturimiljoonilla luodaan satoja työpaikkoja

Business Finland on tehnyt positiiviset rahoituspäätökset yhdelle uudelle veturiyritykselle, Konecranesille, sekä viidelle haastajaluokan veturiyritykselle, jotka ovat Bittium, Danfoss, Orion sekä Ponsse ja Epec yhdessä. Kyse on yhdestä Business Finlandin merkittävimmistä rahoituspäätöksistä tänä vuonna.

Nousiko Apple pysyvästi kännykkämarkkinoiden ykköseksi?

Atlas VPN:n keräämän datan perusteella Apple ohitti Samsungin suosituimpana älypuhelimena vuoden 2023 ensimmäisinä kuukausina. Kyseessä on merkittävä muutos globaaleilla älypuhelinmarkkinoilla, sillä Samsung on pitänyt ykkössijaa hallussaan useiden vuosien ajan.

Intel vihjasi 256 ytimen Xeonista - ottaa AMD:n kiinni

Intel on esitellyt palvelinkoneiden prosessoriensa päivitettyjä suunnitelmia. Uutisten perusteella näyttää siltä, että yhtiö on vihdoin ottamassa kiinni AMD:n usean vuoden jatkunutta etulyöntiasemaa.

Venäjä suunnannut nyt kyberhyökkäyksensä Eurooppaan

Ukrainan konfliktiin liittyvissä kyberhyökkäyksissä tapahtui merkittävä käänne vuoden 2022 kolmannella neljänneksellä. Venäjän ja Ukrainan kybersodankäynnistä siirryttiin selvästi Euroopan laajuiseen korkean intensiteetin hybridi-kybersotaan. Kyberhyökkäykset kohdistuvat erityisesti Puolaan, Baltian maihin ja Pohjoismaihin, selviää Thalesin Cyber Threat Intelligence -yksikön tuoreesta raportista.

Roaming-datan määrä kasvaa jo 3000 petatavuun tänä vuonna

Verkkovierailun markkinoitu tutkiva Kaleido Intelligence ennustaa, että kuluttaja- ja IoT-mobiiliyhteyksien tuottaman verkkovierailudataliikenteen kokonaismäärä nousee 3000 petatavuun vuonna 2023. Tämä tarkoittaa kolminkertaista kasvua pandemiaa edeltävään tasoon verrattuna.

Microsoft tuo nyt OpenAI-mallit tietoturvaan

Microsoft kertoi eilen tuovansa uuden sukupolven tekoälyn osaksi tietoturvaa julkaisemalla Microsoft Security Copilot -ratkaisun. Sen avulla voi tunnistaa uhkia ja vastata niihin nopeasti sekä ymmärtää yleistä uhkaympäristöä entistä paremmin. Security Copilot hyödyntää samoja OpenAI-malleja, joihin netin vallannut ChatGPT-botti perustuu.

Kännykkämarkkina ei ehkä koskaan palaa huippuvuosiensa tasolle

Vuonna 2015 maailmassa myytiin 1,98 miljardia puhelinta. Sen jälkeen on tultu alaspäin kahdeksan vuoden ajan. CCS Insightsin mukaan tänä vuonna määrä putoaa 1,35 miljardiin laitteeseen. Vuoden 2015 määriin markkinoilla ei ehkä koskaan enää päästä.

Intel luopuu lopullisesti modeemeista

Intel on yrittänyt tunkeutua modeemien markkinoille niin 3G-, 4G- kuin 5G-aikakaudella. Nyt tarina saa vihdoin päätöksen, kun prosessorijätti myy 5G-modeemien liiketoimintansa Mediatekille. Jäljelle vain pieni 4G-modeemibisnes Fibocomin kanssa, joka on päättymässä vuonna 2025.

Ericsson kiihdytti 5G:n lähes 6 gigabittiin Färsaarilla

Fär-saarten teleoperaattori Faroese Telecom ja Ericsson ovat yltäneet jopa 6 gigabitin sekuntinopeuksiin 5G-datansiirrossa millimetriaalloissa. Lukema on tähän mennessä nopein mitattu nopeus suorassa liveverkossa Euroopassa.

 2022  # mobilbox
TMSNet  advertisement
6/2—15/5 # egenannons mobilbox ecf
Mar Apr May Jun # Rohde mobilbox
Mar Apr May Jun  # Farnell  mobilbox f skyskrapa
Mar 1-9/4 # Ansys sajt

© Elektroniikkalehti

 
 

TECHNICAL ARTICLES

Mystiikka pois valotutkasta!

Edistyneet kuljettajaa avustavat järjestelmät (ADAS) ja autonominen ajo voivat onnistua, kun ajoneuvoa ympäröivä ympäristö tunnistetaan tehokkaasti autonomisen navigoinnin mahdollistaviin algoritmeihin. Tässä käytetään useita anturimenetelmiä, joiden tiedot yhdistetään yhteen täydentämään toisiaan ja tarjoamaan redundanssia. Näin jokainen tekniikka voi hyödyntää omia vahvuuksiaan ja tarjota paremman yhdistetyn ratkaisun.

Lue lisää...

OPINION

Poliitikot eivät kykene ratkaisemaan autoalan verotusta

Autoalan tiedotuskeskus järjesti tänään Nollasta sataan -paneelikeskustelun, jossa poliitikot keskustelivat sekä liikenteen päästöistä että sen verottamisesta. Paneeli osoitti ennen kaikkea, että poliitikoilla tulee olemaan suuria vaikeuksia laatia kestäviä, tasapuolisia ja järkeviä ratkaisuja ongelmiin.

Lue lisää...

LATEST NEWS

  • Huawei laittaa hurjia summia tutkimukseen
  • Nyt tekoäly tulee piirien suunnitteluun
  • Tesla Model Y oli helmikuun myydyin auto Euroopassa
  • Älykäs ja nopea ohjaus ottaa kaiken irti pikalatauksesta
  • Taipuisat puhelimet jäävät pienen joukon luksukseksi

NEW PRODUCTS

  • Mittaa sähköauton akuston varaustaso promillien tarkkuudella
  • Lähes gigatavu sekunnissa muistikorteille
  • 65 watin laturiproto nopeasti
  • Intelin ARC-näytönohjaimen saa nyt Rutronikilta
  • Sovellus lataa sähköauton automaattisesti halvimmalla sähkönhinnalla
 

NEWSFLASH

twitter
ETN_fi @ETN_fi
ETN_fi RT @joeprkns: Last night I used GPT-4 to write code for 5 micro services for a new product. A (very good) dev quoted £5k and 2 weeks. G…
maalis 17 • reply • retweet • favorite
ETN_fi This is why Nokia lost the game in mobile phones - an insiders view https://t.co/NB5Wndkx5p
joulu 12 • reply • retweet • favorite
ETN_fi @OnePlus_FI lahjoittaa Pelastusarmeijalle 50 puhelinta jouluapuun. Iso- Britanniassa samanlainen lahjoitus tehdään… https://t.co/LKdl2Pywie
joulu 07 • reply • retweet • favorite
ETN_fi Finnish PM Sanna Marin: We need to cut our dependence on China. https://t.co/598gQXKvlj #Slush2022 #China #electronics #semiconductors
marras 17 • reply • retweet • favorite
ETN_fi https://t.co/ugg6A09vln Need cm level accuracy in your positioning device? Now you can explore this with #ublox two… https://t.co/5rQNxsAu5V
loka 07 • reply • retweet • favorite
web design services
 

Section Tapet