GithubHelp home page GithubHelp logo

amigaports / stm_rtc Goto Github PK

View Code? Open in Web Editor NEW
5.0 10.0 0.0 774 KB

STM32 emulator of msm6264b RTC for Amiga computers

License: Mozilla Public License 2.0

C 100.00%
stm32 stm32f0 amiga rtc rtc-module hardware

stm_rtc's Introduction

STM32 emulator of msm6264b RTC for Amiga computers

This project aims to implement RTC replacement for classic Amiga computers. Target uC was chosen to be as cheap as possible, easily available & RoHS-friendly. This project may work on other computers, but it's not guaranteed.

If you made it work for other machine with some fix or without it, tell me so by creating an issue!

Build and flash

To build firmware, you'll need STM32CubeMX installed to generate required HAL stuff. This way you can also easily port this project to other chips.

  • Delete build folder if present in main repo directory.
  • Delete makefile if present in main repo directory. For some reason STM32CubeMX doesn't regenerate it each time.
  • Open stm_rtc_yourPartName.ioc in STM32CubeMX, then click GENERATE CODE button.
  • After that, simply use generated makefile by writing:
make OPT="-Ofast -std=c11 -Wpedantic -frename-registers" DEBUG=0

If you're on Windows and have MinGW installed, you may use mingw32-make instead. This should generate firmware in ./build/stm_rtc.bin. I've used following GCC version:

> arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 5.4.1 20160919 (release) [ARM/embedded-5-branch revision 240496]

To flash firmware into your STM you'll need stm32flash tool installed. Required pinout is as follows:

PA14 (TX) - USB-UART RX
PA15 (RX) - USB-UART TX
BOOT0     - 3v3 during programming, GND when run
RES       - 3v3 via 10k or any other resistor

You may need to drive RES for a short time to GND to reset device before programming.

Connect UART-USB dongle to your PC and type:

stm32flash -R -w ./build/stm_rtc_stm32f031k4u.bin COM5
# or
stm32flash -R -w ./build/stm_rtc_stm32f030c6t.bin COM5

Of course replace COM5 with name of correct serial port. You may use Realterm, Cutecom or whatever serial monitor you prefer to list them.

How it works

TBD

License

See each file for details.

  • All ST code is under STMicroelectronics's license.
  • MSM RTC emulation code found in msm_rtc.c and msm_rtc.h is licensed under Mozilla Public License 2.0.

TODO

  • write
  • add pinout compatibility with smaller stm32f0 packages
  • port to STM32F031C6T6
  • PCB
  • switch to LL generation for less footprint?
  • compat with latest arm gcc?
  • stm32f030 power saving code for even cheaper device?

This worked on QFP48

 147              	.L5:
 148 001c 0B69     		ldr	r3, [r1, #16]
 149 001e 1340     		ands	r3, r2
 150 0020 FCD1     		bne	.L5
 151 0022 3869     		ldr	r0, [r7, #16]
 152 0024 050A     		lsrs	r5, r0, #8
 153 0026 3540     		ands	r5, r6
 154 0028 A800     		lsls	r0, r5, #2
 155 002a 6546     		mov	r5, ip
 156 002c 2858     		ldr	r0, [r5, r0]
 157 002e 4546     		mov	r5, r8
 158 0030 6061     		str	r0, [r4, #20]
 159 0032 2560     		str	r5, [r4]
 160 0034 2360     		str	r3, [r4]
 161 0036 F1E7     		b	.L5

stm_rtc's People

Contributors

tehkain avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.