Great Cow BASIC (GCB) is a BASIC compiler for Microchip and Atmel microcontrollers. It lets you to program in BASIC instead of having to learn assembly or C language and is completely open source! The GCB team has announced the release of Great Cow BASIC v.0.95.007, which has built-in support for Microchip’s latest Xpress Evaluation board and including a host of demonstrations for this board.
The Great Cow Basic development team have published another release that further enhances the Great Cow Basic compiler capabilities. The Great Cow BASIC development team have published another release that further enhances the Great Cow BASIC compiler capabilities.
- Support for the Xpress Evaluation board including a host of demonstrations for the Xpress Evaluation board.
- New GCB utility to load hex file into Microchip Xpress board.
- Improved performance to increase productivity and to reduce compilation time.
- Improved string handling. Strings can be defined with escape characters like quotes and semi-colons.
- New volatile bit can be defined that improves setting for specific bits.
- Enhanced bit Not operator – now works with bit variables!
- Further improvements to #option explicit.
- Ethernet support for ENC28J60 adapter with a full TCPIP stack. This is a separate download.
- Performance improvements to further improve productivity.
- New optimisation options for A-D.h and PWM.h to reduce the size of generated asm and hex file.
- Improved support for 900+ Microchip and Atmel 8-bit microcontrollers .
Microchip 10F, 12C, 12F, 16C, 16F, 18C and 18F devices. The LF devices are now automatically supported (no need for LF specific chip files).
AVR microcontrollers Classic AVR, Tiny AVR and Mega AVR devices.
Support for 16f85xx class of microcontroller plus changes to the supporting hardware files.
New commands to support PPS. LOCKPPS and UNLOCKPPS.
- Improved software I2C support that now includes timeout when using software I2C Master.
- An IDE to make programming as easy as possible including Help and IDE Helpers.
- 450+ demonstration files that showcase the breadth and depth of capabilities.
- Support for a large set of supported hardware accessories.
New I2C2 drivers adding 2nd I2C support.
GLCD handling with even more types of GLCD supported.
- New scalable fonts with added support for extended fonts sets.
- Increased support for microcontroller timers by supporting all the available microcontroller timers – this can be up to 12 separate timers.
- New support for HEFM memory.
- Handling the default Interrupt handlers.
- Full Linux version of the Great Cow BASIC Compiler and the toolchain
- New Windows installer for four different type of installation.
- Plus other new functionality and enhancements or fixes over the previous release – over 190 major changes since the April 2015 release.
Great Cow BASIC an Open Source project. See http://gcbasic.sourceforge.net/index.php
In embedded systems, oftentimes it is needed to generate analog outputs from a microcontroller. Examples of such include, generating audio tones, voice, music, smooth continuous waveforms, function generators, voltage reference generators, etc. Traditionally in such cases the most common techniques applied are based on Pulse Width Modulation (PWM), resistor networks and external Digital-to-Analog Converter (DAC) chips like MCP4921. The aforementioned techniques have different individual limitations and moreover require external hardware interfacing, adding complexities and extra cost to projects. XMega micros are equipped with 12 bit fast DACs apart from PWM blocks and again it proves itself to be a very versatile family of microcontrollers. In this post we will have a look into this block.
External interrupts are a must have feature in any microcontroller. Interrupts solve a lot of problem that would have otherwise been dependent on polling methods. For instance when we press the volume up key of a TV tuner’s remote controller, the remote controller quickly responds by transmitting the volume up command to the TV set and in turn the TV’s volume increases. This fast response is due to external interrupt issued by the remote’s button to the microcontroller it is connected to. If, however, all the keys of the remote were regularly and frequently scanned and then responded up on a press, the process would have been both slow and energy consuming because its microcontroller would then have never went to sleep or low power states and continuously kept scanning. In other words, the micro would have always ran despite no mandatory necessity and during standby conditions. This would have quickly drained the batteries. Since interrupt is typically used in such cases the remote controller will respond to a button press fast, wake up from sleep/idle/low power mode, transmit command data and then go back to sleep/idle/low power state. Thus the overall energy consumption is reduced while achieving fastest possible reaction. This is how real world applications work applying external interrupts.
Previously we dealt with the XMega Analog-to-Digital Converter (ADC) block. We know that we can use the ADC to measure voltages and take decisions based on voltage values/levels but sometimes it is enough to detect voltage levels and not to measure the exact voltage values. In such occasions where we just need to check voltage levels relative to a reference or threshold value, we need an Analog Comparator (AC). An analog comparator can be used to compare two voltage levels and based on that it can be used to generate a logic output (0 or 1) to indicate which of the two levels is higher or lower than the other. That’s all and there isn’t much about analog comparators. The XMega family of micros come loaded with high performance dual analog comparator modules. However so far we saw that between the traditional 8-bit micros and the XMega micros, the major difference apart from programming is the overall nifty enhancements in all common hardware blocks. When it comes to the analog comparators of the XMega micros, the same is true. In this issue we will explore the XMega analog comparator block.
For users of advance MCUs like the XMega it is not necessary to tell what an analog-to-digital converter (ADC) is or what it does. I assume this is not the first family of microcontroller they are dealing with. Unlike the ADCs of other microcontroller the ADC of XMega devices is a highly complex tool. The level of complexity is so much that without understanding every bits-and-pieces of this piece of hardware a user won’t enjoy its absolute power. XMega ADC is also the most confusing hardware as it is not like other MCU ADCs. We will be dealing with ATXMega32A4U and it has only one ADC block, named ADCA but some other XMega devices like the XMega128A1 have more than one ADC block – ADCA and ADCB. By the way the XMega reference manual provides a long literature on the ADC and I’m not willing to state everything.
A quick view of the ADC block diagram shows most of the internal arrangement.