please i need help in a project

Thread Starter

kbibi99

Joined Apr 19, 2012
9
Hello,
I did a project in IT industry.
I created a software with vb.net 8 and an electronic circuit based on PIC 16F877
which is programmed with micropascal and the program is included in the attachments with a simulation With isis 7.7 but this project does not work
please help me
sorry for the language

 

Attachments

spinnaker

Joined Oct 29, 2009
7,830
People will help you if they can and when they have time. People are not going to help you if you don't want to help yourself.

"Does not work" doesn't tell anyone anything. You are going to have to provide a lot more details of what in your code is not working and what problems you are seeing.

No one is going to unzip your project and start debugging it. Most people don't even have isis 7.7.

Please provide FULL details of your issue.
 

panic mode

Joined Oct 10, 2011
2,761
suppose you see post:
" i did home project using material from hardware store but it does not work. please help..."

what can you do to offer help? do you see any problem? think about it.

now ask yourself what programs everyone else has. do you think EVERYONE uses micropascal and proteus? probably not. most of people are going to see clutter of 28 files that they don't know what to do with. would you like me to post reply using binary files generated by RSLogix, and EPlan? i don't think so...

so if you want help, you need to help us. when you post some files, post the essentials and in a form that everyone can see. for example "cds.mpas" can be read by notepad or better - you should have posted it directyl in the message body using CODE tag. your schematic and PCB should be posted as images. nobody will have problem viewing standard image file.

other thing is description. what is your project supposed to do? "I did a project in IT industry" is actually wrong statement. you didn't finish it, you are still working on it.

your exe file crashes after displaying image of siren. your cds.mpas file tristates bunch of ports, including port B. do you know what tristate means?
 

Thread Starter

kbibi99

Joined Apr 19, 2012
9
i'm sorry
i'm a new member in this forum and i don't know how i post a thread
ok this is the source in micropascal

program cds;
{ Declarations section }
const temp_sirene = 4000;
var receive : byte;

begin
{ Main program }
trisa := 0;
trisb := 0;
trisd := 0;
trise := 0;
porta := 0;
ADCON1 := 7;
portb := 0;
portd := 0;
porte := 0;
UART1_Init(9600); // Initialize UART module at 9600 bps
Delay_ms(100); // Wait for UART module to stabilize
while (TRUE) do // Endless loop
begin
if (UART1_Data_Ready() = 1) then // If data is received,
begin
receive := UART1_Read(); // read the received data,
UART1_Write('T'); // and send data via UART
if receive = 71 then begin
portb := 0xFF;
delay_ms (temp_sirene);
portb := 0;
end;
end;
end;
end.
and this is 2 functions in VB 8 the first is for connection RS232
and the second is to compare the time entered by the user with the computer's time and are equal if it sends data to the microcontrollers to enable portb

Private Function com(ByVal veri As Byte) As Boolean
Dim ver As Boolean
Try
SerialPort1.BaudRate = 9600
SerialPort1.PortName = Port_Com.Text
SerialPort1.DataBits = 8
SerialPort1.Parity = IO.Ports.Parity.None
SerialPort1.StopBits = IO.Ports.StopBits.One
SerialPort1.Open()
SerialPort1.ReadTimeout = 500
If veri = 1 Then
SerialPort1.Write("G")
ver = False
If SerialPort1.ReadByte() = 84 Then
ver = True
End If
Else
SerialPort1.Write("V")
ver = False

If SerialPort1.ReadByte() = 84 Then
ver = True
End If
End If

SerialPort1.Close()

If ver Then

Conn_tool.ForeColor = Color.Green
Conn_tool.Text = "Connecté "
Return True

Else

Conn_tool.ForeColor = Color.Red
Conn_tool.Text = "Pas de connexion "
Return False

End If
Catch

Conn_tool.ForeColor = Color.Red
Conn_tool.Text = "Pas de connexion "
Return False

End Try

End Function
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ToolStripStatusLabel2.Text = Now.ToLongTimeString



If Not (conn.Text = "Commencer") Then

Dim rows_count As Integer = DataGridView1.RowCount()
Dim now_hour As String = Now.ToShortTimeString




If rows_count > 0 Then

For i As Integer = 0 To rows_count - 1

If DataGridView1.Item(0, i).Value = now_hour And DataGridView1.Item(2, i).Value = "TRUE" Then
Dim d As Boolean = com(1)

If d Then
DataGridView1.Item(1, i).Value = "Succes"
DataGridView1.Rows(i).DefaultCellStyle.BackColor = Color.LightGreen
DataGridView1.Item(2, i).Value = "FALSE"

Else
DataGridView1.Item(1, i).Value = "Echec"
DataGridView1.Rows(i).DefaultCellStyle.BackColor = Color.Red
DataGridView1.Item(2, i).Value = "FALSE"

End If
End If

Next



End If
End If
End Sub
 

panic mode

Joined Oct 10, 2011
2,761
which part does not work?

i would use nulmodem and terminal to verify that VB app can send and receive data. I don't speak French but if I understand screenshots, it looks like you did just that and you can send and receive single character but I don't know what was on the other end of connection (PIC or VB?).
I am guessing it is VB because terminal seem to emulate PIC responses.

Can you do the same with PIC? I suspect problem may be here...

Btw, where in your Pascal code you specify PIC16F877 as target?

You still didn't answer about configuration of the ports. I have no experience with PIC16F877 but it does not look like portC is configured for USART (RC6 and RC7 are Tx/Rx of the PIC).

what exactly does following line:
Rich (BB code):
UART1_Init(9600); // Initialize UART module at 9600 bps
i can see baud rate but nothing else (parity, data bits, stop bits) but does it configure port C for USART as well?
 

panic mode

Joined Oct 10, 2011
2,761
you must have a serial port com for eliminate the crash
that is not very good. i didn't even try to select port or establish connection. even if i did, it still should not crash, it should trap the error and display a message or something. perhaps this is meant to come later?
 
Last edited:

Thread Starter

kbibi99

Joined Apr 19, 2012
9
which part does not work?
what exactly does following line:
Rich (BB code):
UART1_Init(9600); // Initialize UART module at 9600 bps
i can see baud rate but nothing else (parity, data bits, stop bits) but does it configure port C for USART as well?

UART1_Init Configures and initializes the UART module.
The internal UART module module is set to:

  • receiver enabled
  • transmitter enabled
  • frame size 8 bits
  • 1 STOP bit
  • parity mode disabled
  • asynchronous operation

 

Thread Starter

kbibi99

Joined Apr 19, 2012
9
which part does not work?

i would use nulmodem and terminal to verify that VB app can send and receive data. I don't speak French but if I understand screenshots, it looks like you did just that and you can send and receive single character but I don't know what was on the other end of connection (PIC or VB?).
I am guessing it is VB because terminal seem to emulate PIC responses.
have you verified that the program vb Can Send and Receive data?
 
Top