ghetto chronos

What are you developing?
Post Reply
dannyf
Posts: 167
Joined: Wed May 11, 2016 4:29 pm

ghetto chronos

Post by dannyf » Sat Sep 30, 2017 9:43 pm

warning: no arduino related, no stm32 related.

I just started a project to make a minimalist timer / chrono. Ran through a few iterations / parts, from PIC16 to PIC18 to PIC24F to ATmega, :). May do a STM32F0 implementation, or take on LPC800.

Link is here: https://dannyelectronics.wordpress.com/ ... ronometer/

I'm half way through, with the software / digital part done. Now working on the AFE, SLOOOOOWLY.

Comments / feedback welcome.

dannyf
Posts: 167
Joined: Wed May 11, 2016 4:29 pm

Re: ghetto chronos

Post by dannyf » Mon Oct 02, 2017 11:24 pm

no arduino related
Not anymore, :0

I ported the ATmega8 version to an Arduino Uno and it runs happily. Code provided as well: https://github.com/dannyf00/Ghetto-Chro ... er/Arduino

Warning: the code is essentially C compiled under Arduino (Sublime Text 3 actually), with little trace of the "arduino language", aside from the serial output module.

you can potentially coupled it with other display / output mechanism of your liking.

User avatar
zoomx
Posts: 540
Joined: Mon Apr 27, 2015 2:28 pm
Location: Mt.Etna, Italy

Re: ghetto chronos

Post by zoomx » Tue Oct 03, 2017 10:17 am

I am following your blog post since I have a PickIt3 and a PIC18F45K20 board. I never programmed on a PIC but, as you wrote in your blog, it is not very difficult.

dannyf
Posts: 167
Joined: Wed May 11, 2016 4:29 pm

Re: ghetto chronos

Post by dannyf » Tue Oct 03, 2017 11:07 am

The 8 bit chips have simple peripherals so much easier to get up the learning curve.

Your pic should be able to run the code for 18f23k22 - you should try to compile and see if it works: the config.h file I think has the fuse setting for your pic.

dannyf
Posts: 167
Joined: Wed May 11, 2016 4:29 pm

Re: ghetto chronos

Post by dannyf » Fri Oct 06, 2017 9:02 pm

no stm32 related.
no more. took the first step in moving the display portion of the code over. and it runs perfectly on the $2 STM32F103 board.

here is the connection, with the led on the back of the PCB. LED Pin1->PB9.

Code: Select all

//hardware configuration - for STM32F103C8T6 BluePill
//LED display connection
//LED connected on the back of the PCB
//LED -> STM32F
//Pin1 /E -> B9 /PB9
//Pin2 /D -> B8 /PB8
//Pin3 /DP-> B7 /PB7
//Pin4 /C -> B6 /PB6
//Pin5 /G -> B5 /PB5
//Pin6 /4 -> B4 /PB4
//Pin7 /B -> A4 /PA4
//Pin8 /3 -> A3 /PA3
//Pin9 /2 -> A2 /PA2
//Pin10/F -> A1 /PA1
//Pin11/A -> A0 /PA0
//Pin12/1 -> C15/PC15

//digit definitions
#define DIG1_PORT		GPIOC
#define DIG1_DDR		GPIOC
#define DIG1			(1<<15)

#define DIG2_PORT		GPIOA
#define DIG2_DDR		GPIOA
#define DIG2			(1<<2)

#define DIG3_PORT		GPIOA
#define DIG3_DDR		GPIOA
#define DIG3			(1<<3)

#define DIG4_PORT		GPIOB
#define DIG4_DDR		GPIOB
#define DIG4			(1<<4)

//segment definitions
//map 4-digit led display to STM32 direction
#define SEGA_PORT		GPIOA
#define SEGA_DDR		GPIOA
#define SEGA			(1<<0)

#define SEGB_PORT		GPIOA
#define SEGB_DDR		GPIOA
#define SEGB			(1<<4)

#define SEGC_PORT		GPIOB
#define SEGC_DDR		GPIOB
#define SEGC			(1<<6)

#define SEGD_PORT		GPIOB
#define SEGD_DDR		GPIOB
#define SEGD			(1<<8)

#define SEGE_PORT		GPIOB
#define SEGE_DDR		GPIOB
#define SEGE			(1<<9)

#define SEGF_PORT		GPIOA
#define SEGF_DDR		GPIOA
#define SEGF			(1<<1)

#define SEGG_PORT		GPIOB
#define SEGG_DDR		GPIOB
#define SEGG			(1<<5)

#define SEGDP_PORT		GPIOB
#define SEGDP_DDR		GPIOB
#define SEGDP			(1<<7)
//end hardware configuration
The _DDR macros are only needed for portability.

Post Reply