I have a project that uses MIDI on a custom PCB that uses an ATmega168 with internal clock. I occasionally have to "teach" my micro new MIDI commands. as the TX pin is connected to the MIDI port I do this my using software serial to convert the TX to an RX pin. this works fine BUT... it only works if the micro has a boot loader on it. If I program my micro without the boot loader then the MIDI command that it records to EEPROM is just nonsense. as soon as I use that same micro in the same circuit but with a boot loader it works fine. can anyone think why this might be?
I guess the bootloader does some hardware initialization you're code doesn't. As you failed to post your code we cannot check that. Schematics of your custom board may help too.
yeah I use a board file that sets it up for 8MHz internal. and the midi output works fine. given that for midi to make any sense to the receiver it has to have a very specific baud rate it must have the correct clock right? I think maybe there is something in the fuses but I can't think what it would be. everything else works fine its just that the message that software serial received as scrambled. as if maybe the software serial library is expecting a different baud rate?
SoftwareSerial won't reach that baudrate, not on a 16MHz Arduino, so you have no chance on an 8MHz MCU.
May I ask what you mean by "with bootloader" or "without bootloader". Does that mean the .hex file you upload or does that mean that you upload the sketch by the bootloader or by the programmer?
Hello. well it works fine so it obviously does reach that's speed otherwise midi wouldn't work. by "with the boot loader" I meant that it works if I program the AVR with a (modified) Arduino boot loader first and then upload the sketch using the TX/RX pins like you would on an uno.
anyway I got it working now. it seems that the software serial will only work happily at the speed of MIDI if I run at 8Mhz. the boot loader was setting the fuses to 8Mhz. what I didn't realise is that just flashing the sketch with 8Mhz selected on my board file would not set this fuse. so now to fix i select my board file and set it up for 8Mhz, burn the boot loader to set the fuses, and then flash my sketch in the normal way. this overwrites the boot loader but keeps the fuses.
Pylon. while I thank you for your help, your passive aggressive tone is why people don't like seeking out help on these kind of forums.
I never meant to be aggressive in any way. I'm not a native speaker so I may have chosen the wrong words to be smooth.
I don't see what part of my last post is "passively aggressive" (whatever that means). The first paragraph represents my experiences and the second paragraph is a request for more detailed information.
If you referred to my fist post, if you have to remind every second poster of the information we usually need and which we request by the static post at the top of every topic you stop using words like "please" or "if you don't mind". If that's "passively aggressive" your meaning of "aggressive" is completely different from mine.