View previous topic :: View next topic |
Author |
Message |
helmi03
Joined: 12 Apr 2011 Posts: 7
|
Help please when i transmit data to PC i receive unknow form |
Posted: Sat Apr 16, 2011 1:43 pm |
|
|
hi i have a problem when i transmit data from my pic16F877 to the pic.
I receive a unknown format of data. This picture show my terminal and the virtual terminal receive
http://img859.imageshack.us/i/shema.png/ |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9249 Location: Greensville,Ontario
|
|
Posted: Sat Apr 16, 2011 2:00 pm |
|
|
Is this a REAL circuit or just a simulation ?
We'll need to see your code, compiler version, and PIC type.
If it's all 'virtual' ie: NOT real hardware, I can't help. NO simulator works correctly and I will not waste my time trying to debug 'virtual' code on a 'virtual' machine. |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Sat Apr 16, 2011 7:15 pm |
|
|
One obvious error in the schematic is the connection of C3. This is now in series with the line to ground for the MAX232. Just remove it, in simulation you can assume the power supply to be perfect. Make VS- a direct connection to GND.
Other possible errors are hard to tell without an example program and compiler version number. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9249 Location: Greensville,Ontario
|
|
Posted: Sat Apr 16, 2011 7:48 pm |
|
|
arrgh...simulators..
Looked at the 'schematic' and it's NOT a real circuit, just a simulation..
Glaring error on the DE-9 connector. It's wired wrong (if I assume a 'straight though cable as nobody makes there own these days), so a real PC would never see data...pins 2 and 3 wrong, 5 (ground) NOT connected to PIC ground, though the simulator doesn't care, I do, and more importantly the PIC does! Guess the simulator doesn't have a 'design rule check' routine.
As for the PIC, no xtal, xtal caps, pullup on *MCLR, power pins aren't connected.. Again, the simulator doesn't care, but the PIC in the real world does !
MAX232 needs another cap...org. design has 4...always 4...
That's some of the problems with simulators...you can 'wire' the PIC up on the screen and it works(?) even though in the real world it'd just sit there looking at you !!!
I wonder how many hours(days ?) are wasted trying to debug a simple circuit like this.2 chips,3 caps one connector,10 lines of code?Guess I'm cynical after 35+ years of making a living in the field. |
|
|
|