Skip to main content

Messages

This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.

Messages - BrentBXR

61
Bus Pirate Support / Re: Silly UART Issue (I think PIC causing it)
Alright; I tried that...not great results.. With 'USB_INTERRUPT' disabled; the BP does not freeze due to data being sent over a secondary USB device, but it will not send data. I tried both UARTs just incase and no data is being sent. So its not freezing; I can see data coming in; but cannot send out!!!111

Man; this USB stuffs!. ohh I want the best of both worlds.. The size of the BPv4 with the simplicity and dependability of the BPv3. So far I dont know about this on-board USB stack stuffs.

Well atleast now I have my pickit2; so I can help even further by debugging instead of just poking around at code like before.

On that note; debugging the BP. What are the steps to connecting the BP? At the moment I do this:

All devices disonnected
Turn on MPLAB make sure no debugger or programmer is selected
I plug in the BP to USB
I plug the PCKIT2 in
Select the PICKIT2 as debugger

Thats the correct sequence right? otherwise wont the pickit2 try to power the BP? which then when plugged in may cause probs? I just want to make sure I dont fry anything. I already heard a pop plugging in the pickit into my circuit which the BP was powering...
62
Bus Pirate Support / Re: Silly UART Issue (I think PIC causing it)
tayken; I think you might be right; I just found an issue alot bigger then what I had been doing. this looks like a pretty serious issue in the BPv4 USB firmware

I disconnected the BP from my circuit completely; Just had it hanging onto its own USB port in HiZ mode... Iressed 'i' saw the information stuffs... Jumped over to my USPASP device and sent my PIC circuit a char; when back to the BP and it was froze again...

So for some reasoning sending data via ?any? usb (perhaps just other generic terminals? (my USBASP device is NOT ftdi; its an AVR running software USB by itself).

I will try your suggestiong right now..
65
Bus Pirate Support / Re: Silly UART Issue (I think PIC causing it)
Alright;

Per Ians idea; I ran a few more tests. I loaded the latest SVN firmware onto my BPv4 using my pickit2 so I could see where the BP freezes (This doesnt look like a source problem; its an issue with the BP it seems). So anyways I did just that. Now here is the weird part, try to follow along here but I leanred alot. My source does the following sudo code:

Code: [Select]
Info:
(STABLE UART MODULE CONNECTED TO UART1 AT 256000)
(BP CONNECTED TO UART2 AT 4800)

Code:
ON UART1-RX { WRITE CHAR TO UART1 }
ON UART2-RX (WRITE CHAR TO UART1 }

Now the weirdest part; when I send any char to UART1; even though UART2 isnt supposed to do anything; the bus pirate freezes (always!). So I connected the pickit2 and started running it in debug mode. I got the BP to freeze and hit pause; this is where it was frozen:

Code: [Select]

#ifdef BUSPIRATEV4
#pragma interrupt _USB1Interrupt
void __attribute__((interrupt, no_auto_psv)) _USB1Interrupt() {  ////// <<<<------- ARROW IS HERE? IS THAT ODD

    //USB interrupt
    //IRQ enable IEC5bits.USB1IE
    //IRQ flag IFS5bits.USB1IF
    //IRQ priority IPC21<10:8>
    //{
usb_handler();
    IFS5bits.USB1IF = 0; // PIR2bits.USBIF = 0;
    //}
}
#pragma code
#endif

So the arrow lands on the USB1 interrupt... So with that inmind I decided to remove the USB; and use my BPv3 (not in debug mode)..

So I connected it all up; UART1 and UART2 seem to work; the BP does NOT freeze when I send to UART1... But my BP doesnt seem to be sending to my PIC; but im sure I can fix that..

So the issue seems to be in bus pirate v4's usb handling...


Just some thoughts; the other UART device I am using is also USB based, and is also a 'generic' UART terminal (of course differnt ports and channels).

So is there anything I should try? There is deff somthing wrong with the USB handling here. I tried multiple bauds and nothing... Its really odd because sending to UART1 should do nothing to UART2 (thus the BP) so why is it freezing then/>
66
Bus Pirate Support / Re: Silly UART Issue (I think PIC causing it)
that source is just a collection of trying differnt things; it has no purpose or real structure. Just learning PIC's registers and such; before I didnt use the peripheral uart.h; I did that later after I learned how todo it myself (which I perfer).
67
Project development, ideas, and suggestions / Re: Still learning PICS
-Robots
I have not, ill give that a try.

-Ian
Thats a good idea; I think I will try that, running the BP in debug that is.

when I get home. Its really weird; the BP just freezes, the PIC keeps going and both UARTs still work; without the BP..

Tested in debug mode; the BP freezes on USB interrupt (see the bus pirate forum -> silly uart problem thread for more details). I used the BPv3 (which doesnt freeze, just doesnt do anything although OLS says its sending) on yet anouther pin (3rd PPS move) and now its working perfectly with my modded USBASP UART-USB tool and my BPv3.

I didnt try using BPv4 with the changes though mabye before I goto bed I will try that, might be a HUGE clue as to whats wrong with the USB deal if it does start working.. such as perhaps response...

EDIT: I tried my BPv4 again; same thing. it crashes when I try to send to UART1.

on a good note; my autobaud detection (no known char needed ;) still works like beauty :D

Code: [Select]
Select output type:
 1. Open drain (H=Hi-Z, L=GND)
 2. Normal (H=3.3V, L=GND)

(1)>

Waiting activity...

Calculated:    5092 bps

Estimated:      4800 bps

Ready
UART>

edit2: mods please delete this thread. the issue is BPv4 usb interrupt handing; it has nothing todo with my PIC testing at all..

even if the BP disconnected from my everything 100% (ecept usb of course); sending data via a secondary USB device to anything causes the BP to freeze. For whatever reason any usb activity causes the BPv4 to lockup. more details and the new thread are located viewtopic.php?f=4&t=3860&p=38963#p38963

this thread is no longer needed.
69
General discussion / Re: Murphy's ruined my weekends
I love those leosoft USBASP devices...
I have something like 8 of those boards; they make GREAT vusb development boards. I also have 2 of those MCP430 boards; (no arduinos); and 1 USBTINY.

If I was you; I would have hot aired off the chips; salvaged a couple parts from each; then purchased new (except the arduino, just toss that):

USBASP Board: ~4$ (well say 5)
MCP430: 4.30$
USBTINY: Similar designs around ~6$
UART: Similar designs around 5$

So your looking at  around 20 bucks for all new gear. then you can of course utilize the chips you removed :D

I mean thats what I would do; only because I like having spare SMD parts like the atmega8 from the USBASP; the MCP2200(??) from the UART; the atmega from the arduino, and so on... and for 20 bucks its not worth my time trying to salvage them. (I do understand the arduino is prolly worth more then all of those combined; but you own a usbtiny and a usbasp; just buy a breadboard :D no arduino needed)
70
Bus Pirate Support / BPv4 USB Interrupt and Handling (was 'Silly UART Issue')
This is a spin off of a post viewtopic.php?f=19&t=3855 where I was asking for help trying to figure out why my UART2 wasnt working; as i teach myself pics.

Anyways; it turns out its my BP's! For some reason when I connect my v4 (and v3 did the same) at 4800 baud; on my 3.3v PIC24F's UART2. When I try to send to the pic; my BP freezes. Now the weirdest part; is I tried connecting the TX of a differnt UART<->USB device with the RX connected; and when I sent to from that device to the pic; the BP still freezes... But its not on all transmissions; because normal send from the PIC to BP works fine.

I have the PIC setup with an internal interrupt on RX. The code is simply counting up and spitting that number out UART1 and UART2 every second or so. Then when a RX is sent on either; then an interrupt happens and the sent char is sent back (like GOT: 'U') on the corrosponding UART (so if UART1 gets an RX, it sends it back on UART1).

UART1 is at 256000 baud
UART2 is at 4800 baud (for use with a wireless device).

Any ideas on what could be happening during that interrupt that could cause the BP to freeze like that? The USBASP UART device I use doesnt; it works perfectly as expected.

The source code used and some more details are on the forum post I linked above..

I love my BP's and have used them for UART 100's of times; so I know somhow the circuit is doing something thats jamming up my BP's, so any help would be greatly appreciated...
71
Project development, ideas, and suggestions / Re: Still learning PICS
No one has any ideas? perhaps a bad pin or somthing?

edit: Wait.. Somthing isnt right here... This is how the config was:

My custom USBASP UART to USB device was on UART1
My BP(s) (both) had been on UART2

UART1 worked perfect; I could read (from PIC to BP) on UART2 just fine; but could not send... I decided to swap the devices; so I put the USBASP device on UART2; and bingo everything on UART2 is working fine... So I decide; I had been doing developing on my BP's so perhaps I jammed up UART; so I flashed the latest public release onto the BPv4 and tried on UART2 again... Now what is happening is whenever I try to send to the PIC; the BP freeze's and I have to reset it. So; I tried connecting the USBASP TX to UART2's RX, and BP's RX to the UART2 TX...

The BP was reading fine; but when I sent a char to UART2 via USBASP; bang the BP freezes again!...

Any ideas on why my BP's are doing that? Its really strange.. I have used UART with my BP's 100s of times so I dont understand why this is causing it to jam up like it is!
73
Project development, ideas, and suggestions / Still learning PICS
Hey guys. Im still teaching myself PICs and I am having a small issue. im using an PIC24FJ16GA002; heres the issue:

iv been playing with clocking and peripherals. This specific PIC has two on-board silica UART's.

32Mhz / 16MIPS / Internal OSC with PPL CLK

UART1 = 256000 BAUD
TX -GOOD
RX -GOOD
RX INTERRUPT -GOOD

UART2 = 4800 BAUD
TX - GOOD
RX -FAIL
RX INTERRUPT -FAIL

Now the annoying part is I am using the same exact code for UART1; on UART2. Just a different baud rate. I tried moving the PPS; I tried using both my BPv3 and BPv4; I also tried hitting some breakpoints and checking to see if the the U@ registers had data in it; or if the 'data ready' bit is set but im getting nothing. Now remember; UART1 works great, not a problem...

I attached the sources (not support.c or support.h that just holds a couple misc functions like my delay functions and so on...). Some of the stuff might be off thats only because I have been trying to tweak it to work.

[attachment=3][attachment=2][attachment=1][attachment=0]

So if any PIC guys have a free moment and wouldn't mind looking over my code; I would appreciate it.
74
Arduino / Re: Finding how much RAM you are using
I did a similure project (just to for fun; never made it past the breadboard) but using 3 spi eeproms. It was a neat idea; you could either send the hex via terminal; or you could rip it off another AVR. Then essentially hit one button and program an avr, over and over. I stored the length of the hex on the main avr's eeprom (along with the target's size; page size; so on...); then it would read up to that point off the dedicated eeprom's.

I only did it because at that moment i felt like learning how to program AVR's myself; which I already knew would be simple as its just SPI. but learning the paging and stuff like that. and that actually got me into a phase of having an AVR generate the hex and upload it to anouther avr without my interaction; on the fly. Its plausible to have one main AVR; program a secondary AVR to suite new needs or scenario's... its just its instruction set.

it worked really well; but I had no real need for it; so like with most of my projects I made it as perfect as I could, wrote the schematics, then tore it apart and started a new project :3
75
General discussion / Re: Big Box of Parts
I guess I will step up as the box monitor; everyone on Sjaak's list please PM me your address so I can create an effecient map; then each leg of its journey; I will PM the next guy; the address he needs to send it too and so on...

I will also keep a simple google map showings it little flight plan (generally; not exact addresses but area to area to keep the addresses private). And yeah; maybe a wiki page is in order? Then we can post:

Username
Date of arrival
Date of depart
and what you took and what you plan todo with it.

Instead of it being a ton of forum posts and such... just a thought

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01572454488session_write_close ( )...(null):0
20.01612586112ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01612586888Database_MySQL->query( ).../DatabaseHandler.php:119
40.06152725648Database_MySQL->error( ).../Db-mysql.class.php:273