Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Visual Basic to PIC16f877A

Status
Not open for further replies.

RannieKnows

Junior Member level 1
Junior Member level 1
Joined
Sep 9, 2014
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
107
Good morning! Do you have sample programs/codes that interface Visual Basic to MCU? (PIC16F877A)

The main program will be from VBasic then supporting program code via MIKROBASIC.

Even simple samples will do. I just need to know how that works. (Maybe samples concerning UART/USART for interfacing)

Also open for suggestions regarding programs that interface VisualBasic and PIC16F877A.
Thanks!
 

I think they want a serial terminal not a cross compiler!

I have never used VB (or ever wanted to!) but I think all you have to do is open a serial port as a file and read/write it.

Brian.
 
Yeah thats all. If he have some output files from VB then there should be a c program running on the system will read the file and send it through UART which can be received by microcontroller.

UART through C
 

hi,
This is the simplest VB5 Comms program I have, if you want more complex versions, ask.
It was used for a demo program for an OP wanting to talk to an external modem.
E
Change the CommPort number to suit your PC. Ref 2nd image
 

Attachments

  • ModComm2.zip
    39.5 KB · Views: 100
  • AAesp04.gif
    AAesp04.gif
    4 KB · Views: 114
We are asked to see samples about a visual basic program that will command MCU on what to do.

Something like "Computer Controlled MCU System".


Esp1, yes please. Complex samples are needed too :)
 

hi,
For controlling a remote PIC I use HID USB, programming in Oshonsoft Basic with the USB option.

To communicate between your PC and a PIC, it would be easy to edit the above simple Modem program.
To Send commands to a PIC, add cmd Buttons, like the 'Send "K" to the user interface.
The Read from the RS232 port subroutine already exists in that program.

Do you have any specific commands to send from PC to PIC.? and what response do you expect from the PIC to PC.?
I could modify the above basic program to do that.
E
 
Batang, Visual Basic 6 or up

- - - Updated - - -

I can't open the modcomm application and I can't open the program code.


I am using Visual Basic 6.0.

Thanks for guiding me. I hope you could assist me on how I can manage this.
 

Hi Rannie,
The zip file contents seem to have become corrupted,:?: I will look for the original files and after checking, repost.
E
 

Do you want PC to MCU UART communication or USB HID communication. I can help you with VB.Net code for both Serial Communication and USB HID Communication. For USB HID Communication I will use EasyUSBHIDNetClass.dll
 

hi rannie,
I have modified the program for you, tested and re-zipped.
You must unzip the files before use.

All the files and and a exe file are in the zip.

If you have a problem, ask.

E
 

Attachments

  • VB5Comm1.zip
    9.7 KB · Views: 88

Our professor lend us his USB to UART, we also have our MCU (PIC16F877A). The program we needed to burn in the MCU appears to be a select case multiprogram. And the purpose of Visual Basic(of any kind) is to send the data or passcode to the MCU to output the needed sequence.

Sorry if I'm being to wordy. Not used to this.

Example: We will have textbox and command button on visualbasic. If we write RUNNINGLIGHTS on the textbox, and click the command button. THE MCU must have the LED running lightsequence on PORTD.

Other samples:
Blink
Temp (FOr outputting temperature on LCD)
Seven (for seven segment diplay wherein if we press rc0, seven segment will output 1)
etc.

THANK YOU FOR YOUR HELP. I already know the codes for the above samples. What I don't know is the interfacing and the right coding for VB and Mikrobasic such that they will work together if I use USB to serial.

GOD BLESS YOU!
 

Yes, you can use USB to Serial adaptor and write VB6 MSCOMM code. VB.Net can also be used. You jsut sent the strings like, "BLINK", "RUNNING LIGHTS" etc.. to MCU through Serial interface (or USB to serial). On receiving serial data to a buffer in ISR the MCU will check what command is received and depending upon the command the respective function like blink(), runningLights() is executed till another different command is received.
 
hi rannie,
You could send a text string from the PC to PIC as 'milan' suggests, but the method I have used is to label the GUI buttons in VB in a way that the user can understand and then transmit a 'control' character to the PIC when the user presses the command button.

eg:
Button label: 'Set Blink ON', when pressed sends say, hex code 01 followed by CR LF,,,the PIC echo's the string back to the PC.
On receiving the echoed string, VB changes the label to: 'Set Blink OFF'.
The PIC program decodes the hex 0x01 as a Blink ON command.

If 'Set Blink OFF' is pressed, send say, hex code 02 followed by CRLF.

E
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top