Menu

Emic 2 on 90S8515

Help
2018-12-22
2018-12-22
  • Bertrand BAROTH

    Bertrand BAROTH - 2018-12-22

    Hello ...
    I wanna control an Emic2 by Parallax via a 90S8515 and an STK200 board. So I connected the Sin of the board with PD1 ; it needs : Serial input from host. 3.3 V to 5 V TTL-level interface, 9600 bps, 8 data bits, no parity, 1 stop bit, non-inverted.
    How do I define this ? There is nothing in the "Hardware RS232 Section" of the help ... I must add that the program DOES NOT WORK with 90S but works fine with a Mega8515 (if I define the chip correctly). Are there some incompatibilities with the UART of the "old" version ?
    Thanks for answers.

     

    Last edit: Bertrand BAROTH 2018-12-22
  • Chris Roper

    Chris Roper - 2018-12-22

    Have a look in the demo's folder there are quite a few HWSerial demos for you to look at.
    From the IDE click on the "View Demos" button on the toolbar or to use the explorer look in:
    C:\GCB@Syn\GreatCowBasic\Demos\Serial Communications Solutions

    Cheers
    Chris

    Edit:
    I see you edited your post whilst mine was stuck in the cloud so I guess you found out how to do it but are not sure if your device is supported?

     

    Last edit: Chris Roper 2018-12-22
  • Bertrand BAROTH

    Bertrand BAROTH - 2018-12-22

    I tested with Mega, it worked, I went back to 90S, it didn't work anymore ... I am afraid that the "old" version of U(S)ART is not supported in GC Basic ...

     
  • mmotte

    mmotte - 2018-12-22

    Betrand,
    If the EMIC2 works on the Mega2520 then it should work on the 90S8515. The baud rate generation is the same, the sense is the same, there are no parity bits, same stop.

    ' ----- Configuration
     #chip 90S8515, 4
    ' Constantes et variables
     #define USART_BAUD_RATE 9600
     #define USART_TX_BLOCKING
     #define SerPrintLF
    

    The baud is calculated from the "USART_BAUD_RATE" and Chip speed "4"

    I noticed that you defined SerPrintLF ? Shouldn't this be CR SerPrintCR? reading in the EMIC2 pdf manual it looks like they use CR.
    I have never used this feature and have always sent CR separately, so it don't sneak up on me when i don't want a CR after a HSerprint.

    The Mega has 4 Usarts where as the 90S8515 has only 1 uart. I looked at the usart.h library file and it has the UDR and UDRE registers considered.

    I used the EMIC a few years ago and thought it was a great device. You could say anything but it wasn't especially understandable. Now I am using the DFPlayer. Not as versatile but easily understandable.

    Check you connection and try CR instead of LF and see what happens.

    GL
    Mike

     
  • William Roth

    William Roth - 2018-12-22

    I created a simple program for 90s8515 using hardware serial, then looked at the ASM. There are three suspicious variables listed.

    ;Set aside memory locations for variables
    .EQU COMPORT=102
    .EQU PRINTLEN=103
    .EQU SERDATA=104
    .EQU STRINGPOINTER=105
    .EQU SYSPRINTDATAHANDLER=106
    .EQU SYSPRINTDATAHANDLER_H=107
    .EQU SYSPRINTTEMP=108
    .EQU SYSSTRINGPARAM1=96
    .EQU U2X=109
    .EQU UBRRH=110
    .EQU UBRRL=111

    These are actually bits or registers used for UART control and baud rate stuff on other Atmel chips. The fact that they are listed here means these registers do not exist on the 90s8515. It is a much simpler UART and uses different register and bit names. A cursory review of the USART.h library indicates that the UART on the 90s8515 is not generally supported.

    It should not be too difficult for someone with more AVR knowledge than myself to add USART support for this chip. The baud rate script will need to be modified and probably a few other things as well.

     

    Last edit: William Roth 2018-12-22
  • Bertrand BAROTH

    Bertrand BAROTH - 2018-12-22

    The CR/LF is not the problem, because the program works with Mega ... except if there is a different interpretation of the instruction with 90S ! No, I think the final reason is above, the three registers which don't exist on 90S ... So, there is simply an incompatibility of the code generated by GCB with the90S. Not a real problem, I will use a Mega instead, the times where a microprocessor costed several hundreds of bucks are fortunately over !
    Thanks for Your answers ...
    PS : about the "understandability" of the Emic, look on Youtube at old demos of the SP0256, there was a significant progress with the Emic ; for myself, I have still 2 SP0's in a box, but didn't wanna build a new project with chips that are over 30 y.o.

     
  • mmotte

    mmotte - 2018-12-22

    William is correct that these registers are missing and that they define the baud rate.

    90S8515 does have a UBRR register and it is only 1 byte.
    page 58 of the pdf for 90S8515 has tables of values.
    for 4 mhz and 9600 baud UBRR would be 25
    so maybe just adding the statement UBRR = 25 after the configuration area , might be a work around until it could be added to usart.h.

    my 2 cents
    Mike

     
  • William Roth

    William Roth - 2018-12-22

    Using the ATMEGA8515 is probably a good choice since the 90s8515 is obsolete and no longer availabe from major suppliers. Microchip does not even list the 90s8515 in its parametric search for "All Devices". Mouser & Digikey both do not stock, cannot get and show obsolete status

     
  • Bertrand BAROTH

    Bertrand BAROTH - 2018-12-22

    I have a stock of 10 (!) 90S8515 (found on the Bay) ... I added the UBRR = 25 as first executable instruction and ... IT WORKS with 90 S ! Thanks Mike ...

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.