Jump to content

Onka

EstablishedMember
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Onka

  • Rank
    Newbrie
  1. Well I needed the `break` anyway and, Reynard, Your idea works perfectly well. I set 10ms timing and other chip understood it, so all this was Not just a waste of time&space Thanks again for Your input !
  2. Sorry guys My fault, there was no problem with uart break, just that lmx module was not supposed to do/answer anything. But thanks for the ideas anyway
  3. Just a thought, are you sure you have the tx line in the correct state for a break?I seem to remember from a long time ago that RS232 (assuming thats what you are using) can be a little confusing as there normally inversion in the line drivers. The normal state for tx is the marking state (or 1 state) which is a negative voltage. A break in transmission is indicated by holding the tx line in the logic zero state which is a positive voltage (not sure for how long). Regards Dave Thanks for sharing, Dave. There are no `negative voltage levels` involved here. I didnot mentioned before, but I am able to send/receive data successfully. Other uart device is National`s lmx9838 chip. Oh and i am using `rs232_driver.h` routines.
  4. No luck so far. I even tried different (2M+3) timings from 165us to 10ms; no positive results at all. Id love to think that other device isnt responding properly to uart_break, but i believe this is not the case. Also I read that the break timing must be greater than 2M+3; so how long it should be really ? Does 10ms instead of 165us (115kbaud) sound ok ?
  5. Hi there. Im using pic 16f628a at 4 mhz with 9600 baud rate and would like to send `break` signal over the tx line, portb.2 that is. Unfortunately, holding this bit low and high again for certain period of time seems not to work - device im sending it to must `react` to this `break` - and since it doesnot im taking it as `break` send failure. Since im doing this right after uart initialisation, there is no data flow yet, so no worry about that. p.s. thanks guys for explaining those built-in pullup resistors in other topic , that was really helpful ! had no time to thank You:)
  6. Hi ! Im new to PIC programming and here goes my headache : as topic says im trying to use PIC 16F628A to detect a push-button being pressed, which (when pressed) just lowers corresponding IC pin to ground without any pullup or pulldown resistors involved. This means that when button is not pressed, corresponding IC pin is "floating", not connected to anything. Problem is - I get random activity even if i dont push the button - i dont actually have to touch it. I know that there is a way to read info properly since i have taken schematics from a real world example. Maybe there are some config bits i missed ? Anyway here goes the code which is running fine if i use those pullup/pulldown resistors. #include <system.h> #pragma CLOCK_FREQ 4000000 #pragma DATA _CONFIG, _XT_OSC & _PWRTE_ON & _LVP_OFF & _MCLRE_OFF & _WDT_OFF &_CP_OFF & _BODEN_ON void flash (int cnt) //function to flash a LED, cnt times { porta.1=0; for (int k=0; k<cnt; k++) { porta.1=1; delay_ms(200); porta.1=0; delay_ms(200); } } void main() { cmcon = 7; // set analog comparators off // output bit trisa.1 = 0; // input bits trisa.5 = 1; //trisb.3 = 1; trisb.5 = 1; while( 1 ) //endless loop { if (!porta.5) {flash(1);} // this is connected via pullup resistor to +5v all the time if (!portb.5) {flash(2);} // this one is left just floating. if i comment this line out, i get proper response from porta.5 button presses } }
×
×
  • Create New...