I'm trying to basically build a tiny arduino clone, with an added bluetooth module to control a Sure LED matrix display. Built my first board the other day, and am having some issues, that I don't know how to trouble shoot.
Things that I've tested that work:
1.) Using Arduino IDE to burn bootloader to ATMega328p (using usbtiny programmer and 6 pin header)
2.) burning code using avrdude and usbtiny, and having it show messages on the display
3.) battery charger
4.) 3.3V supply for bluetooth module
5.) 3.7->5V boost
However, I first tested the bluetooth module, and it didn't seem to work. I could connect to it with my pc and phone but when I used my known working code (tested with an arduino and a breadboard), nothing would show on the matrix. Planning on troubleshooting this later, I moved to the USB portion (FT232RQ) to see if I could upload sketches via arduino IDE, as well as to see if the ATMega could transmit out via the serial interface. When I loaded a sketch (arduino sample, supposed to ouput ascii table), all I got back in the serial monitor was garbage:
sketch:
void loop()
{
// prints value unaltered, i.e. the raw binary version of the
// byte. The serial monitor interprets all bytes as
// ASCII, so 33, the first number, will show up as '!'
Serial.write(thisByte);
Serial.print(", dec: ");
// prints value as string as an ASCII-encoded decimal (base 10).
// Decimal is the default format for Serial.print() and Serial.println(),
// so no modifier is needed:
Serial.print(thisByte);
// But you can declare the modifier for decimal if you want to.
//this also works if you uncomment it:
// Serial.print(thisByte, DEC);
Serial.print(", hex: ");
// prints value as string in hexadecimal (base 16):
Serial.print(thisByte, HEX);
Serial.print(", oct: ");
// prints value as string in octal (base 8);
Serial.print(thisByte, OCT);
Serial.print(", bin: ");
// prints value as string in binary (base 2)
// also prints ending line break:
Serial.println(thisByte, BIN);
// if printed last visible character '~' or 126, stop:
if(thisByte == 126) { // you could also use if (thisByte == '~') {
// This loop loops forever and does nothing
while(true) {
continue;
}
}
// go on to the next character
thisByte++;
}
Results:
AtTSPi
yS?!An
cQm*!G ëEV$Jg\ä+PPn?5P2PPi$ PP6e5PXFDJV$Jg\ÄKPPn?5PRPPi\$)PP6e5P
YdDNVJg\äkPPn?5PrPPi\)PP6e5PYFDRV$Jg\äKPPn?5P?PPi\IPP6e5P dXFDVV$Jg\äkPPL?5P²PPi\$IPP6e5P dXFD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5PÆIPP6e5PF+dYFëyV$Jg\d xV$5q\ÄI¡W?5PÆiPP6e5PF+dYëÿ
The ONLY thing I have in the first version of the board between the FT232RQ and the Atmega, is a 1K resistor network (removed in my second version). I've also checked to make sure the baud/other serial settings match on each one, thinking it could have been a baud mismatch at first.
I then went back to the bluetooth issue, and tried modifying my code so that when ANY serial data came across, it would display something. This time it worked, so I know the BT module is transmitting to the micro controller, but I'm sure it's probably receiving garbage, just like the ATmega is sending out. This leads me to believe a few things:
1.) The power supply on the board is causing interferance (unlikely)
2.) My Atmega is somehow screwed up
3.) somethings up with the resistor network (possible, but only accounts for the serial and not bluetooth.
I originally had a 20Mhz crystal running the board, but thinking it might be a timing issue with SoftwareSerial (for the BT) i switched it for a 16Mhz one, didn't change anything.
Here's a photo of the board layout
and attached is the most recent schematic/board layout (slightly modified so far to reduce part counts and such, but serial and bluetooth haven't changed). It takes around 2-3 weeks to get new boards, and while it only costs about 3$ to make each one (plus shipping/handling), I hate having to wait a month to get a new rev in, and would like to try and figure out what the problems might be before I do a new revision of the board. Unfortunately its hard for me to get access to an O-scope to check signals at the moment, so troubleshooting is difficult.
Controller.zip (71.1 KB)