Sunday, January 6, 2019

RISC-V LIGHT RV32I Basic instruction set soft core IP

This is a very simple to implement RISC-V RV32I Basic instruction set parametrised soft core IP with all the necessary IO's for a basic utilisation.

The ideea to create this softcore had come from principle that the ISA for this core is open source, this way if the core is destinated to create projects that will be monetized does not conflict with any proprietary license.

This is a LIGHT implementation of RISC-V RV32I Basic instruction set that is not developed for speed but is developed for size, this core uses ~900LUT from XILINX Artix-7 device working at ~125Mhz and ~ 1950LUT from LATTICE MarchXO3 working at ~35Mhz.

This come with some basic IO's like paralel IO, UART, SPI, TWI, LCD interface, LCD to HDMI serializer and a simple GFX accelerator ( paint horizontal and vertical lines and fill rectangles with desired colors with speed of the core bus frequency).

Inside the core repository is a test project to compile a simple application running on this core, also I add support for this core and all IO's on MULTIPLATFORM-CPP-SDK under ExampleRiscFive_FPGA directory.

The example application on MULTIPLATFORM-CPP-SDK is made for Digilent NEXIS Video board and read the PmodNAV board sensor data connected to JC and display it to the onboard OLED display and on a HDMI display on a 1440x900 resolution display.
With SW0 can be selected the data that will be displayed, select data from LSM9DS1 and data from LPS25HB.
There is no example application inside MULTIPLATFORM-CPP-SDK directory for the LATTICE board.

The repository of this core on XILINX platform ( Digilent NEXIS Video ) can be found here.
The repository of this core on LATTICE platform ( LATTICE MachXOLF Starter Kit ) can be found here.

All dependencies are placed on this repository: https://git.morgothdisk.com/VERILOG/VERILOG-IP

ATXMEGA softcore IP

This is a very simple to implement MEGA/XMEGA parametrised soft core IP with all the necessary IO's for a basic utilisation.

Now that the FPGA's are on an affordable price, in some cases cheaper than an bare metal microcontroller ( for example LATTICE ICE40 UltraPlus ) and in some cases an equivalent soft core of an bare metal core is faster than the bare metal core, I developed a MEGA/XMEGA parametrised soft core with additional IO IP's like PIO, UART, SPI, TWI, LCD, GFX accelerator, even an LCD to HDMI translator for boards that have HDMI output connector on them.

The repository of this core on XILINX platform can be downloaded from here.
The repository of this core on LATTICE platform can be downloaded from here.

Saturday, March 17, 2018

Intel HEX file to Verilog MEM file

This application is made to convert from Intel HEX format or BIN file to Verilog memory file format and is intended to be call by the compiler after HEX or BIN file was generated.

Below is an example of usage for Atmel Studio on Post build command line:

IntelHexToVerilogMem.exe -i "$(OutputFileName).hex" -o "C:\GitHub\XMEGA-CORE-IP-TST\core1ROM.mem" -g "2" -b "0x20000000" -s "2"

Below is an example of usage for Eclipse on Post build command line:

"${PWD}/IntelHexToVerilogMem.exe" -i "${PWD}\TestRiscVXilinx.hex" -o "C:\GitHub\VERILOG-RISC-V-LIGHT-CORE-IP-TST-XILINX\core1ROM.mem" -g "4" -b "0x8000" -s "2"

The -g argument is optional (default is 2) and indicate the length in bytes on a row, values supported are power of 2.

The -b argument is the offset of the memory, for example if the ROM memory start from 0x20000000 the addresses from 0 to 0x1fffffff is not included in output file.

The -s argument is optional and default value is 1, valid values are 1,2 and 4.

The -s argument is the split value, for example if -g = 4 and -s = 2 this application will output 3 files, one with 4 bytes on the row and two files with half a row each, file "core1ROM_0.mem" will contain bytes 1 and 0 from the 4 byte row and file "core1ROM_1.mem" will contain bytes 3 and 2 from the 4 bytes row.

If -s argument is four will output five files, one with four bytes on each row and five files each with one byte on each row from a four byte row, this will help to read memory's with byte level misalignment in one single clock cycle.

This argument is useful if you want to easily implement unaligned memory read and write in a single clock cycle.

For example for memory's with 32 bit per words if you want to read unaligned 32 bit data you can read the low 16 bit data from file "core1ROM_1.mem" and the high 16 bit data from address + 1 from file "core1ROM_0.mem".

Download application.

Tuesday, September 20, 2016

Raw file to C GCC array converter.

This application converts all files (txt, jpg, bmp, and other) to an constant array hat can be imported to any GCC compiler.
This application export a header fine and a source fine with ".h" and ".c" extension with the same name like imported file.
The input can be multiple files with no filter to extension.


From here you can download the application.

Monday, April 13, 2015

Lepton FLIR thermal image sensor PC application.


I made this application to display the Lepton FLIR thermal image sensor.

This application handle raw received data using uart interface.
The user send the image captured by image sensor in raw mode 80 * 60 * 2bytes = 9600 bytes with a pause of about 60 miliseconds.

This application can be downloaded from here. (this application requires .NET Framework 2.0)
From here you can download a SDK that include even the STM32-E407 board application example to work with Lepton FLIR thermal image sensor.
    From here you can get a simple driver to read data from image sensor using SPI interface.

The sensor will be connected as fallow:
Sensor CS -> PG10
Sensor CLK -> PB10/SPI2_SCK
Sensor MISO - > PC2/SPI2_MISO









Monday, November 24, 2014

BeagleBone Black bridge from USB0 device to eMMC and uSD.

On internet, even on TI forum the people asks how to access (read, write, modify & restore ) data from eMMC on BeagleBone Black.
I create two applications that can run from uSD, this applications bridge the USB device MSC to one of two interfaces MMCSD0 (uSD) or MMCSD1 (onboard eMMC).

The application which  bridge the USB0 to uSD will help the developers to modify the app files from uSD without pulling the uSD from BBB.

This two applications has not a fast data transfer but help the developers to restore read modify data on this two interfaces.

From here you can download the MLO (second stage bootloader) for BeagleBone and BeagleBone Black.
From here you can download the application that bridge USB0 to MMCSD0 (uSD) about 4MB/ read and from 130 to 400KB/s write depending to the uSD card, this application works on BeagleBone and BeagleBone Black.
From here you can download the application that bridge USB0 to MMCSD1 (eMMC) about 10-11MB/s read and 700KB/s write, this application works on BeagleBone if you connect a eMMC or a SD/uSD/MMC card on a expansion board on MMCSD1 pins, the eMMC can work in 1-4 or 8 bit data bus, but if you use the code on BeagleBone without connect a eMMC circuitry the application don't hangup.

For people that want to restore BBB original firmware, from here can download the image of eMMC.

Entire project can be cloned from here.

Friday, November 21, 2014

Audio Spectrum Analyzer V5 32x16 Truecolor Matrix Display

This Audio spectrum analyzer is a 32 frequency band with 16 levels each band, is a high quality real time FFT product, is a V5 class product and at this moment is in development.
Will be capable to process real time FFT audio signal and display the frequencies in different way, from a simple spectrum analysis displaying 32 frequencies with 16 levels each, to visual effects like plasma with full color ( minimum 4096 colors ).
In short time will be available in store: http://devboardshop.com.

Friday, November 7, 2014

MLO boot loader for BeagleBone and BeagleBone Black

This bootloader was compiled for both BeagleBone and BeagleBone Black, the bootloader read the EEPROM data to distinguish if run on BB or BBB.

This can be download from here

Friday, November 9, 2012

Fast Bootloader for BragleBone and AM335x

I made a third level bootloader, that can load user standalone applications more quickly than StarterWare bootloader.
Can be adapted to work with all boards with AM335x TI microcontroller.
The bootloader can load applications with approximately 4.5MB/s depending to the size of fat cluster, the speed of uSD memory card (if a cluster of uSD filesystem is 16KB the speed is higher than one uSD card with 8KB cluster).
This bootloader is made to be loaded at address 0x87F80000(at end of beaglebone RAM memory), If you want to load this bootloader on another location please don't hesitate to write me.
Your application will be named APP.BIN to be loaded by this bootloader.

From here you can download the bootloader.
From here you can download the TI SDCard boot utility.

Thursday, November 8, 2012

AM335x SDK modified from StarterWare

After I bought a BeagleBone rev A6 boart and BeagleboneExpansion V2 CAP with a 800x480 display with capacitive touchscreen, I started to work with StarterWare available from TI.

On this SDK I try to create API's that will be very simple to use, like C#.

I try to arrange the drivers and API's and I added and translated some open source libraries.
The first result is a mix from AM335X_StarterWare_02_00_00_06 and AM335X_StarterWare_02_00_00_07.

On every version I will include a project that will show you how to use the SDK.

This SDK include the next files:

  • API's
  1. Delay API.
  2. Gfx API.
  3. GPIO API.
  4. Interrupt API.
  5. LWIP API.
  6. MMCSD API.
  7. MMU API.
  8. PMIC API.
  9. RTC API.
  10. Capacitive touchscreen API(can read all five points).
  11. Resistive touchscreen API.
  12. TWI API.
  13. Uart API.
  14. USB API.
  15. USB mouse host API.
  16. USB MSC API.
  •  Applications
  1. Simple HTTP application(is a demo, respond only to "GET" command).
  •  Devices
  1. 24C TWI device driver.
  2. ADXL345 device driver.
  • Library
  1. Bitmap decode library.
  2. PNG decode library.
  3. Jpeg decode library.
  4. MPEG1/2 decode library.
  5. Button library.
  6. Check Box library.
  7. Virtual Keyboard library.
  8. List Box library.
  9. Picture Box library.
  10. Progress Bar library.
  11. Scroll Bar library.
  12. Text Box library.
  • System
  1. Cache.
  2. Dmtimer.
  3. Core Iit.
  4. CP15.
  5. Pin mux adc.
  6. Pin mux LCD.
  7. Pin mux MII.
  8. Pin mux MMCSD.
  9. Pin mux SPI.
  10. Pin mux TWI.
  11. Pin mux Uart.
  12. Sys timer(you can create infinite timers with precision approximate to reference timer7).
  13. Sys delay.
  14. Watchdog.
This version has one issue:

When is loaded from bootloader the USB host can't be enabled (will freeze when the USB controller is setup), to set up the USB host is necessary to hardware reset or power up the board without uSD card inserted, after a watchdog reset has the same issue.
I already posted the issue on TI.

Download source code and bin files from here.

Download SD card format utility from here.

Load the app and MLO file with SD boot card utility from archive, after this copy the APP.BIN file to uSD card.

Sunday, May 6, 2012

Xmega A1 Media Player development board

This board can be bought from http://devboardshop.com.
Features of this development board:
  1. Main controller ATxmega64A1/ATxmega128A1/ATxmega64A1u/ATxmega128A1u.
  2. On-board External 512KB SRAM memory ( AS6C4008 ).
  3. One or two onboard 24c EEPROM ICS up to 2Mb, or 23K serial RAM memory, or combined.
  4. One or two onboard uSD memory card sockets, with led to indicate activity of each uSD memory card.
  5. On-board usart to USB converter ( FT232RQ), with RX/TX activity led.
  6. On-board dedicated battery charger controller via USB connector ( MCP73871 ).
  7. On-board dedicated resistive touch screen controller ( AR1020 ).
  8. On-board dedicated RTC/64Bytes SRAM/128Bytes EEPROM circuit with backup high capacity capacitor ( MCP79410 ).
  9. On-board Ogg Vorbis/MP3/AAC/WMA/MIDI codec ( VS1053b ) with jack 3.5mm audio output ,3 pin connector audio input and connector for button style Microphone, with led activity monitor on xDCS, xCS and and DREQ pins.
  10. 320x240 TFT high quality display 8Bit bus mode ( MI0283QT-2 ) connected to external SRAM bus to increase speed of transaction using DMA working with him like a external SRAM.
  11. One 30 pin extension peripheral connector with bidirectional 8bit data bus, unidirectional 8Bit A0-A7 address bus,7 chip select signals, RW and RD signals and one IRQ line.
  12. On-board bus extension decoder to allow up to seven external peripherals directly accessed via external RAM bus ( 74LV138 ) and up to 256*7 external peripherals with external addresses decoders.
  13. One lateral push button user defined(like PWR/Back).
  14. One lateral push button reset function.
  15. PDI programing connector.
  16. JTAG debugging connector.
  17. 3V VLDO power regulator for all circuits, to power this board from LI-IO battery on entire range of voltage ( 3.2 to 4.2V and 5V from USB connector).
  18. 1.8V VLDO power regulator to power digital section on VS1053b circuit.
  19. On-board NOKIA or HUAVEI battery connector.
  20. Three pin connector to connect an external battery.
  21. 29 IO pins accessed via two lateral 26 pin connectors ( entire B and C port, pin port A2-A7 and D1-D7 ).
  22. Resistive divider to monitor the battery voltage.
 Down I posted several photos of board generated by a 3D software:














 In future for this board will be developed extra peripherals like:
  • ATA high capacity hard disk shield.
  • Secondary displays shield.
  • Ethernet interface shield.
  • Nand flash memory shield.
  • Video sensor shield.
  • Magnetometer shield.
  • Gyroscope shield.
  • Dedicated ADC shield to make oscilloscope.
  • Video out encoder shield.
  • Wireless communication shield.
  • GSM communication shield.
  • IR communication shield.
  • Bluetooth communication shield.
  • GPS shield.
  • Motor stepper shield.
  • Xbee shield.
And others.

This board will be delivered with a demo MP3 player project source code and a framework with library's and drivers special developed for this board.

Tuesday, February 7, 2012

How to setup avr studio 5 and 6 to use static library

I search entire internet for a explanation of error "undefined reference to" functions inside static library, but no explicit solution found.

For users that he cannot resolve this issue I will post two photos, how to set up the project to import functions from static libraries.



In this case the .h files is inside the "Directories" (photo2) and the .a files inside the "Debug" folder of each static library project(how is shown on bottom of first photo).

When you compile a static library the compiler generates a file named "libProjectName.a" on "Debug" folder, on top of first photo is shown how can be included the .a libraries, to include .a libraries is necessary to write the .a file name without "lib" and without ".a"inside a quote ("").
With this setup you can include and use static library.

Tuesday, January 24, 2012

Stereo digital audio spectrum analyzer V4.0


This is a stereo upgrade of previous version 3.x.

These boards can be bought from http://devboardshop.com

This version has multiple changes from the previous version, like:

V 4.0A is a version with 18 Bands + Two VU meters for right and left channels.
  1. Can handle stereo signals.
  2. Display format is 18+1+1( to display 18 bands of frequencies and Left Right signal level) .
  3. USB adapter for easy upgrade.
  4. Dedicated RTC with battery back-up.
  5. Added two usart connectors to create cascade spectrum analyzers( to create large display from boards like this ).
  6. A microcontroller twice faster that previous and multiple hardware advantages that increase speed of signal processing and display rendering.
Down I posted two photos with new board design.





V 4.0B is a version with 20Bands.
A 3D presentation of Audio Spectrum Analyzer 4.0B:









Sunday, September 11, 2011

MikroMMB for Xmega MP3 Player

This project is created in AVR GCC with 100% my own drivers and libraries , this player can play MP3, WMA and OGG files from micro SD/SDHC memory card fat16/32 formatted.

V1.3

On this firmware I made some bug fixes and I adding some functions to player:

Bug fixes:

  1. The previous versions has a bug that forces user to put on first location of root directory the volume ID or a file or folder with the short name only.
Function's added:
  1. A progress bar to track the melody, with the same progress bar the user can force the audio player to play file from a specified point.
  2. Player can run now like a thread "Open player" "Close Player" when card is inserted is automatically opened the player, when SD card is removed all resources used by Audio Player will be freed.
  3. Now you can play music from SD/SDHC card's formatted in FAT16 or FAT32(The FAT16 has a little bug, on root directory is displayed only files and directory's from first Page(512Bytes).
On this version you can play: MP3, AAC, OGG, WAV and WMA.



V1.2

 On this version I made some changes:

  1. I change the navigation from the "next" "previous" button to a list box.
  2. On this version is not capable to display bitmap's because I want to design another interface to view bitmap photo.
  3. The VS chip data is send by a service that work inside the RTC interrupt service, in this case has a high priority to send data to VS chip.




Download V1.2 demo version of this player.

V1.1

On this version I made huge improvements.

  1. Now you can navigate through the directories when you listen music, you can choose another melody when you listen another melody.
  2. The player has change the listen melody with the next from the current directory, the payback is stopped after the last melody is played.
  3. Now you can see bitmaps images in 8, 24 and 32 bit/pixel with some limitations, maximum size 240x200pixels, the maximum file size 140KB (140000bytes), the 240x200 pixels limitation is implemented to no interference with the player interface, the 140KB limitation is made because I have a bug in the bitmap library, that can't read files bigger than this value.
This version is limited to play only MP3 files, the core clock is 32Mhz.







V1.0

The controller is running at 16Mhz.

On this version can't manage the power consumption.

This version can play MP3, WMA and OGG.






Tuesday, August 16, 2011

Mikro Media for Xmega simple Lcd Touch Paint


This is made with 100% my library's developed in AVR GCC because free source code for LCD display and touch screen can't be found on internet.

When you power up the board with this firmware, the board enter to touch screen calibrate, in four points, after the last point is touched the display is painted with white back ground and you can scribe through touch screen with chosen color touching the colors rectangles from right up of display.
Chosen color will appear like a rectangle painted with the same chosen color on right down of display.
If you want to clear the display, touch the black rectangle from right down of screen.


V1.1
In this firmware I add function to choose ink color and to clear display.


On this version is eliminated the previous described bug.

V1.0

On the 1.0 firmware version is a bug caused by the capacitors connected in parallel with Q5 and Q9 that is not filtered by the firmware, but for the current work is not a critical bug :D.

ATxmega boot loader

Currently I bought a Micromedia Board ( microMMB for XMEGA ) from mikroEelektronika.

This board is perfect for general developing because can be used by programmers that don't have a programmer, because is coming with a bootloader pre-installed.
I mentioned only the bootloader because this bootloader is the problem
To upload a flash with 64KB size is taken about 10-15 minutes, or to develop a firmware is a very very long time to wait, visualizing this I developed a very fast bootloader to write only Flash and EEProm memory, only strictly necessary memories because all of other ATxmega features can be set from uploaded firmware.

In this stage I compiled eight bootloader firmwares only for ATxmega128A1 for each used hardware usart, and each firmware work with a 256000 baud transfer rate, this baud rate is set like default baud rate for the up-loader when is opened, I want to mention that the up-loader can work with atmega bootloader firmwares found here.

Version 1.0 of firmwares:

For usart 6 ( usart F0 ). can be used for Micromedia Board for XMEGA.


Tuesday, May 17, 2011

Multipurpose development board with ATxmega64A1 / ATxmega128A1


Features:
  1. Main processing unit ATxmega64A1 or ATxmega128A1.
  2. Audio decoder VS1011,1033,1053 with stereo jack 3.5mm female connector & external speakers 3 pin connector(optional).
  3. DS1307 real time clock with battery pads.
  4. PDI & JTAG connectors.
  5. LB1936 dual driver for asynchronous motors (optional).
  6. AD7414 temperature sensor for motor driver (optional).
  7. External motors driver connector with I2C bus.
  8. Two micro SD connectors ( one is optional ).
  9. Four connectors with 2x3 pin to control eight servo motors, two servomotors for each connector, each connector is power interruption to minimize power consumption.
  10. Two power jack connector 5.5/2.1mm put in series to connect two photovoltaic panels and with static commutator controlled by software to charge main accumulator.
  11. High power step down stabilizer from accumulator voltage to 3.3V.
  12. On-board 512KB static ram for minimizing power consumption in sleep mode.
  13. BTM-222 Bluetooth for communication with PC or mobile phones (optional).
  14. RFM12BP at 434Mhz for communication with one remote control for huge distance up to 5Km (optional).
  15. RFM12BS at 868Mhz to control other wireless modules (optional).
  16. All modules from point 13, 14 & 15 can work at the same time without interferences.
  17. Five connectors with four pins with I2C bus and 3.3V power for future extensions.
  18. External extension bus connector to connect future external modules to ATxmega parallel data bus, such as Displays, more motors controllers, image sensors etc.
  19. Possibility to monitor power consumption from main accumulator.
  20. Possibility to monitor generated power by the photovoltaic panels.
  21. Possibility to monitor voltage of the main accumulator.
  22. Possibility to monitor power consumption of each motor powered by on-board driver.
Applications:
  1. Robots: contain on-board dual asynchronous motor driver and four connectors to control eight servomotors, powered from an Li-Ion accumulator and support to charge the accumulator from two photovoltaic cells or from an external source, several communication modules: Bluetooth Class1, EFM12BP for long distance communication up to 5Km and RFM12BS for low power and short distance communication up to 300m.
  2. Audio player: contain on-board VS1011, VS1033 or VS1053, single or dual micro-SD memory card connectors with push.
  3. Audio/Video(low quality) player.
  4. General development application because has all possibility to connect with another controller or another peripherals to the expansion bus, the expansion connector work to speed of the external ram memory, because the expansion peripherals is mapped to address space 524288 to 1048576, maximum number of expansion peripherals is 65536.


Power supply input between 3.4V and 9.5V
Maximum supported input voltage on photovoltaic connectors and the main accumulator: 9.5V, Maximum absolute 10.5V.
Board dimension: 66.83 x 130.78mm.

This board can be bought from http://devboardshop.com.