No announcement yet.

COM1 and function files

  • Filter
  • Time
  • Show
Clear All
new posts

  • COM1 and function files

    i'm trying to make a fnc file containing a com's devices functions. the functions are made to work with the device on either COM0 or COM1 as set by a constant like:

    #constant jrkPort COM1

    func jrkInit()
    com_SetBaud( jrkPort, 11520);
    to(jrkPort); putch(0xAA);

    func jrkMotorOff()
    to(jrkPort); putch(0xFF);

    If i'm using jrkPort with COM0 it works, if i'm using COM1 it fails. Communication on COM1 is working fine if tested in the main program for example. I even tried "hard wiring" all the functions from the fnc file to permanent use of COM1 but that fails also.

    If I print COM1 constant from within main function or a fnc function i get the same 3496(unsigned) value, so the constant is seen right. It's like there is a compiler problem that fails to access COM1 from functions in fnc files.

    Any ideas, workarounds?

  • #2

    Found my own answer: it was a hardware issue. both uLCD 32PT and P1-EB PCB's have the worst soldered connectors I have seen, the solder points are dry as a desert

    On the P1-EB I had the idea to resolder the connectors but didn't do the same with the main PCB. It turned out the TX pin on J2 connector was floating. Resoldered all connections and all's good now