Menu

Saving

2008-04-13
2013-05-30
  • Nobody/Anonymous

    hi
    I have been playing around for a couple of hours now just turning on and off leds on a 16f628a with gcbibe the problem is that everytime i complile to hex the file dont change when programmed unless i save the file as another name
    the programmer i use is velleman k8048 and pic prog
    any ideas?

     
    • Nobody/Anonymous

      Hi

      If you are using the PIC (Velleman PIC programmer) then you will need to re-open the hex file again each time with the newly compiled/modified one. The reason for this is that Velleman K8048 will hold on to the last used hex file so it will used last loaded hex in its memory unless a reload (file-open INHX8M Hex file) routine is performed again.

      Hope this help!

      God blesses!!!

      Best regards,
      Sanyaade

       
    • Nobody/Anonymous

      hi
      from problem i have had i have had to close programmer software and even save the file as new file name in gcbibe etc... and then open that hex in the pic programmer its a bit of a pain because cant overwrite files either

      so gcbasic wont overwrite a hex???

       
    • Hugh Considine

      Hugh Considine - 2008-04-16

      Are you leaving the programming software open and then clicking Compile? If so, then the programmer software is possibly keeping the hex file open. If this is happening, then the OS won't let GCBASIC write to the file.

       
    • Nobody/Anonymous

      i spent hours playing with that and it seems ok at moment but i was closing programmer software lol lol
      I ll keep my eye on it

      ive got another question with Subs do i have to define/declare them as with other software
      because i keep having a problem with this code Nice and easy code
      WHICH wont compile

      ERROR: GCASM: symbol led_1BTFSS has not been defined

      '******************************************************************************************************************
      '***      THE CHIP MODEL & SETTINGS
      '******************************************************************************************************************
      #chip 16F628A, 4
      #config intosc_osc_noclkout

      '******************************************************************************************************************
      '***             INCLUDE FILES   
      '******************************************************************************************************************

      '******************************************************************************************************************
      '***      DEFINE GENERAL CONSTANTS
      '******************************************************************************************************************
      #define StartUpDelay 10 ms

      '******************************************************************************************************************
      '***         DEFINE PORT NAMES   
      '******************************************************************************************************************
      #define Pin1 PORTA.2
      #define Pin2 PORTA.3
      #define Pin3 PORTA.4
      #define Pin4 PORTA.5
      'Pin5 = Vss
      ''#define Pin6 PORTB.0
      '#define Pin7 PORTB.1
      '#define Pin8 PORTB.2
      #define Pin9 PORTB.3
      #define Pin10 PORTB.4
      #define Pin11 PORTB.5
      #define Pin12 PORTB.6
      '#define Pin13 PORTB.7
      'Pin14 = Vdd
      #define Pin15 PORTA.6
      #define Pin16 PORTA.7
      #define Pin17 PORTA.0
      #define Pin18 PORTA.1

      '******************************************************************************************************************
      '***           PIN DIRECTIONS    
      '******************************************************************************************************************
      'Dir Pin1 OUT
      Dir Pin2 IN
      'Dir Pin3 OUT
      'Dir Pin4 OUT
      'Pin5 = Vss
      'Dir Pin6 OUT
      'Dir Pin7 OUT
      'Dir Pin8 OUT
      Dir Pin9 OUT
      Dir Pin10 OUT
      Dir Pin11 OUT
      Dir Pin12 OUT
      'Dir Pin13 OUT
      'Pin14 = Vdd
      'Dir Pin15 OUT
      'Dir Pin16 OUT
      Dir Pin17 IN
      Dir Pin18 in

      '******************************************************************************************************************
      '***         INNITIALISATION CODE 
      '******************************************************************************************************************
      Startup:
             Wait StartUpDelay
             '*** code to setup chip     
             '*** before running app code

      '******************************************************************************************************************
      '***           MAIN PROGRAM LOOP 
      '******************************************************************************************************************
      Main:
      wait 100 ms
      if pin18 = on then
      led_1
      else pin18 = off
      end if

      '----------------------------------------------------------------------------------------------------------
      Goto Main

      sub led_1
      set pin9 on
      wait 1 sec
      set pin9 off
      wait 1 sec
      set pin10 on
      wait 1 sec
      set pin10 off
      wait 1 sec
      set pin11 on
      wait 1 sec
      set pin11 off
      wait 1 sec
      set pin12 on
      wait 1 sec
      set pin12 off
      End sub

       
    • kent_twt4

      kent_twt4 - 2008-04-16

      No need to declare/dimension subs.

      You are trying to set a pin (i.e. an output) that has been declared an input.  You really don't need the line:

      else pin18 = off

      You could change the direction of the pin locally to output, then run some code. Just remember to set as input before reading the pin again.

      You might want to debounce the switch also some number of ms, say:

      debounce:
      if pin18 On then
      wait 20 ms 'adjust as necessary
      If pin18 Off then goto debounce
      led_1
      end if

       
    • Nobody/Anonymous

      thank you for reply
      i have only just been getting started using gcbasic and i have been looking around at other code examples but got stuck with on & off (iam trying to give up smoking at the moment so my brain is everywhere  lol lol)

      i did put the 100 ms in for debounce but maybe it was to high ms
      know dought i will be asking alot of questions in the next few weeks but i will try the help file first
      Thank you

       

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.