FT232 avr eeprom how to programming?

Hello
I need some software.
FT232RL 1. His pin goes to pin atmega328 's number 30.
FT232RL 5. His pin goes to atmega328 's number 31 pin.
FT232RL 4. Pini is going to atmega328 's pin 29 over 7.5 k resistance.

I would like to program the Atmel 328 EEPROM field with the USB port with this link.

I need software that does this job.

Reading Serial Port and Plotting with Chart.

Hello people :)

So I'm still struggling and any advice is much appreciated.
I'm trying to read a serial port data from a controller and plot it using chart. I could read the data from the controller and see the data in a textbox earlier. Now I'm trying to use a chart along with the textbox. There are complication when I'm trying to use both together. I get an exception because I'm trying "data = sp.ReadLine();" for chart. I'd like to keep the textbox just to verify what I'm plotting, but I understand that I can also do that using putty. There's no response even when I use only the chart to plot. And I cannot pin-point the problem. Because to my understanding I think I have followed the steps to establish it, but then I'm failing anyway! Please do have a look at what I have tried so far and please do let me know if I'm doing something wong.

Chart and Form1 [code] namespace Serial_receive { public partial class Form1 : Form { string t; SerialPort sp; double rt = 0; //Boolean i = false; private string data; private DateTime datetime; public Form1() { InitializeComponent(); Control.CheckForIllegalCrossThreadCalls = false; // User can already search for ports when the constructor of the FORM1 is calling // And let the user search ports again with a click // Searching for ports function SearchPorts(); } private void Form1_Load(object sender, EventArgs e) { comboBox1.DataSource = SerialPort.GetPortNames(); timer1.Start(); Text = "Serial Channel to FRDM-KW40Z"; } private void TextBox1_TextChanged_1(object sender, EventArgs e) { } private void timer1_Tick(object sender, EventArgs e) { rt = rt + 0.1; } private void chart1_Click_1(object sender, EventArgs e) { ChartArea CA = chart1.ChartAreas[0]; // quick reference CA.AxisX.ScaleView.Zoomable = true; // see small button on the horizontal scroll for reset?? CA.CursorX.AutoScroll = true; CA.CursorX.IsUserSelectionEnabled = true; // var dataBlocks = data.Split('\n'); foreach(var block in dataBlocks) { var numbers = block.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); rt += 100; //some time interval for (int i = 0; i<numbers.Length; i++) { double n = double.NaN; //represents a value that is Not a Number. Field is constant bool ok = double.TryParse(numbers[i], out n); if (ok) chart1.Series[i].Points.AddXY(rt, n); else { int p = chart1.Series[i].Points.AddXY(rt, n); chart1.Series[i].Points[p].IsEmpty = true; Console.WriteLine("well shoot! try again.."); } } } }[/code] Combox1 for listing available ports and connecting [code] private void button1_Click_1(object sender, EventArgs e) { //comboBox1.Items.Clear(); SearchPorts(); } void SearchPorts() { string[] ports = SerialPort.GetPortNames(); foreach (string port in ports) { comboBox1.Items.Add(port); } } private void comboBox1_SelectedIndexChanged_1(object sender, EventArgs e) { if (sp == null || sp.IsOpen == false) { OpenCloseSerial(); } } private void button2_Click_1(object sender, EventArgs e) { // Catch exception if it will be thrown so the user will see it in a message box OpenCloseSerial(); } void OpenCloseSerial() { try { if (sp == null || sp.IsOpen == false) { t = comboBox1.Text.ToString(); sErial(t); button2.Text = "Close Serial port"; // button text } else { sp.Close(); button2.Text = "Connect and wait for inputs"; // button text } } catch (Exception err) // catching error message { MessageBox.Show(err.Message); // displaying error message } } void sErial(string Port_name) { try { sp = new SerialPort(Port_name, 115200, Parity.None, 8, StopBits.One); // serial port parameters sp.DataReceived += new SerialDataReceivedEventHandler(DataReceivedHandler); sp.Open(); } catch (Exception err) { throw (new SystemException(err.Message)); } } [/code] Textbox and chart data and saving data as text file; [code] private void DataReceivedHandler(object sender, SerialDataReceivedEventArgs e) { if (e.EventType == SerialData.Chars) { if (sp.IsOpen) { string w = sp.ReadExisting(); if (w != String.Empty) { Text += "\r\n"; Invoke(new Action(() => TextBox1.AppendText(w))); } } } data = sp.ReadLine(); chart1.Series["Data1"].Points.AddXY(rt, data); Invoke(new EventHandler(displayData_Event)); } private void displayData_Event(object sender, EventArgs e) { datetime = DateTime.Now; string time = datetime.Day + "/" + datetime.Month + "/" + datetime.Year + "\t" + datetime.Hour + ":" + datetime.Minute + ":" + datetime.Second; //data.AppendText(time + "\t" + data + "\n"); } private void button3_Click_1(object sender, EventArgs e) { SaveFileDialog saveFileDialog1 = new SaveFileDialog(); saveFileDialog1.InitialDirectory = @"C:\Users\varman\Documents\"; saveFileDialog1.Title = "Save text Files"; saveFileDialog1.CheckFileExists = true; saveFileDialog1.CheckPathExists = true; saveFileDialog1.DefaultExt = "txt"; saveFileDialog1.Filter = "Text files (*.txt)|*.txt|All files (*.*)|*.*"; saveFileDialog1.FilterIndex = 2; saveFileDialog1.RestoreDirectory = true; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { File.WriteAllText(saveFileDialog1.FileName, TextBox1.Text); TextBox1.Text = saveFileDialog1.FileName; } } } }[/code] Thank you very much for your time. Good day.

Cheers,

Ram.

Plotting serial port data using zedgraph (data vs time)

Hello,
I'm trying to plot the data read from a serial port using zedgraph. I'm still learing to code so I couldn't deduce why the plot does not work. Please have a look at the code and advice.
To open and read from a serial port, I use a combox and a couple of buttons (and then later I try to save it to a text file).
The plot does not function! I can't quite guess why. Please tell me if there's mistakes in my approach or the code. [code] //zedgraph namespace WindowsApplication2 { public partial class Form1 : Form { string t; SerialPort sp; Thread m_thread; bool m_running = false; ManualResetEvent m_event = new ManualResetEvent(true); bool m_pause = false; private GraphPane myPane; public Form1() { InitializeComponent(); Control.CheckForIllegalCrossThreadCalls = false; // User can already search for ports when the constructor of the FORM1 is calling // And let the user search ports again with a click // Searching for ports function SearchPorts(); CreateZedGraph(); //error : Severity Code Description Project File Line Suppression State //Error CS7036 There is no argument given that corresponds to the required formal parameter //'w' of 'Form1.DrawPoint(ZedGraphControl, int, PointPair)' } // start button private void btnStart_Click(object sender, EventArgs e) { if (m_thread == null || m_thread.IsAlive == false) { ClearGraph(); m_thread = new Thread(Process); m_thread.Start(); } } void Process() { PointPair point = new PointPair(); btnStart.Enabled = false; btnStop.Enabled = true; m_running = true; while (m_running == true) { m_event.WaitOne(); point.Y = Convert.ToDouble(serialPort1); point.X++; //time instance of measurement?? DrawPoint(zed1, point); ssData.Value = point.Y.ToString(); RefresheZedGraphs(zed1); Thread.Sleep(700); } btnStart.Enabled = true; } private void CreateZedGraph(object sender, SerialDataReceivedEventArgs e, ZedGraphControl zgc) { myPane = zgc.GraphPane; // axes stuff myPane.Title.Text = "FRDM-KW40z serial Test"; myPane.XAxis.Title.Text = "Time"; myPane.YAxis.Title.Text = "Voltage"; myPane.XAxis.MajorGrid.IsVisible = true; myPane.YAxis.MajorGrid.IsVisible = true; myPane.XAxis.MinorGrid.IsVisible = true; myPane.YAxis.MinorGrid.IsVisible = true; // data from serial port PointPairList list = new PointPairList(); zed1.GraphPane.AddCurve("Test", list, Color.Red); } //serial port data collection private void button2_Click(object sender, EventArgs e) { comboBox1.Items.Clear(); SearchPorts(); } void SearchPorts() { string[] ports = SerialPort.GetPortNames(); foreach (string port in ports) { comboBox1.Items.Add(port); } } private void button3_Click(object sender, EventArgs e) { // Catch exception if it will be thrown so the user will see it in a message box OpenCloseSerial(); } void OpenCloseSerial() { try { if (sp == null || sp.IsOpen == false) { t = comboBox1.Text.ToString(); sErial(t); button3.Text = "Close Serial port"; // button text } else { sp.Close(); button3.Text = "Connect and wait for inputs"; // button text } } catch (Exception err) // catching error message { MessageBox.Show(err.Message); // displaying error message } } void sErial(string Port_name) { try { sp = new SerialPort(Port_name, 115200, Parity.None, 8, StopBits.One); // serial port parameters sp.DataReceived += new SerialDataReceivedEventHandler(DataReceivedHandler); sp.Open(); } catch (Exception err) { throw (new SystemException(err.Message)); } } private void DataReceivedHandler(object sender,SerialDataReceivedEventArgs e) { // This below line is not need , sp is global (belongs to the class!!) //SerialPort sp = (SerialPort)sender; if (e.EventType == SerialData.Chars) { if (sp.IsOpen) { string w = sp.ReadExisting(); if (w != String.Empty) { Invoke(new Action(() => Control.Update(w))); } } } } private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { if (sp == null || sp.IsOpen == false) { OpenCloseSerial(); } } [/code] I get an error at : Invoke(new Action(() => Control.Update(w))); when trying to update the graph so that I can save after that.

I again have an error at: DrawPoint(zed1, point);

I think zedgraph is too much for me right now. I'm thinking of replacing it with charts if I still struggle. But I'd love to hear your advise.
Thank you all for your time. Good day.

Cheers,
Ram.

Visual basic 2015 and Access database.

Hi

How to create an database application in Visual basic 2015 using Access Database. I want to add following functionality:

1. Text Boxes on form to show ,update delete and add records.

2.Search records.

Images resize

Hey guys.

I am using a higher resolution than what I coded at. It stretches the content. Can I set my buttons, pictureboxes to not adjust in anyway other than coding a calculating of each element and resizing based on screen size? I don't usually change the anchor settings. Is that necessary to keep them from adjusting?

Array.IndexOf help

Here is my code

Dim jb As Integer
Dim ksks() As Single = {40, 50, 50, 6, 7, 8, 50}
jb = Array.IndexOf(ksks, 6)

Debug.Print(jb)

jb returns -1 no matter what number I use that is clearly in the array.

VB.net: How do I retrieve a file's directory location from a checkedlistbox within a loop function?

Okay, what I have is a program that reads from 2 selected folders. The way it works is by means of 2 separate "Browse" buttons that utilizes it's own folder browser dialog function. upon selecting the first folder, the folder contents populate a checked list box. the same goes for the second "Browse" button. However, the second button will populate not only the folder contents, but all sub-files as well.

Check box list 1(Folder 1/Selected from button1)

AB01.dwg
BA01.dwg
CA01.dwg
DA01.dwg
Check box list 2(Folder 2/selected from button2)

Folder 3(not seen in list)

Panels AB01.dwg
Folder 4(not seen in list)

Rake BA01.dwg
Folder 5(not seen in list)

Rafter CA01.dwg
Folder 5(not seen in list)

Column DA01.dwg
Now, I have 2 functions in the code. One looks for the name from list 1 and copies/renames the file with name from list 2 if the name from list 2 contains the same characters from list 1.
[code] Function FindListBox2ItemThatContains(ByVal listBox1FileName As String) As String For i As Integer = 0 To ListBox2.Items.Count - 1 If ListBox2.Items(i).Name.Trim.toupper.Contains(listBox1FileName.Trim.ToUpper) Then Return ListBox2.Items(i).Name.trim End If Next Return "" End Function[/code] next, i have a third button that runs the code, and copies/pastes the new files into location using the file from list 1 and renames it with the file from list 2. the saved location used to be specified by the user, but now i need the code to just overwrite the file from list 1 in it's current location. Here's the existing loop function...(note: the new path hasn't been finalized yet because i don't know how to code for it.
[code]For Each file As IO.FileInfo In ListBox1.CheckedItems Dim NewFileName As String = FindListBox2ItemThatContains(file.Name) If NewFileName.Trim.Length > 0 Then IO.File.Copy(file.FullName, IO.Path.Combine(FBD2.SelectedPath, "item parent folder", NewFileName.Trim), True) ProgressBar1.Increment(+1) Next[/code] how do i retrieve the file location from list 2, and save the new file in that location?

[img]https://social.msdn.microsoft.com/Forums/getfile/1011313[/img]

how to use linq group by in dataset

hi ;

I have a dataset that filled the below query

SELECT FIELD1,FIELD2,FIELD3,FIELD4

I want to group by that query according to FIELD4

Thanks from now .

Email sending a duplicate

Hello

My SMTP code sents an email and a duplicate to the user at exactly the same time (so he receives two emails). To try to eliminate this duplicity, I have placed a breakpoint here in my vb.net SMTP code:
[code]Smtpserver.Send(myMessage)[/code] and then pressed F5. That loaded up my Web page (dimadayoub.net/forgot.aspx) which I then closed and then, from the menubar, selected 'Step into'. I am not quite sure what I am looking for (or where to look for it), but there is a list in the Locals pane, nothing in the Watch pane and, in Call stack, I see Global code [forgot.aspx] Line 104 and Language: Script. In the Command pane, I see an inexplicable lonely a right-pointing arrow and nothing else, nothing in the Immediate window, and in Output, under JavaScript Language Service, I get this:

12:07:42.5488: Referenced file '~/Scripts/_references.js' not found.

And yet, in the Scripts folder in Solution Explorer (VS 2013 Express), I can see the _references.js.

Any advice would be welcome.

Thank you.

How to call an action of the server, from a web page

I've developed a web project that works on an ms sql server database. The problem is caused by the fact that i have to sincronize some my table using an oracle view that i can see from my web server.

I've developed a dll that do this for me, and when i call it from the browser of my web server it works fine, but otherwise from other browser in the lan it doesn't works.

The main action in the dll that i suspect can create problema are:

1) i open a connection with the ms sql DB, this is the same connection of the main program, so i don't think is the point

2) i open a log file in "C:\Users\Public\Documents\". i'm not sure this is allowed to the program, maybe this is the point?

3) i create an ODBC connection to oracle :

serv = CreateObject("ADODB.Connection")
Dim prov As String = "DSN=PAI;Uid=PAI;Pwd=PAI2016;"

All works fine if i open my program from the broser of my server, but it doesn't works from other clien!

thanks for any suggestion!
Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir