I recently started coding on a raspberry pi. I build a circuit with three buttons, an LED and a 7 digit LCD. Its a fairly simply thing. You can set a time value with the + and - button in seconds and then press the other one to start a countdown. I use this to do triggered long exposures with my camera. However the raspberry pi is to big and bulky and needs to much energy.
Then I put my code and my circuit on an Arduino UNO which is an improvement in size and energy consumption.
Because my program is very simple I am sure that there must be a way to get this on a much smaller chip. I need some kind of programmable chip where I can put my code onto. Something that is small and dont has any other fancy features or more calculating power than I could need. As far as my knowledge goes I dont have any idea how to get into that.
At work we have a 3D printer with a W1209 temperature relay controller on it. This is a small circuit with the same 7 digit LCD pane and the temperature is also settable with two buttons. This inspired me to look for something much more primitive that would be enough for my needs.
Can you recommend any hardware or some tutorials about that?
Search the Microchip website for the DM164141 - MPLABXpress PIC16F18345 Evaluation Board. I think it's around $12 and should have enough I/O for your application. You can use the online MPLABXpress IDE for development.
Related
I need to code for a MSP430FR5969 launch pad that can generate PWM signal upto 100KHz, I want to control it with R-Pi3 over the I2C bus to send the Freq and duty cycle to the MSP430.
I am very new in coding MSP430, any help would be appreciate it.
thans
I find the best approach is to look at the examples provided for this particular LaunchPad. You'll now find these under Resource Explorer.
Run the PWM example and get your head around what it's doing. This should be easy enough using the on-board LED.
Then run the I2C example and get your head round what that's doing. You can connect it straight to the Pi, but a logic analyser will really help with this.
Peripheral setup is the hardest part of MSP430 coding. Once you get this right (or just copy it from an example) the code in between is normally much easier.
I'm building a temperature monitoring unit with arduino, LM35 and a 16*2 LCD display. Now I am going to integrate this unit by SIM900A GSM/GPRS module and I get temperature readings by SMS.
Now my question is, can I get those values by voice calling. If I called to the GSM modem, can it tell the temperature readings.
You need to add all possible values as .amr files or you can break them and play the appropriate files using at commands. Like for 35 you can play sound "thirty" and then "five".
Follow the AMR playing application note available here
Apart of having all the messages in PCM files there is also possibility to use TTS (text to speech) There are small and compact TTS engines out there suitable for Arduino port. Here two I am using (with AVR32):
Tiny Speech Synth by stan 1901
just port it to your arduino (removing the waveout stuff and just use the buffer as PCM). The only lib it really needs is math.h for sin,cos. It may need a bit more work to actually make it more comprehensible but its not that bad when tuned the frequencies ... its using floats heavily but I think port to integer math is also possible ...
KECAL 1.0 ports for ATMEGA
its much older TTS engine originaly from ZX Spectrum but its a bit less comprehensible especially with low quality reproductors (like buzzer) ... But id does not need PWM or DAC ...
I do not know of any more recent OpenSource TTS engine compact enough for MCU platform all I know of are too big or relaying on SAPI,.NET or other OS integrated stuff making them useless.
The #1 is simple and commented enough to make changes improving the phonemes. The #2 was heavily optimized for speed and size (it run on ~4MHz Z80) so no way to improve quality there.
Btw there are also IC for TTS out there so that might be even better choice...
[edit1]
Take a look at this:
Is there any text to speech program that will run on an 8- or 16-bit CPU?
Among other things I added there very good quality and low CPU demand TTS engine ported from Z80 asm into C++, which can be directly used by MCUs ...
We need to change a controller code from the out side as they do with industrial MCU .
So that you have an mcu,with a program on it, and someone can program some "words" to it, that will determine how it works.
So for example you can program an mcu -not with a programer but with some inputs from serial, to do some simple things such as:
if input A==1
b=1
I wonder if there is a smart way to do that with simple software on the mcu, that it has many #defines for various commands, and it perform them according to values it gets from the outside (and saved for the rest of the program).
I wonder if the industrial programers are using that method, or that every programing of a user is actually load a code(.hex) to the chip(with internal programer ) .
I prefer the simplest way(i wonder if its by pre defined software)
A couple of options come to mind so hopefully this answers your question. It sounds like the simplest version of your question is "How do I change the behavior of the MCU without an actual MCU programmer?" A couple of options come to mind.
1) Depending on the MCU you can have a bootloader that is essentially a small piece of code programmed in the MCU by a programmer that has the ability to reprogram other parts of the MCU. This doesn't require a programmer but involves some other form of letting the bootloader know what the new code is (USB, Serial, SD Card, etc). This will only work if the MCU has the ability to self flash.
2) Again, depending on MCU and scenario you could program a generic set of rules that carry out functionality based on the inputs given to the MCU. This could be in the form of IO pins, EEPROM, or a domain-specific script on an SD card that the MCU can read and interpret at runtime.
Both options depend on the MCU you are using and what hardware capabilities you have at your disposal. But you certainly have options other than reprogramming the end hardware with an actual programmer every time you want to make a change. Hopefully that helps.
Ive been trying to build a 32X12X12 LED cube (something like this http://www.youtube.com/watch?v=f1YNyQqbiF0 ) and trying to get some animation running on it. I used the Arduino to get a 8X8X8 cube running and i wanted to know:-
Is it possible to do the same with the Arduino (considering limited number of ports)?
If Yes, what additional hardware would i require? (Like Multiplexers and Shift Registers)
Is there a LED Driver or any other open source HW platform i could use to do this, that allows easy programming also?
I will multiplex your 3 questions into one answer: I recommend the MA72xx to drive your LEDs. You can drive up to 15 of them from your Arduino, which probably will suffice your 32x32x32 needs.
Here is my issue, it appears that all the communication lines for the PIC 16F913 reside on the same set of pins, this is convenient in that I don't have to sacrifice GPIO pins just to do comms, however the problem I'm having now is if I'm using the SPI on the chip, how can I send information to the RS232?
The reason this issue came up, is that I just bought a CAN bus chip that communicates over SPI, and I would really like to see the data on RS232, so I can see messages. (I really don't know much about CAN yet, so who knows if this even makes sense yet).
Here are the options I see, and maybe someone else has better ideas that I'm just simply missing.
Somehow setup a time scheme that will switch between SPI and RS232 every time I get data,
-- This doesn't seem hard and should work, but supposing I don't want to miss a message, what if a message is written while I'm writing to RS232, is it possible I'll miss it?
2.. I can always use SPI, but then build my own comm bus over 8 of the GPIO lines, to another PIC 16F913, using only the GPIO lines and then since the RS232 lines are free on the second PIC I can simply read the data and spit it out.
-- This one is doable but now we're wasting 2 chips, AND all the GPIO lines,
There has to be a better way. Or is there?
Any help is greatly appreciated.
Update: I would like to clarify, obviously one solution is using a completely different chip (which may in fact be what I end up doing, if I can get the 18F programmed), however, I'm interested in worst case scenario, in which I am limited in resources and only have some 913's, is the way described above the only way to do it with this chip, or is there a better way?
You could do a software implementation of the SPI bus - it's easier to do than the UART because the timing isn't critical and you are in control of it.
Most CAN chips have a few receive buffers so if you're busy doing something with the UART then the messages will be buffered inside the CAN chip. But... you will need to make sure that you can get the messages out of the CAN chip fast/often enough so you don't lose some.
You would probably have to either use an interrupt for the UART Tx process - so that you can be receiving CAN messages while you're sending data on the UART.
If you're only interested in certain messages most CAN chips have filters - this makes it easy to only receive the messages you're interested in, usually dropping the number of packets/second dramatically.
You can use a software implementation of a RS232 port. For example the c compiler from http://mikroe.com comes with such a library. But it shouldn't be too hard to shift bits to an output pin, rs232 is a fairly simple protocol.
I strongly recommend that you change the MCU with PIC16F1933.
It is newer
It is cheaper
With EUART and MSSP moduls.
The MCU arhitecture is impruved.
The PIC16F913 MCU will become obsolete in next few years!