[SOLVED !] Strange KOS-108 Display results


Closed Thread
Results 1 to 6 of 6

Thread: Strange KOS-108 Display results1289 days old

  1. #1
    ashleyb
    Guest ashleyb's Avatar

    0 Not allowed!

    Default Strange KOS-108 Display results

    Hi there

    As you know, I haven't been on here for a while!

    I have a strange phenomenon occurring and I wonder if the experts can help please.

    I have successfully used the Samsung 128x64 graphic displays for ages and I recently changed models to the super blue and white displays. The data sheet shows exactly the same connections to the display and when I use it and send graphics only to it, it works fine except that the CLS command does not clear the screen.

    If I use it by writing to individual lines, i.e.

    Print At 1,0," "
    Print At 2,0," "
    Print At 3,0," "
    Print At 4,0, " "

    It only ever prints the last line and it always prints it at the top of the screen (Print At 4,0, " ")

    The CLS command again does not work.

    I have always used the following for the Samsung display that works fine although I had to swap the two display halves for the new display by changing the CS1 and CS2 pins around.

    LCD_CS1Pin = PORTE.1 LCD_CS2Pin = PORTE.2

    '----------------------------------------------------------------
    'Setup for Samsung graphical display
    '----------------------------------------------------------------
    LCD_DTPort = PORTD
    LCD_RSPin = PORTC.2
    LCD_ENPin = PORTE.0
    LCD_RWPin = PORTC.1
    LCD_CS1Pin = PORTE.2
    LCD_CS2Pin = PORTE.1
    LCD_Type = GRAPHIC
    Internal_Font = On


    Any help would be appreciated, thanks... Ash

    OK guys, after reading some other old posts on here , I have found the problem! Well, I still don't really know what the problem is but at least I have seen a work around by issuing the declare
    • Declare GLCD_CS_INVERT On, the problem has gone..

      Cheers, Ash



    Last edited by ashleyb; 14th November 2016 at 06:36.

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Prolific Poster John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,884
    Thumbs Up
    Received: 91
    Given: 34
    Total Downloaded
    4.60 GB

    0 Not allowed!

    Default Re: Strange KOS-108 Display results

    Welcome back Ash. Glad you found a workaround, I had no idea on a solution 😉
    John

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    ashleyb
    Guest ashleyb's Avatar

    0 Not allowed!

    Default Re: Strange KOS-108 Display results

    Hi John

    Thanks, yeah, i'm still here but projects are few and far between.

    I am now looking for some sample code to decode MAVLINK messages if you or anyone else can help? Mavlink consists of a packet of 17 Bytes,(starting at 0) a header of 6 bytes, a payload of 9 bytes and a check sum of 2 bytes. I have no idea how to start but if someone has any code to get me going, I would really appreciate it as it's a steep learning curve.

    I have tried briefly modifying Les's code for GPS parsing but getting no where.

    Cheers

    Ash

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    Prolific Poster hadv215's Avatar
    Join Date
    Sep 2009
    Posts
    1,136
    Thumbs Up
    Received: 66
    Given: 26
    Total Downloaded
    3.61 GB

    0 Not allowed!

    Default Re: Strange KOS-108 Display results

    A little bit more information would be helpful.
    E.g. are there any separators?
    What are the fields in the packet? What are their sizes and datatypes.
    The reason to know this is how to interpret/convert the packet.
    A checksum of 2 bytes for such a small packet sounds like overkill. What algorithm is used?

    The easiest way would be to define a 17 byte string to contain the message.
    After that fields may be isolated by using variables of the datatype needed and populating these with the bytes in the string.
    In the case the fields are not of fixed length and the message contains separators there are simple functions to isolate the various fields.

    Let me know, I have lots of samples.

    Regards
    Harm

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  9. #5
    Fanatical Contributor Tim's Avatar
    Join Date
    Jan 2003
    Posts
    7,748
    Thumbs Up
    Received: 51
    Given: 96
    Total Downloaded
    1.32 GB

    0 Not allowed!

    Default Re: Strange KOS-108 Display results

    When I de code packets its all basically done in an interrupt. I have code somewhere just not available right now.

    These are the fundamentals

    1 What decides if its a new packet? Is it the 6 byte packet header?
    2 Set up a state machine Using Select Case etc
    Case 0 is waiting for the start data if its a 6 byte header then you will need to have a another sub case where you look for each of the 6 bytes one at a time. Incrementing the state 1 if you get the right byte and resetting the local state to 0 if its wrong.
    3 When you get all the right bytes of the header then you increment the main state to collect the main data. Keeping a count. When you get all the data increment the main state.
    4 Collect the checksum bytes
    5 Set flag so main prog knows to check the CRC and do what ever it needs with it.
    6 Main prog resets the Main state.

    Thats basically it.

    I will post some code from a program when I get a chance showing the interrupts
    Tim

  10. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  11. #6
    ashleyb
    Guest ashleyb's Avatar

    0 Not allowed!

    Default Re: Strange KOS-108 Display results

    Thanks for the replies chaps. Here is an extract of the spec for MAVLINK which seems to start always with a header of '0xFE'

    I'd like to decode some of the string parts to use a graphic display to view the aircraft data such as battery voltage, distance from home etc. not to implement the whole mavlink control and monitoring system. If I could only get started then I'd be on my way. There is some example code in "C" to show how to generate a checksum.

    def message_checksum(msg):
    '''calculate a 8-bit checksum of the key fields of a message, so we
    can detect incompatible XML changes'''
    crc = mavutil.x25crc(msg.name + ' ')
    for f in msg.ordered_fields:
    crc.accumulate(f.type + ' ')
    crc.accumulate(f.name + ' ')
    if f.array_length:
    crc.accumulate(chr(f.array_length))
    return (crc.crc&0xFF) ^ (crc.crc>>8)




    And the packet data:...


    Example Packet (Heartbeat)
    packet length = 17 (6 bytes header + 9 bytes payload + 2 bytes checksum)

    hdr len seq sys cmp id payload (len 9)------------------ crc---
    0 1 2 3 4 5 6 7 8 9 a b c d e f 10
    FE 09 4E 01 01 00 00 00 00 00 02 03 51 04 03 1C 7F

    Fixed Header (6 octets)
    0. packet header, always 0xFE
    1. message length (9)
    2. sequence number -- rolls around from 255 to 0 (0x4e, previous was 0x4d)
    3. source system - what system is sending this message (1)
    4. source component - what component of the system is sending the message (1)
    5. message ID (0 = heartbeat)

    Variable Sized Payload (specified in octet 1, range 0..255)
    06-0e. payload

    Packet Checksum
    0f-10. CRC25

    In common use (single aircraft, single autopilot), source component and systems will be (1,1)



    Example Command and Payload

    Command (octet 5) = 0, Heartbeat

    Parms (octets 06-0e):
    06-09. custom_mode = 00
    0a. mav type = 2 (quadrotor)
    0b. autopilot = 3 (ardupilot mega)
    0c. base_mode = 0x51 = 0b01010001 (manual input, stabilized, custom mode)
    0d. system_status = 4 (active, motors engaged)
    0e. self.mavlink_version = 3

    The parameter ordering can be confusing if you look at the XML specification, since for efficiency the parameters are not sent in the order they are listed, but are reordered as specified here.

    type uint8_t Type of the MAV
    autopilot uint8_t Autopilot type / class
    base_mode uint8_t System mode bitfield
    custom_mode uint32_t Autopilot-specific bitfield
    system_status uint8_t System status flag
    mavlink_version uint8_t_mavlink_version MAVLink version

    I might be taking on too much but as I said, if I can just get started....:-)

  12. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. ASM Error [108]
    By gtv_pic in forum Proton Plus Compiler v3
    Replies: 4
    Last Post: 27th May 2019, 21:12
  2. Strange characters on LCD display
    By NEX in forum Proton Plus Compiler v3
    Replies: 3
    Last Post: 15th March 2016, 08:54
  3. Averaging results for display on a graph
    By Tim in forum The Lounge
    Replies: 3
    Last Post: 8th January 2016, 11:17
  4. [SOLVED !] LCD display strange Reset!!
    By alexzupo in forum Labcenter Proteus VSM
    Replies: 9
    Last Post: 16th October 2007, 19:03

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts