Sign in

username:

password:



Not a member?

Search basicx



Search tips

Subscribe to basicx



basicx by Keywords

Accelerometer | ADC | ADXL | Adxl20 | AVR | BasicStamp | BX-35 | BX28 | BX35 | COM3 | Compiler | Downloader | EEPROM | Electromagnet | GetADC | GP2D1 | GPS | I2C | IDE | Keypad | LCD | LCD+ | MIDI | Motors | Multitasking | Netmedia | Networking | PCB | PID | PlaySound | PWM | Relays | RTC | Servo | ShiftOut | SitePlayer | SPI | Stack | Timer | USB

Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | BasicX | BX24 hangs on a simple(?) sub call


Advertise Here

Discussion forum for the BasicX family of microcontroller chips.

BX24 hangs on a simple(?) sub call - promixe2 - May 10 14:06:51 2009

Hello All,

I'm new to hardware related programming but have some basic experience with programming in general. I am writing an interface to control an Audio ADC chip (TI's PCM4222) and ran into a problem I can't debug (I've tried millions of things, changing code around for the entire day).

Here is the functional description of what it's supposed to do (code posted below):

After initializing itself and the character serial 2x16 LCD (I used the sample code from BasicX example), it displays the logo, then goes into polling the on-chip ADC pins 13 and 14 every 10ms and generates a meter bar for each channel (Left is Pin 13, Right is Pin 14). The entire ADCMeters() sub is working great. Then if any buttons are pushed (pin 6&7 monitor buttons), it quits ADCMeters() sub and goes into Menu() sub where I can control various parameters of the Texas Instruments chip. However, it is supposed to return back to ADCMeters by itself if no user activity is detected for a period of time (MenuIdleTimer counts for that).

The problem is: the BX24 completely hangs somewhere in between ending Menu() sub (when timing out of it if you don't push any buttons) and entering ADCMeters(). I have tried pointing it to any other sub instead of ADCMeters(). The best I could do is for the chip to still hang but cause a serial port error and entering a loop that outputs random characters into the debug window. This is best case, worst case is nothing happening in debug OR the chip....

I hope this is somewhat clear.. Here are the code files:

http://dev.ax-design.com/electronics/D2/LCD2x16Demo.bas - main file
http://dev.ax-design.com/electronics/D2/LCD2x16API.bas - LCD API
http://dev.ax-design.com/electronics/D2/LCDSerialPort.bas - serial port driver for the LCD
http://dev.ax-design.com/electronics/D2/LogoIntro.bas - logo generated with custom characters
http://dev.ax-design.com/electronics/D2/ADCMeters.bas - ADCMeters() sub and the troublesome Menu() sub there

It might be something stupid that I can't catch, but I would really appreciate if someone experienced here could find a minute to take a look at this. Thanks a lot in advance!

Promixe

------------------------------------

______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )


Re: BX24 hangs on a simple(?) sub call - "ese...@" - May 10 21:42:19 2009

I couldn't access your 5 .bas files to take a look for you.
Any suggestions?

Eric

----- Original Message -----
From: promixe2
To: b...@yahoogroups.com
Sent: Saturday, May 09, 2009 10:49 PM
Subject: [BasicX] BX24 hangs on a simple(?) sub call

Hello All,

I'm new to hardware related programming but have some basic experience with programming in general. I am writing an interface to control an Audio ADC chip (TI's PCM4222) and ran into a problem I can't debug (I've tried millions of things, changing code around for the entire day).

Here is the functional description of what it's supposed to do (code posted below):

After initializing itself and the character serial 2x16 LCD (I used the sample code from BasicX example), it displays the logo, then goes into polling the on-chip ADC pins 13 and 14 every 10ms and generates a meter bar for each channel (Left is Pin 13, Right is Pin 14). The entire ADCMeters() sub is working great. Then if any buttons are pushed (pin 6&7 monitor buttons), it quits ADCMeters() sub and goes into Menu() sub where I can control various parameters of the Texas Instruments chip. However, it is supposed to return back to ADCMeters by itself if no user activity is detected for a period of time (MenuIdleTimer counts for that).

The problem is: the BX24 completely hangs somewhere in between ending Menu() sub (when timing out of it if you don't push any buttons) and entering ADCMeters(). I have tried pointing it to any other sub instead of ADCMeters(). The best I could do is for the chip to still hang but cause a serial port error and entering a loop that outputs random characters into the debug window. This is best case, worst case is nothing happening in debug OR the chip....

I hope this is somewhat clear.. Here are the code files:

http://dev.ax-design.com/electronics/D2/LCD2x16Demo.bas - main file
http://dev.ax-design.com/electronics/D2/LCD2x16API.bas - LCD API
http://dev.ax-design.com/electronics/D2/LCDSerialPort.bas - serial port driver for the LCD
http://dev.ax-design.com/electronics/D2/LogoIntro.bas - logo generated with custom characters
http://dev.ax-design.com/electronics/D2/ADCMeters.bas - ADCMeters() sub and the troublesome Menu() sub there

It might be something stupid that I can't catch, but I would really appreciate if someone experienced here could find a minute to take a look at this. Thanks a lot in advance!

Promixe

[Non-text portions of this message have been removed]

------------------------------------



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: BX24 hangs on a simple(?) sub call - trevio2100 - May 16 14:48:28 2009

I couldn't access the files either.

The first thing I would try to figure out is whether the BXChip is hanging and being reset... or if you are stuck in an endless loop.

below is code to add to your program that helps you detect a BXChip reset.

-Trevor:

Add this as the first line in your Main sub.

Call BlinkRedLED()
Add this function
Private Sub BlinkRedLED()

Const RedLED As Byte = 25
Const LEDon As Byte = 0
Const LEDoff As Byte = 1

Dim count as Byte

count = 0
do while(count < 5)
count=count +1
Call PutPin(RedLED, LEDon)
Call Delay(0.07)
Call PutPin(RedLED, LEDoff)
Call Delay(0.07)
loop

End Sub

--- In b...@yahoogroups.com, "eserdahl@" wrote:
>
> I couldn't access your 5 .bas files to take a look for you.
> Any suggestions?
>
> Eric
>
> ----- Original Message -----
> From: promixe2
> To: b...@yahoogroups.com
> Sent: Saturday, May 09, 2009 10:49 PM
> Subject: [BasicX] BX24 hangs on a simple(?) sub call
>
> Hello All,
>
> I'm new to hardware related programming but have some basic experience with programming in general. I am writing an interface to control an Audio ADC chip (TI's PCM4222) and ran into a problem I can't debug (I've tried millions of things, changing code around for the entire day).
>
> Here is the functional description of what it's supposed to do (code posted below):
>
> After initializing itself and the character serial 2x16 LCD (I used the sample code from BasicX example), it displays the logo, then goes into polling the on-chip ADC pins 13 and 14 every 10ms and generates a meter bar for each channel (Left is Pin 13, Right is Pin 14). The entire ADCMeters() sub is working great. Then if any buttons are pushed (pin 6&7 monitor buttons), it quits ADCMeters() sub and goes into Menu() sub where I can control various parameters of the Texas Instruments chip. However, it is supposed to return back to ADCMeters by itself if no user activity is detected for a period of time (MenuIdleTimer counts for that).
>
> The problem is: the BX24 completely hangs somewhere in between ending Menu() sub (when timing out of it if you don't push any buttons) and entering ADCMeters(). I have tried pointing it to any other sub instead of ADCMeters(). The best I could do is for the chip to still hang but cause a serial port error and entering a loop that outputs random characters into the debug window. This is best case, worst case is nothing happening in debug OR the chip....
>
> I hope this is somewhat clear.. Here are the code files:
>
> http://dev.ax-design.com/electronics/D2/LCD2x16Demo.bas - main file
> http://dev.ax-design.com/electronics/D2/LCD2x16API.bas - LCD API
> http://dev.ax-design.com/electronics/D2/LCDSerialPort.bas - serial port driver for the LCD
> http://dev.ax-design.com/electronics/D2/LogoIntro.bas - logo generated with custom characters
> http://dev.ax-design.com/electronics/D2/ADCMeters.bas - ADCMeters() sub and the troublesome Menu() sub there
>
> It might be something stupid that I can't catch, but I would really appreciate if someone experienced here could find a minute to take a look at this. Thanks a lot in advance!
>
> Promixe
>
>
>
> [Non-text portions of this message have been removed]
>

------------------------------------



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )