Hi, is there a schematic somewhere out there for very low noise adjustable power supply? Something like Walt Jung super regulator (but adjustable) with only a few microV output noise?
Anyone actually had any practical experience with Arduino serial comms using the internal oscillator?
Looks like I could make my current project Arduino compatible as-is, the only issue is the use of the internal oscillator.
Dave, is this going to be an arduino programming based project or are you going to write the C yourself?
What if you don't use a xtal witch require two pins. You could use a stable external clock source (VCXO) witch need only one pin.
Dave, is this going to be an arduino programming based project or are you going to write the C yourself?
Why do you need to do this (the serial comms)?
You can use the Arduino IDE and program using the USBtinyISP via the 6 SPI pins, which you can break out or get at one way or another (even if you have to program the chip before inserting it onto the board).
It's still "Arduino compatible" - you just need to be aware if you are running at 8 MHz rather than 16 (which is done by a #define in the library) in places that matter, like timing code.
If you are running out of interface ports, you can hook up 119 lots of I2C devices to the two I2C pins. Devices like LCD drivers, ADC, IO expanders for keypresses, etc. Even a single 16-port I2C IO expander gives you 16 extra ports which can be individually configured for input or output.
Actually yes, you can use Arduino IDE to compile your program and load the hex file to the target mcu using ISP and whatever programmer you wish. With this way you can save the space the bootloader needs.
The downside is that someone will need a programmer to load it.
My opinion though is that if the frequency shifting doesn't produce baud error bigger than 1% it will be ok. So, now need for changes.
Will the design be physically divided into the analogue and uC part ? i.e., separate boards ?
Something tells me, I could use the analogue part as learning experience - but when it comes to uC - I have few things I want to do to make it work for me, something tells me it will differ from whatever someone else will do. Even such a brilliant guy like yourself.
One thing I want, is to have few buttons (3-4) with predefined voltage that I could just bring in with one touch. Likewise for current settings.
Plus, having separate analogue board would mean that you could have few of them not just one
Dave, will the analogue part differ much from what you already designed ?
And can you tell us where exactly the serial io and clocks really matter ?
I thought this is strictly either PWM, or DAC (some PICs have internal DAC). I do agree that arduino makes things easier.
The way I would do it, I would use arduino nano, or arduino pro - and just have pins that will accommodate it.
That would just increase the cost over just having the micro on it's own.
Indeed, but will make programming it and so on so much easier. These things come with usb port, and loader on it already.
You can buy arduino nano off ebay for £8. Personally I don't own any uC programmers anymore, arduino and TI MSP LP board do things for me.
Design pins for arduino pro, or nano on your board - stick it on - et voile, job done. Nice and simple.
The serial I/O and clock only matters if I make it Arduino compatible.
I presume your design doesn't currently have a USB interface, so to program it you either need to use a bootloader with a custom FTDI cable ($20) or via the ISCP header using a custom programmer ($22). Clearly the difference, for people that want to reprogram it, is minimal.
The Optiboot loader, currently used on the Uno (Atmega328) is 512 bytes, not 2Kb. The overhead, out of 32 Kb of program memory is minimal. Particularly since you were talking about using a chip with less memory to start with. Add 70 cents to the chip price and you can afford lots more "bells and whistles" in terms of the onboard code.
You don't need to muck around with hex files, I have personally programmed my "bare bones board" project just using the IDE. You edit the preferences file (once off) to tell it to use the USBtinyISP programmer rather than the bootloader, and then just hit Ctrl+U to compile and upload. Couldn't be simpler.
I would be tentatively planning to go through a calibration phase (to compensate for slight differences in resistor values) and store compensation data in the EEPROM. That way each unit should be pretty accurate. You might also have default "turn on" settings.
As I said before, it's Arduino compatible even without that. In fact, if you are using the Atmega48 chip, and have an ICSP header, you would be hard-pressed to not have it Arduino-compatible. The only difference might be the way you write the software. And honestly, why not use the Arduino IDE? The compiler is g++, an industry standard. It generates tight, efficient code. The linker optimizes away stuff you don't need. You don't have to use any of their libraries if you don't want to. But things like the ports are already defined in header files. Interrupts are easy to do.
Why do you need to do this (the serial comms)?
Because that's the "normal" way to program an Arduino board, is it not?
Yes, but if you use an external programmer then you can use that for other stuff, instead of adding $10+ to the cost of every project you do.
If everyone designed kits based around Arduino modules instead of bare chip, then every kit and every project will be at least $10 more expensive. Do people really want that?
To me it seems like a waste of cost, in this case a large chunk of the project cost that I'll have to either pass on to buyers, or eat it.
I supposed it depends what you mean by "normal". There are quite a few Arduinos ...
http://arduino.cc/en/Main/Hardware
The "development board" version has a USB port, so yes, it is designed to be as easy as possible for beginners. The bootloader is a program residing in upper memory which is allowed to change the flash memory (various fuse bits configure this). So one way of updating the flash is for the bootloader to kick in at reset time, check for data on the serial port, and if it passes various tests, update the main program memory.
However the hardware also is designed to respond to ICSP programming (using SPI via the ICSP port), and boards like the USBtinyISP convert data from the USB port into the appropriate SPI sequences. The nice thing is that you can still use all the Arduino libraries and (so-called) sketches whether or not you use the bootloader.
So really, the prototyping board is useful for quickly testing a concept, and then you can move to just the chip and whatever support components you need, but still use the development environment.
I think we are at cross-purposes here. I am not suggesting using the Arduino board as such. That's $30 compared to $5 for the chip. But you can test out your ideas (as I did with the power supply) by using the board. Quick and easy. But then you take the bare chip, add a resonator maybe, and a few resistors and capacitors, and you are down to a cheap and simple solution.
And you are quite right, using the external programmer, you get to keep the programmer and use it for dozens of projects. That's where buying lots of Arduino "development boards" falls down. You are paying multiple times for the USB interface, which you need once.
Sure, writing code for the arduino is C, but you have to write code for the arduino.
Sure, writing code for the arduino is C, but you have to write code for the arduino.
Only except that its c++. Yes, there's a difference.
(C++ is far superior, and safer of course).
#define BAUD 38400UL // Baud rate.
/* Baud rate calculations. */
#define UBRR_VAL ((F_CPU+BAUD*8)/(BAUD*16)-1) // Smart roundup.
#define BAUD_REAL (F_CPU/(16*(UBRR_VAL+1))) // Real Baud.
#define BAUD_ERROR ((BAUD_REAL*1000)/BAUD) // Fault per 1000 parts.
#if ((BAUD_ERROR<990) || (BAUD_ERROR>1010))
#error Baud rate error bigger than 1%, aborting!
#endif