Medicine Timer

User avatar
LightningStalker
Posts: 21
Joined: Fri Nov 03, 2017 5:00 am
Location: GRMI
Contact:

Medicine Timer

Post by LightningStalker » Fri Nov 03, 2017 5:09 am

I'm getting into STM32 (and STM8) recently and just picked up an ST-LINK/V2 and an ugly board. I have a history with Arduino, ATtiny85, PIC, C, ASM (PIC and x86), and other things. Right now I'm currently working on a timer project.
https://github.com/LightningStalker/Med-Timer

I get a kick out of sharing and helping people, and hope to share some useful information with the community.
Last edited by LightningStalker on Fri Nov 03, 2017 7:10 am, edited 1 time in total.

User avatar
RogerClark
Posts: 7478
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Hey Guys

Post by RogerClark » Fri Nov 03, 2017 5:19 am

Welcome LightningStalker

I hope you have better luck with the Ugly board that I did ;-) It was the first STM32 board I bought, but it turned out to be defective, which probably slowed my STM32 development down a lot.

Getting a ST-Link is a good idea, the clones are very cheap, and even if you only initially use it to load the bootloader etc, I'm sure it will come in handy some time in the future, especially as several people have trying to write some simple in-circuit debuggers using the ST-Link (or BlackMagic Probe etc)

PS. I will need to change the title of this thread to something that helps people searching for the project you are currently working on, so perhaps it should include the text "Medical timer" ??

BTW.

I did a medical timer for my final year degree project, long long ago, and had to use a 8080 processor (not my choice as it was an old processor at the time but thats all the hardware I could get hold of)
The main thing with my Timer, was that it used allophone speech synthesis to announce what medication should be taken. (but I can't remember which speech synth chip I used, except I recall it had some parameters to control things like pitch and other audio processing effects)

User avatar
LightningStalker
Posts: 21
Joined: Fri Nov 03, 2017 5:00 am
Location: GRMI
Contact:

Re: Medicine Timer

Post by LightningStalker » Fri Nov 03, 2017 7:34 am

That sounds like a pretty cool timer. Those speech chips used to be everywhere, but now they have almost completely disappeared. Right now the timer is using LEDs to indicate the medicine, but LCD is looking attractive right now.

I'm still trying to figure out how to flash the bootloader onto the ugly board using the ST-LINK. The bin file is 21kb, is that right? It seems a bit large to be taking up 1/3 of the flash in the MCU. Once that is done though I want to try and do an interrupt driven high precision 1 second LED flasher to get started.

User avatar
RogerClark
Posts: 7478
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Medicine Timer

Post by RogerClark » Fri Nov 03, 2017 8:45 am

The bootloader is now 21k because I merge it with a dummy sketch

If you look in the bootloader_only_binaries folder its just under 8k.

The dummy sketch is there, because we had so many users who didnt realise that the bootloader only provides the DFU device and not the Serial device.

The Sketch provides wither Serial, or other types of USB device functionality.

Re: Speech synthesis

Those old chips used to be very easy to control for basic speech. But I don't know if you can still buy anything that does that.
I guess people use small MP3 player modules, but I've yet to find one that I like.

User avatar
LightningStalker
Posts: 21
Joined: Fri Nov 03, 2017 5:00 am
Location: GRMI
Contact:

Re: Medicine Timer

Post by LightningStalker » Fri Nov 03, 2017 10:02 am

Ok very good info
Maybe that is why Arduino IDE doesn't see the board then.

Burning the bootloader ended up being a long learning process slowly nursing the chip into a working state. I didn't know the ST-LINK doesn't power the board, so that was the first hurdle. The LED not being lit was the clue there.

Then for some unknown reason it was misbehaving and just timing out trying to flash it. That was solved by unplugging both the ST-LINK and the Ugly and then it started working. Just pressing the reset button on the Ugly did nothing.

User avatar
RogerClark
Posts: 7478
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Medicine Timer

Post by RogerClark » Fri Nov 03, 2017 10:47 am

Unfortunately the Ugly board is one of the worst F103 boards

It could be it has a hardware fault.

Mine seemed to have all sorts of problem, so I ended up buying a Maple mini and some Blue Pill's

User avatar
LightningStalker
Posts: 21
Joined: Fri Nov 03, 2017 5:00 am
Location: GRMI
Contact:

Re: Medicine Timer

Post by LightningStalker » Fri Nov 03, 2017 11:22 am

I think it's ok. The serial monitor says the bootloader is installed, but I'm having trouble getting it to flash a sketch over USB.

Code: Select all

No DFU capable USB device found
dfu-util 0.7

Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2012 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Filter on vendor = 0x1eaf product = 0x0004
Waiting for /dev/ttyACM1 serial...Done
lsusb says it's there at 1eaf:0004 and the udev rules are installed, so I don't know what is going on.

User avatar
RogerClark
Posts: 7478
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Medicine Timer

Post by RogerClark » Fri Nov 03, 2017 7:42 pm

There is another active thread about uploading on linux.
Lots if people use Linux and STM32, but but it seems more difficult for people to initially get it working.

Try looking through the active threads and. you should find it

zmemw16
Posts: 1487
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Medicine Timer

Post by zmemw16 » Sat Nov 04, 2017 12:09 am

usual info request, distro, 32 or 64bit, arduino version, which core you;re using, etc, etc
also ls -l /dev/ttyACM*
no dfu device means your board( which one btw) is not in dfu mode, maple mini? a baite type maple mini?
what does the led do, 6 flashes and then a slower 1hz blink ?
if so, hit the button within the 6 flashes, it can be a hassle to get your timing just right.
look at the youtube videos, look at the wiki.

stephen

User avatar
LightningStalker
Posts: 21
Joined: Fri Nov 03, 2017 5:00 am
Location: GRMI
Contact:

Re: Medicine Timer

Post by LightningStalker » Sat Nov 04, 2017 3:41 am

I will go check out the thread before making more replies about it here. Thanks guys

Post Reply