Show Posts
|
|
Pages: [1]
|
|
4
|
Community / Bar Sport / Re: Thermal images of a Mega
|
on: May 20, 2012, 07:27:55 pm
|
As for the FTDI chip, it's very simple to use and reliable, I like it. I just wish they had a smaller version, after all you only need about 6 pins.
Rob, Take a look at the new FT230 and FT231 from FTDI. 16 and 20 pins, respectively, and less than half the cost of the FT232. I think I'm going to like these even better! Jon
|
|
|
|
|
6
|
Using Arduino / Microcontrollers / Re: Need Help with TQFP-44 version of 1284P bootloader
|
on: November 13, 2011, 07:39:33 am
|
Constantin, I also tried the Bahbots bootloader and cores on a 1284. The bootloader installed correctly and programs would compile, but uploads would halt without an error message. My best results use a mix of brewtroller's bootloader/cores and Arduino-0022 cores. The procedure can be found in the last post of this thread. I've got no idea how this would affect your pin definitions, since my application was for a Sanguino. Jon
|
|
|
|
|
7
|
Using Arduino / Project Guidance / Re: Solved: Sanguino, servo, LCD, and serial...
|
on: October 27, 2011, 02:58:42 pm
|
I think I copied another section to add this to avrdude.conf:
Yeah, sometimes it's difficult to remember all the steps you went through to get something working. Thanks so much. Your addition at least let me compile for the 1284P, but uploads would lock up without any error message. A little more playing and here's what finally worked: Download brewtroller's bootloader & cores. Keep the pins_arduino.h, pins_arduino.cpp, WInterrupts.c, and wiring_private.h in the 1284P cores directory, delete all other files. Copy Arduino-0022 core files, except pins_arduino.*, WInterrupts.c, and wiring_private.h to the Sanguino1284P cores directory. In the Sanguino1284P cores directory, edit pins_arduino.h: #define NOT_ON_TIMER 0 #define TIMER0A 1 #define TIMER0B 2 #define TIMER1A 3 #define TIMER1B 4 #define TIMER2 5 #define TIMER2A 6 #define TIMER2B 7 //next nine lines added by jac (stratosfear) #define TIMER3A 8 #define TIMER3B 9 //#define TIMER3C 10 //#define TIMER4A 11 //#define TIMER4B 12 //#define TIMER4C 13 //#define TIMER5A 14 //#define TIMER5B 15 //#define TIMER5C 16
Finish by making CrossRoads' change to avrdude.conf. Thanks, again! Jon Reason for edit: If the 1284P WInterrupts.c and wiring_private.h are overwritten, functionality of attachInterrupt(2, , ) is lost.
|
|
|
|
|
8
|
Using Arduino / Project Guidance / Re: Solved: Sanguino, servo, LCD, and serial...
|
on: October 26, 2011, 06:58:17 am
|
|
Thanks for the suggestion, Bob. I had those files, but didn't try them until this morning. The Duino 644P board gives me about 5 seconds of twitching every 15 seconds, or so. It's not as bad as the Sanguino cores, but not as good as stock Arduino-0022, either.
I have a 1284P with the bootloader installed and want to try it in the board. Any time I try uploading to the chip, I get the error message, 'avrdude: AVR Part "atmega1284p" not found', followed by a list of valid parts. Did you make changes to avrdude.conf?
Jon
|
|
|
|
|
9
|
Using Arduino / Project Guidance / Re: Sanguino, servo, LCD, and serial...
|
on: October 25, 2011, 09:21:59 am
|
|
Okay, Arduino-0018 did no good at all, so I returned to 0022 and started looking through the core files to see if anything looked wrong – not that I’m any good reading someone else’s code. On a guess, I deleted all the Sanguino core files, except pins_arduino.c and pins_arduino.h. Then I copied all the other Arduino core files to the Sanguino core directory. Now, I’ve got a nice, quiet servo!
Although this procedure solved one problem, it may introduce others as my program expands. Still, I’m confident enough to proceed with a circuit board.
Jon
|
|
|
|
|
11
|
Using Arduino / Project Guidance / Re: Sanguino, servo, LCD, and serial...
|
on: October 21, 2011, 04:26:30 pm
|
|
Thanks for the suggestion, Paul. You're correct about the missing lines, and you've also confirmed my suspicion about corrupted interrupts. My servo still jitters, however, so I'm going to install Arduino-0018 and use the modified file.
Jon
|
|
|
|
|
12
|
Using Arduino / Project Guidance / Re: Help with eagle
|
on: October 19, 2011, 05:30:27 pm
|
|
You'll have to edit the footprints since you can't smash tPlace elements. Just delete them or change the layer they're in.
Jon
Just remembered the silk.ulp. It create new layers with editable silkscreens. You'll have to change your cam settings, though.
|
|
|
|
|
13
|
Using Arduino / Project Guidance / Re: Help with eagle
|
on: October 19, 2011, 04:34:48 pm
|
|
Texy,
It's possible those numbers are in Document, tDocu, or bDocu. Just make sure the unwanted layer isn't used in the silkscreen tab of your cam job.
Jon
|
|
|
|
|
14
|
Using Arduino / Project Guidance / Solved: Sanguino, servo, LCD, and serial...
|
on: October 17, 2011, 05:46:04 am
|
Long time lurker, first post... I’m trying to run servos, a 16x4 LCD, and hardware serial on a Sanguino board. When there’s no incoming serial, I get an occasional and barely perceptible twitch on the one servo connected. When the Sanguino is receiving serial data, the servo jitters continuously. The same code runs on a Mega2560 without the jitter. The jitter can be measured with an o-scope when the servo and LCD are removed, so it’s not the hardware, power supply, or grounds. A 1500uS pulse will jump by 50 to 90 uS. Just to make sure it’s not the transmitter end, I even substituted a Duemilanove running a short piece of code. Since I’ve eliminated all the external hardware, I have to suspect incompatibility between the Sanguino core files and Arduino libraries. Is anyone willing to confirm this, suggest a fix, or find an error in my program? Sanguino receiver:
/* receiver serial in Serial data is 21 byte frame. Frame prefix is 0xaa, 0xaa. Frame suffix is 0xed, 0xed. Eight 'little-endian' words, followed by one byte. High nibble of high byte indicates channel number. Value of Low three nibbles is 2 * pulsewidth in microseconds.
LCD pin Arduino pin 1 = GND GND 2 = VCC VCC 3 = n/c (LCD contrast) 4 = RS D7 5 = R/W D6 6 = ENB D5 7 = D1 n/c 8 = D2 n/c 9 = D3 n/c 10 = D7 n/c 11 = D4 D4 12 = D5 D3 13 = D6 D2 14 = D7 D1 */
#include <LiquidCrystal.h> //The liquid crystal display library //LiquidCrystal(rs, rw, enable, d4, d5, d6, d7); LiquidCrystal lcd(7, 6, 5, 4, 3, 2, 1); //Assign pin functions
//Servo library and servo initialization #include <Servo.h> Servo ch1Out; Servo ch2Out; Servo ch3Out; Servo ch4Out; Servo ch5Out; Servo ch6Out; Servo ch7Out; Servo ch8Out;
//Initialize 21 byte frame buffer byte rcv[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
byte printFormat = 1; //0 prints raw data. 1 prints decoded data byte lcdDiag = 1; //0 bypasses LCD printing, 1 prints to LCD byte clearLCD = 0; //Flag for "Ready" message erased unsigned long elapsedStart; // microseconds since last LCD update void setup() { Serial1.begin(125000); //Yes, 125000 baud! lcd.begin (16,4); //16 x 4 LCD //Tell user we're ready lcd.setCursor (0,0); lcd.print ("Ready"); //attach the servos ch1Out.attach(15); ch2Out.attach(16); ch3Out.attach(17); ch4Out.attach(18); ch5Out.attach(19); ch6Out.attach(20); ch7Out.attach(21); ch8Out.attach(22); elapsedStart = micros(); }
void loop() { if (Serial1.available() >0) { //Read byte from uart if available rcv[20] = Serial1.read();
if ((rcv[0] == 0xaa) && (rcv[1] == 0xaa) && (rcv[19] == 0xed) && (rcv[20] == 0xed)) { //We have a valid frame, process it.
ch1Out.writeMicroseconds(xlate(3)); ch2Out.writeMicroseconds(xlate(5)); ch3Out.writeMicroseconds(xlate(7)); ch4Out.writeMicroseconds(xlate(9)); ch5Out.writeMicroseconds(xlate(11)); ch6Out.writeMicroseconds(xlate(13)); ch7Out.writeMicroseconds(xlate(15)); ch8Out.writeMicroseconds(xlate(17));
if (lcdDiag == 1) { lcdPrint(); } }
else { /* We don't have a valid frame, so roll buffer contents one location to prepare for next byte from uart. */ for (byte count = 0; count <=19; count++) { rcv[count] = rcv[count + 1]; } } } }
unsigned int xlate(byte index) { /* Strip upper nibble from high byte. combine with low byte to get value. divide by 2 to get pulsewidth in microseconds. */ unsigned int ch = (((rcv[index] & 0x0f) * 0x100) + rcv[index - 1]) / 2; return ch; }
void lcdPrint() { if (clearLCD == 0) { //only clear screen once, reduce flickering lcd.clear(); clearLCD = 1; }
if (printFormat == 0) { // prints raw hex data as received
printChVal(rcv[0], 0, 0); printChVal(rcv[1], 3, 0); printChVal(rcv[2], 6, 0); printChVal(rcv[3], 9, 0); printChVal(rcv[4], 12, 0);
printChVal(rcv[5], 0, 1); printChVal(rcv[6], 3, 1); printChVal(rcv[7], 6, 1); printChVal(rcv[8], 9, 1); printChVal(rcv[9], 12, 1);
printChVal(rcv[10], 0, 2); printChVal(rcv[11], 3, 2); printChVal(rcv[12], 6, 2); printChVal(rcv[13], 9, 2); printChVal(rcv[14], 12, 2);
printChVal(rcv[15], 0, 3); printChVal(rcv[16], 3, 3); printChVal(rcv[17], 6, 3); printChVal(rcv[18], 9, 3); printChVal(rcv[19], 12, 3); printChVal(rcv[20], 14, 3); }
else { //prints data converted to microseconds
//calculate elapsed time since last valid frame and print on top row at right lcd.setCursor (10,0); lcd.print(micros() - elapsedStart, DEC); lcd.print(" "); elapsedStart = micros(); printChVal(xlate(3), 0, 0); printChVal(xlate(5), 5, 0);
printChVal(xlate(7), 0, 1); printChVal(xlate(9), 5, 1); printChVal(xlate(11), 0, 2); printChVal(xlate(13), 5, 2); printChVal(xlate(15), 0, 3); printChVal(xlate(17), 5, 3); lcd.setCursor(10,3); lcd.print(rcv[18],DEC); } }
void printChVal (unsigned int chanVal, byte col, byte row){ lcd.setCursor(col, row); if (printFormat == 0) { lcd.setCursor (col,row); lcd.print(chanVal, HEX); } else { if (chanVal < 1000) { //print a leading space if less than 4 characters lcd.print(" "); } lcd.print(chanVal, DEC); } }
Duemilanove transmitter:
//tx emulator
/* two prefix bytes, eight servo words, one unknown byte, two suffix bytes. all times are 1500uS */ byte tx[] = {0xaa, 0xaa, 0xb8, 0x1b, 0xb8, 0x2b, 0xb8, 0x3b, 0xb8, 0x4b, 0xb8, 0x5b, 0xb8, 0x6b, 0xb8, 0x7b, 0xb8, 0x8b, 0x00, 0xed, 0xed};
void setup() { Serial.begin(125000); //to conform with device }
void loop() { long unsigned mSec; //timing reference if (millis() - mSec >= 20) { //transmit a frame approx. every 20mS for (byte txCount = 0; txCount <=20; txCount++){ Serial.write(tx[txCount]); } } mSec = millis(); //renew the timing reference }
Thanks, Jon
|
|
|
|
|