Show Posts
Pages: [1] 2
1  Using Arduino / Displays / Re: avr to lcd on: December 05, 2012, 10:30:20 am
The lines from digital pins 0 and 1 have been removed and are in A15 and A14 respectively.
Hi Don. Still at it. Will get it to work with the lcd at least.
2  Using Arduino / Displays / Re: avr to lcd on: December 05, 2012, 09:32:20 am
Although things look a bit unkempt, this is just for testing purposes. Once I get everything to work as desired then will wire everything neatly and compact into the encasing for the handheld which will hold the mcu, display and keyboard.
Here is also the vfd which I really wanted to work, but figure that the controller chip is faulty, although physical testing shows the following.
3  Using Arduino / Displays / Re: avr to lcd on: December 05, 2012, 09:25:43 am
Good news! Not only did analog14 work for row 2 pin of the keypad but analog 15 worked for row3 pin as well.  I'm not all that hot with programming but having had a not-so-good experience in my microprocessors class, have suddenly had a renewed passion for it through the use of the arduino mcu. As you may have noticed, the overall sketch that i've sent is actually a combination of the keypad sketch and the lcd sketch and with 'logical' additions of other 'C' syntax which i figure will give me what I want.
Having made the changes above in the overall sketch, it still hangs up on the upload.
I'm thinking maybe the encoding is too long. Is there a more efficient way I can obtain the parameters in the sketch to be displayed, and am wondering where i'm going wrong.
4  Using Arduino / Displays / Re: avr to lcd on: December 05, 2012, 08:29:27 am
You are right. I thought I had got the lcd to work with 3,2,1,0 combination and that's why i hooked up the keypad to the row pins to this combo. Turns out when i checked the Lcd this morining with these nos., got gibberish.
I'm very interested in what you're doing, and in particular 2 pins, 1 for lcd and the other for the keypad?! That's awesome! Thing is I'm on an extremely tight budget and had already purchased 2 keypads, 2 2560's,a 20x4 and 16x2 sainsmart lcds (these had issues), with the ruggeduino, had a vfd to originally hook up to the MCU that bombed out and refused to work ( will check that out after the class project is done), and have my final project to turn in on the 10th. Was hoping to work with what I got without having to purchase anything else. Got a 16 x2 lcd from the lab. I like the ruggeduino for it's protective features, but im thinking may have to use one of the 2560's. I admire the work you're doing though.
What's your advice here.
5  Using Arduino / Displays / avr to lcd on: December 04, 2012, 12:44:41 pm


I'm trying to get a 4x4 matrix keypad to write characters to a 16x2 LCD, using a Ruggeduino. I have a program which utilizes the arduino keypad and lcd libraries, which compiles but, when attempting to upload, 'hangs up', is not uploaded, and  produces the following error messages:

    1) avrdude: stk500v2_ReceiveMessage(): timeout, repeated about 50 times before...
...2) avrdude: stk500v2_command(): failed miserably to execute command 0x10...
...3) avrdude: initialization failed, rc=-1....(1) repeated again many times before...
...4) avrdude: stk500v2_command(): failed miserably to execute command 0x11...
...5) avrdude: stk500v2_disable(): failed to leave programming mode

The source code is as follows:

Code:

#include <LiquidCrystal.h>
#include <Keypad.h>

//lcd(RS, E, D4, D5, D6, D7)
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);
int numRows = 2;
int numCols = 19;

const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns

//define the symbols on the buttons of the keypads
char hexaKeys[ROWS][COLS] = {
  {'A','1','2','3'},
  {'B','4','5','6'},
  {'C','7','8','9'},
  {'D','*','0','#'}
};

byte rowPins[ROWS] = {7, 6, 5, 4}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {3, 2, 1, 0}; //connect to the column pinouts of the keypad

//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);

void setup()
{
  Serial.begin(9600); // baud rate
  lcd.begin(numRows, numCols);
  lcd.clear(); // clears the display
  lcd.setCursor(0,1);// sets cursor position to 1column, 2nd row
}
 
void loop()
{
 if (Serial.available() > 0)
  {
      // declares keytype, gets character key
      // and serial reads pressed key at Arduino Pins
      char customKey = (customKeypad.getKey() && Serial.read());
     
      // declares keytype for the digits on the keypad
      // and serial reads pressed key at Arduino Pins
      int digits = (customKeypad.getKey() && Serial.read());
   
   if (customKey =='C')//keytype for Clearing display 
      {
        lcd.clear();
      }
   
   else if (customKey == ('# && 1'))//for displaying Altitude
      {
         lcd.print(("Alt.=")&& (digits));
           if (customKey == ('*'))
           {
             lcd.clear();
             lcd.setCursor(0,0);// sends Altitude to 1st row
             lcd.print(("Alt.=")&& (digits));
           }
      }
 
   else if (customKey == ('# && 2'))//for displaying Altitude Rate
      {
        lcd.print(("Alt.Rt.=")&& (digits));
         if (customKey == ('*'))
         {
           lcd.clear();
           lcd.setCursor(0,0);// sends Altitude Rate to 1st row
           lcd.print(("Alt.Rt.=")&& (digits));
         }
      }
   else if (customKey == ('# && 3'))//for displaying Altitude Rate Limit
   {
      lcd.print(("AR.Lim.=")&& (digits));
         if (customKey == ('*'))
         {
           lcd.clear();
           lcd.setCursor(0,0);// sends Altitude Rate Limit to 1st row
           lcd.print(("AR.Lim.=")&& (digits));
         }
     } 
   else if (customKey == ('# && 4'))//for displaying Airspeed data
   {
      lcd.print(("AirSpd.=")&& (digits));
         if (customKey == ('*'))
         {
           lcd.clear();
           lcd.setCursor(0,0);// sends Airspeed data to 1st row
           lcd.print(("AirSpd.=")&& (digits));
         }
     }
    else if (customKey == ('# && 5'))//for displaying Airspeed Rate 
    {
      lcd.print(("A/S Rt.=")&& (digits));
         if (customKey == ('*'))
         {
           lcd.clear();
           lcd.setCursor(0,0);// sends Airspeed Rate to 1st row
           lcd.print(("A/S Rt.=")&& (digits));
         }
     }
   
    else if (customKey == ('# && 6'))//for displaying Airspeed Rate Limit 
    {
      lcd.print(("A/S RLim=")&& (digits));
         if (customKey == ('*'))
         {
           lcd.clear();
           lcd.setCursor(0,0);// sends Airspeed Rate Limit to 1st row
           lcd.print(("A/S RLim.=")&& (digits));
         }
     }
   
    else if (customKey == ('# && 7'))//for displaying Pitot Pressure
    {
      lcd.print(("Pt/inHg=")&& (digits));
         if (customKey == ('*'))
         {
           lcd.clear();
           lcd.setCursor(0,0);// sends Pitot Pressure to 1st row
           lcd.print(("Pt/inHg=")&& (digits));
         }
     }
    else if (customKey == ('# && 8'))//for displaying Static Pressure
    {
      lcd.print(("Ps/inHg=")&& (digits));
         if (customKey == ('*'))
         {
           lcd.clear();
           lcd.setCursor(0,0);// sends Static Pressure to 1st row
           lcd.print(("Ps/inHg=")&& (digits));
         }
     }
    else if (customKey == ('# && 9'))//for displaying Engine Pressure Ratio (EPR=Pt/Ps)
    {
      lcd.print(("Pt/Ps=")&& (digits));
         if (customKey == ('*'))
         {
           lcd.clear();
           lcd.setCursor(0,0);// sends EPR to 1st row
           lcd.print(("Pt/Ps=")&& (digits));
         }
     }
    else if (customKey == ('# && 0'))//for displaying Mach Number
    {
      lcd.print(("Mach.=")&& (digits));
         if (customKey == ('*'))
         {
           lcd.clear();
           lcd.setCursor(0,0);// sends Mach Number to 1st row
           lcd.print(("Mach.=")&& (digits));
         }
     }
     
   else if (customKey == ('B'))//for indicating unit is to be Reset and Vented
      {
         lcd.print("Reset & Vent");
           if (customKey == ('*'))
           {
             lcd.clear();
             lcd.setCursor(0,0);// sends Reset & Vent information to 1st row
             lcd.print("Reset & Vent");
           }
      }
  }

}

PIN CONNECTIONS:
As shown in attached doc.

 
6  Using Arduino / Displays / Re: avr to vfd on: November 29, 2012, 12:31:55 pm
Quote
Your photograph shows at least four displays.  It looks like three of them are LCDs and one is a VFD.  I thought we are dealing with the VFD since that is what is is in the forum title yet it is one of the LCDs that seems to be displaying a single 'S'.  If that is the 'S' to which you were referring then why did you call it an 's' ? 

There is no place in your program where you are sending an 's' to the LCD but the last character that you are sending to the top line is an 'S'.  Try putting a delay in there and see if all of the characters are actually being sent but all you are seeing is the last one.
The 16x2 with back light is running with the 2560; there is a problem getting print onto the 2nd line.
It's an 's' and when i add the bigger delay as you suggested, i do get the 1st line of data merry christmas but not the 2nd line.
Im running the 2 displays at the same time in the hope i will see the vfd come while making adjustments to the program that works with the LCD which is why I sent the 3 pdfs with 3 sketches showing the progression from the 1st to the 3rd and more recent.
The link that the forum member Ravi provided to the noritake site gave me the init routine for this type of vfd and that's what i used, and  then came up with the 's' character; figured a smaller delay for the vfd would be required compared to the lcd and that's why some of the info disappeared.
   Of all the groups preparing for presentations, I am the only one who has not integrated yet. I still have to put a keypad to talk to the display directly through the MCU, displaying data first to field 3, then on hitting enter, have the data put onto field 1 with field 3 cleared.
   My project coordinator has strongly suggested that i get to this and put the thing together, given i have still the updated report to submit, plus powerpoint...before the 10th.
    I am starting to think that the vfd controller chip could be faulty so I'm just gonna go ahead and work the LCD which gives me the data for now. Kind of disappointed having taking so long trying to get this thing to work.
    Anyhow, I hope what I've sent covers all you wanted, save the timing diagram channel 7; when the data is on, that's what I'm getting in terms of all the channels the scope is wired up to.
Dave.
7  Using Arduino / Displays / Re: avr to vfd on: November 29, 2012, 12:09:11 am
Tried the alteration you suggested; the same result after upload.


Code:

void initialize() // DIFFERENCE!!!!!!!!!!!!!!INITIALIZATION ROUTINE from Noritake Site
{
 int i = 0;
 for (i=Enable; i <= RS; i++) {
   pinMode(i,OUTPUT);
}
 delay(300);              // initiatize lcd after a short pause needed by the LCDs controller
 
 LcdCommandWrite(0x30);  // function set: 8-bit interface, 1 display lines, 5x7 font
 delayMicroseconds(1);
 
 LcdCommandWrite(0x30);  // function set:8-bit interface, 1 display lines, 5x7 font
 delayMicroseconds(1);
 
 LcdCommandWrite(0x30);  // function set:8-bit interface, 1 display lines, 5x7 font
 delayMicroseconds(1);                       
 
 
 LcdCommandWrite(0x30);  // function set:8-bit interface, 1 display lines, 5x7 font
 delayMicroseconds(1);                       
                                                                 
 LcdCommandWrite(0x0F);  // display control:turn display on, cursor on, blinking
 delayMicroseconds(1);                       
                       
 LcdCommandWrite(0x01);  // clear display, set cursor position to zero 
 delayMicroseconds(200);
 
 LcdCommandWrite(0x80);  // display control:turn display off, cursor off
 delayMicroseconds(1);                       
                     
}
/////////////////////////////////////////////////////////////////////////////
//*******************************************************
void Lcd_gotoxy(unsigned char x, unsigned char y)

 unsigned char firstCharAdr[]={0x80,0xC0,0x94,0xD4};//table 12-5 
 LcdCommandWrite(firstCharAdr[y-1] + x - 1);
 delayMicroseconds(100);
}

//*******************************************************
void Lcd_print( char * str )
{
  unsigned char i = 0 ;
  while(str[i]!=0)
  {
    LcdDataWrite(str[i]);
    i++ ;
  }
}

//*******************************************************
void setup(){
initialize();
Lcd_gotoxy(1,1);      // begin on (0,0) row1
Lcd_print("MERRY CHRISTMAS");
Lcd_gotoxy(1,2);       // begin on (0,1) row2
Lcd_print("MOM!!!");
while (1){};
}
void loop()
{
   
}

8  Using Arduino / Displays / Re: avr to vfd on: November 28, 2012, 11:19:36 pm
pics again.
9  Using Arduino / Displays / Re: avr to vfd on: November 28, 2012, 09:36:52 pm
i tried over and over getting the pics and timing diagram sent for some reason each time kept getting my session timed out or my message sent exceeded 4096kb....sent pics on a word doc and got the same thing.... very frustrating. have to integrate the handheld together in 3wks time with a keypad, and not feeling happy at this point.
10  Using Arduino / Displays / Re: avr to vfd on: November 28, 2012, 09:10:05 pm
K.
[code-68].................................(compiles uploads and gives only one character 's')

#include <util/delay.h>
#include <LiquidCrystal.h>
#include <C:\Users\DAVERENA\Desktop\NOVEMBER 2012\Noritake_VFD_CUU\src\config.h>
#include <C:\Users\DAVERENA\Desktop\NOVEMBER 2012\Noritake_VFD_CUU\src\interface.h>
#include <C:\Users\DAVERENA\Desktop\NOVEMBER 2012\Noritake_VFD_CUU\src\Noritake_VFD_CUU.h>

int RS = 12;
int RW = 11;   
int DB[] = {3,4,5,6,7,8,9,10};
int Enable = 2;
///////////////////////////////////////////////////////////////////////////
void LcdCommandWrite(int value) {
 // poll all the pins
 int i = 0;
 for (i=DB[0]; i <= RS; i++) {
   digitalWrite(i,value & 01);
   value >>= 1;
 }
 digitalWrite(Enable,LOW);
 delayMicroseconds(1);
 // send a pulse to enable
 digitalWrite(Enable,HIGH);
 delayMicroseconds(1);  // pause 1 ms according to datasheet
 digitalWrite(Enable,LOW);
 delayMicroseconds(1);  // pause 1 ms according to datasheet
}
//////////////////////////////////////////////////////////////////////////
void LcdDataWrite(int value) {
 // poll all the pins
 int i = 0;
 digitalWrite(RS, HIGH);
 digitalWrite(RW, LOW);
 for (i=DB[0]; i <= DB[7]; i++) {
   digitalWrite(i,value & 01);
   value >>= 1;
 }
 digitalWrite(Enable,LOW);
 delayMicroseconds(1);
 // send a pulse to enable
 digitalWrite(Enable,HIGH);
 delayMicroseconds(1);
 digitalWrite(Enable,LOW);
 delayMicroseconds(1);  // pause 1 ms according to datasheet
}
///////////////////////////////////////////////////////////////////////////////
void setup () //.................................... DIFFERENCE!!!!!!!!!!!!!!INITIATION ROUTINE from Noritake Site
{
 int i = 0;
 for (i=Enable; i <= RS; i++) {
   pinMode(i,OUTPUT);
 }
 delay(300);// initiatize lcd after a short pause needed by the LCDs controller
 
 LcdCommandWrite(0x30);  // function set: 8-bit interface, 1 display lines, 5x7 font
 delayMicroseconds(1);
 
 LcdCommandWrite(0x30);  // function set:8-bit interface, 1 display lines, 5x7 font
 delayMicroseconds(1);
 
 LcdCommandWrite(0x30);  // function set:8-bit interface, 1 display lines, 5x7 font
 delayMicroseconds(1);                       
 
 
 LcdCommandWrite(0x30);  // function set:8-bit interface, 1 display lines, 5x7 font
 delayMicroseconds(1);                       
                                                                 
 LcdCommandWrite(0x0F);  // display control:turn display on, cursor on, blinking
 delayMicroseconds(1);                       
                       
 LcdCommandWrite(0x01);  // clear display, set cursor position to zero 
 delayMicroseconds(200);
 
 LcdCommandWrite(0x80);  // display control:turn display off, cursor off
 delayMicroseconds(1);                       
                     
}
/////////////////////////////////////////////////////////////////////////////
//*******************************************************
void Lcd_gotoxy(unsigned char x, unsigned char y)

 unsigned char firstCharAdr[]={0x80,0xC0,0x94,0xD4};//table 12-5 
 LcdCommandWrite(firstCharAdr[y-1] + x - 1);
 delayMicroseconds(100);   
}

//*******************************************************
void Lcd_print( char * str )
{
  unsigned char i = 0 ;
  while(str!=0)
  {
    LcdDataWrite(str);
    i++ ;
  }
}

//*******************************************************
void loop()
{   
   setup();
   Lcd_gotoxy(1,1);
   Lcd_print("MERRY CHRISTMAS");
   Lcd_gotoxy(1,2);
   Lcd_print("MOM!!!");
   
   while(1);            
       
}


[/code-68]

Physical interconnections and character display as shown in pics taken.
11  Using Arduino / Displays / Re: avr to vfd on: November 27, 2012, 04:22:25 pm
Here's the vfd physical test results.
12  Using Arduino / Displays / Re: avr to vfd on: November 27, 2012, 03:47:14 pm
These are the scripts. For the third one, changed the delay times for the init routine in accordance with the very helpful Noritake link from Riva; thanks, but i get only an 's' character at (0,0) on the LCD, and still nothing on the VFD. The program also compiled . Saw strong 3V voltages at the filament pins and the expected voltages at the control pins, and some data pins at 5 volts. Also rechecked the vfd to ensure it lights up. Beginning to wonder if, but hoping that it's not, the controlling chip.
13  Using Arduino / Displays / avr to vfd on: November 27, 2012, 06:21:30 am
Hi Don,
It has been quite a while. Apologize for the very long hiatus and am hoping that you haven't given up on me here.
Anyhow, since we last communicated I have since tried to get the 20x4 noritake vacuum fluorescent display (CU20045-UW5A) to work, using an uno, a  2560 and now  a Ruggeduino (equvlt. to uno). I’ve come up with lots of code, also utilizing the routines for the data write and command write that was obtained on the last occasion, together with delays in the init routine I believe should work, uploaded the adjusted program and still the display does not respond. With this code I just obtained  a line of pixels on the LCD. I've recently used modified code from the arduino site for 8 bit mode operation and also incorporated the ‘positional’ feature for placing text data, obtained from source code from the AVR text by Mazidi. This ;combinational' script compiles, uploads and displays information on the 16x2 LCD very well.

Checked the timing diagrams for the uploaded data on a 16 input logic analyzer  looking at when and how data is written relative to the enable and RS, RW pins for the LCD, simultaneously linking the circuit to the vfd which did not respond. The diagrams sort of made sense in that I can see data being written when the LCD enable pin in pulsed and RS is low, when the schematic is captured. I altered the delay times between each instruction in accordance with the max times that each instruction should take, and have not exceeded  them,  compared to those used for the LCD, bearing in mind that the vfd processes information faster than the LCD as shown by the data sheet for the vfd. That said I'm thinking bigger delay times should bring responding as the LCD. Would this have anything to do with altering the timer counter register data structure and prescalar in one of the timer libraries?

I have even tested the vfd grid pins to see if the thing is even working and of the 9 grid pins emanating from the bottom of the display the middle 7 lit up the grids very well, the end 2 nothing! The end filament pins,  were hooked up to 3V supply, with a 14V common negative,  and the positive end of the 14v supply checking each grid pin.

Any suggestions as to what I should read up to point to the solution to this problem would be greatly appreciated at this 11th hr.

Thanks.

P.S: Just have the wires hooked up as I have for testing purposes now, but once program writes, and the display responds, next step would be to alter the program for the display format, interface a keypad to the arduino for the program, and neatly and compactly integrate display, MCU and keypad within the encasing.

14  Using Arduino / Microcontrollers / Re: measuring voltages on: July 05, 2012, 08:20:45 am

Thanks for the suggestion. Must say that I'm the proverbial newbie when it comes to using multiplexer chips. Is there any one in particular that you'd suggest? By 'simultaneously' I mean this: three connectors from the test fixture are attached the board; one is for input voltages, the other mainly supplies the voltages for the power buses of the board, and the third is for the output signals to be measured given simple inputs at any one time.
15  Using Arduino / Microcontrollers / Re: measuring voltages on: July 04, 2012, 12:53:39 pm
Thanks for the response James. Just testing a PCBA inputting 5V dc, +/-12Vdc, and one 5V p-p 4MHz to supply lines through a 25 pr. ribbon to an input connector, and looking to measure the outputs obtained through at a 26 pr. connector port for the board to check for correspondence with a simulation run for the circuit. I know you can measure up to 5 analog input voltages with the atmega328P uno, and was just looking at the specs for the 256 which has up to 16 analog voltage input measurements. So I guess two of these chips might suffice. How best do you think I could measure these? Actually, it seems I may have to check on 29 different voltages at various points on the board.
Pages: [1] 2