1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

ATMEGA48 in Oshonsoft

Discussion in 'Oshonsoft' started by camerart, Aug 21, 2016.

  1. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,368
    Likes:
    11
    Location:
    Dorset UK.
    Hi,
    Has anyone programmed ATMEGA48 chips using Oshonsoft?
    I've just come across an interesting project written in BASIC, but it is slightly different from Oshonsoft.
    Camerart.
     
  2. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,251
    Likes:
    911
    Location:
    Rochdale UK
    I don't think Oshonsoft fully supports Atmel.... Probably why no-one does use it!
     
  3. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,368
    Likes:
    11
    Location:
    Dorset UK.
    Hi Ian,
    I was given a fairly new radio module for SDR, and as Basic is my only language, I thought I was lucky to find a program written in Basic. I've commented out all of the lines that won't compile, and working through them having some success as most of the program compiles.
    I'm trying to get permission, then I'll post it in the hope that someone will help me, and see if the Oshonsoft problem is get round-able.
    Thanks, C.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    266
    Likes:
    15
    Location:
    Helsinki, Finland
    ONLINE

    Which radio module?
    Is the Basic software for controlling the module?
     
  6. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    266
    Likes:
    15
    Location:
    Helsinki, Finland
    ONLINE
    In Oshonsoft pages it is mentioned that so far some models have limited support.
    I understood that ATMEGA48 is fully suppported.
     
  7. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,368
    Likes:
    11
    Location:
    Dorset UK.
    Hi,
    http://599.cz/view.php?cisloclanku=2015052801

    I now have all of the files in English, and will post them plus what I have done so far, once I get permission. (I'm pretty sure I need to do that?)
    ATMEGA48 is able to be chosen, and opens the *.BAS file ok.
    C.
     
    Last edited: Aug 24, 2016
  8. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,251
    Likes:
    911
    Location:
    Rochdale UK
    You don't need permission to post files... You can upload what you want...

    I read that the interrupts aren't modeled... Nor are they available in the simulator... You can write your own, but it'll only work outside oshonsoft's sim
     
  9. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    266
    Likes:
    15
    Location:
    Helsinki, Finland
    ONLINE
    Could you post the link in correct form
     
  10. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,368
    Likes:
    11
    Location:
    Dorset UK.
  11. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,368
    Likes:
    11
    Location:
    Dorset UK.
    Hi I,
    Am I correct that if I type TIMER0 or TIMER1 into the program, they should highlight blue? If so then they aren't available in the SIM. They are shown in the ATMEGA data sheet.
    C.
     
  12. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    266
    Likes:
    15
    Location:
    Helsinki, Finland
    ONLINE
    Do you want to change the original program?
    On that page it is said the program can be compiled with the demo version of the Bascom compiler.
    Compiling the program with Oshonsoft it might not fit in the memory.
    Is the hex code of the compiled program not included in the downloaded files?
     
  13. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,368
    Likes:
    11
    Location:
    Dorset UK.
    Hi J,
    Yes, I want to change the program.
    I saw the Bascom part, but not having the skill of versatility, I only use Oshonsoft.
    I can check the memory once I get a better compiled program, e,g, nearly completely changed.
    Yes, the HEX file is there. See attached.
    C.
     

    Attached Files:

    Last edited: Aug 24, 2016
  14. sagor1

    sagor1 Member

    Joined:
    Dec 11, 2014
    Messages:
    52
    Likes:
    2
    The Amtel 48 has different timer names, like TCCR0A and TCCR0B (control registers), and TCNT0, TCNT1 (actual count registers), etc.. They have different comparators to compare timer value to a register value (something like that). The 16 bit timer relates to TCNT1 (I think?). This is all in the Amtel48 datasheet. I have never programmed these, just that I looked up the timer names. Tried it in the AVR simulator, and these names do turn up in "blue" as you type them in.
     
    Last edited: Aug 25, 2016
  15. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,368
    Likes:
    11
    Location:
    Dorset UK.
    Hi S,
    Thanks for looking through the data sheet. The one I have is 660 pages long, so it's not an easy task.
    It looks as though it is possible, but as Ian says, perhaps won't work in the SIM. I also suppose that the whole project is also possible, but with a lot of effort, and it will need input from as many as possible.
    C.
     
  16. sagor1

    sagor1 Member

    Joined:
    Dec 11, 2014
    Messages:
    52
    Likes:
    2
    I have had timer routines (not interrupts) work properly in the SIM, but had to adjust the timer counts manually to make it "almost time up" to see the effects or the flag being set. Pin change of state interrupts do work in the SIM, I just re-checked one program I had that triggers interrupt on change of RB7 on a 16F690 and it all runs fine. Timer interrupts work fine in the SIM as well (accounting for SIM speeds and adjusted counts).

    http://www.electro-tech-online.com/threads/timerinterupt-with-16f628a-and-oshonsoft.122304/
    code works just fine in the SIM.
     
  17. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,368
    Likes:
    11
    Location:
    Dorset UK.
    Hi S,
    I am assuming that the timer routines (not interrupts) are for the Atmega48 is this correct? If they are written in basic, could you post them please?
    C.
     
  18. sagor1

    sagor1 Member

    Joined:
    Dec 11, 2014
    Messages:
    52
    Likes:
    2
    Sorry, just with the PIC series. Like I originally posted, I have not programmed the ATMega48 at all, just looked at the spec sheets for timers....
     
  19. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,368
    Likes:
    11
    Location:
    Dorset UK.
    Ok, Fine, thanks. C.
     
  20. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,368
    Likes:
    11
    Location:
    Dorset UK.
    Hi,
    I have decided to try to use a PIC instead of the recommended ATMEGA chip, and start a new thread also in the Oshonsoft forum.
    Thanks for all the efforts.
    Camerart.
     

Share This Page